Skip to content
Snippets Groups Projects
Commit 1a130ba9 authored by root's avatar root
Browse files

changes for compilation with input_level

parent 5a784ac9
No related branches found
No related tags found
No related merge requests found
...@@ -28,8 +28,7 @@ public: ...@@ -28,8 +28,7 @@ public:
std::size_t fft_length, std::size_t fft_length,
std::size_t naccumulate, std::size_t naccumulate,
std::size_t nbits, std::size_t nbits,
float scaling, float input_level,
float offset,
HandlerType& handler); HandlerType& handler);
~FftSpectrometer(); ~FftSpectrometer();
......
...@@ -38,7 +38,7 @@ FftSpectrometer<HandlerType>::FftSpectrometer( ...@@ -38,7 +38,7 @@ FftSpectrometer<HandlerType>::FftSpectrometer(
int batch = nsamps_per_buffer/_fft_length; int batch = nsamps_per_buffer/_fft_length;
BOOST_LOG_TRIVIAL(debug) << "Calculating scales and offsets"; BOOST_LOG_TRIVIAL(debug) << "Calculating scales and offsets";
float dof = 2 * _naccumulate; float dof = 2 * _naccumulate;
float scale = (_input_level * np.sqrt(_nchans))**2; float scale = std::pow(_input_level * std::sqrt(static_cast<float>(_nchans)), 2);
float offset = scale * dof; float offset = scale * dof;
float scaling = scale * std::sqrt(2 * dof); float scaling = scale * std::sqrt(2 * dof);
BOOST_LOG_TRIVIAL(debug) << "Generating FFT plan"; BOOST_LOG_TRIVIAL(debug) << "Generating FFT plan";
......
...@@ -63,9 +63,6 @@ int main(int argc, char** argv) ...@@ -63,9 +63,6 @@ int main(int argc, char** argv)
("input_level", po::value<float>(&input_level)->required(), ("input_level", po::value<float>(&input_level)->required(),
"The input power level (standard deviation, used for 8-bit conversion)") "The input power level (standard deviation, used for 8-bit conversion)")
("offset", po::value<float>(&offset)->required(),
"The power offset for data produced by the spectrometer (used for conversion back to 8-bit)")
("outfile,o", po::value<std::string>(&filename) ("outfile,o", po::value<std::string>(&filename)
->default_value(filename), ->default_value(filename),
"The output file to write spectra to") "The output file to write spectra to")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment