Commit 1a130ba9 authored by root's avatar root
Browse files

changes for compilation with input_level

parent 5a784ac9
......@@ -28,8 +28,7 @@ public:
std::size_t fft_length,
std::size_t naccumulate,
std::size_t nbits,
float scaling,
float offset,
float input_level,
HandlerType& handler);
~FftSpectrometer();
......
......@@ -38,7 +38,7 @@ FftSpectrometer<HandlerType>::FftSpectrometer(
int batch = nsamps_per_buffer/_fft_length;
BOOST_LOG_TRIVIAL(debug) << "Calculating scales and offsets";
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 scaling = scale * std::sqrt(2 * dof);
BOOST_LOG_TRIVIAL(debug) << "Generating FFT plan";
......
......@@ -63,9 +63,6 @@ int main(int argc, char** argv)
("input_level", po::value<float>(&input_level)->required(),
"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)
->default_value(filename),
"The output file to write spectra to")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment