More DSP cleanup + Remove FastFFT option because it should never be used

This commit is contained in:
AlexandreRouma
2022-07-27 21:35:36 +02:00
parent 8efd5cd01a
commit 575a941e24
25 changed files with 335 additions and 86 deletions

View File

@ -1,8 +1,8 @@
#pragma once
#include "../processor.h"
#include "../math/fast_atan2.h"
#include "../math/freq_to_omega.h"
#include "../math/norm_phase_diff.h"
#include "../math/hz_to_rads.h"
#include "../math/normalize_phase.h"
namespace dsp::demod {
class Quadrature : public Processor<complex_t, float> {
@ -21,7 +21,7 @@ namespace dsp::demod {
}
virtual void init(stream<complex_t>* in, double deviation, double samplerate) {
init(in, math::freqToOmega(deviation, samplerate));
init(in, math::hzToRads(deviation, samplerate));
}
void setDeviation(double deviation) {
@ -33,13 +33,13 @@ namespace dsp::demod {
void setDeviation(double deviation, double samplerate) {
assert(base_type::_block_init);
std::lock_guard<std::recursive_mutex> lck(base_type::ctrlMtx);
_invDeviation = 1.0 / math::freqToOmega(deviation, samplerate);
_invDeviation = 1.0 / math::hzToRads(deviation, samplerate);
}
inline int process(int count, complex_t* in, float* out) {
for (int i = 0; i < count; i++) {
float cphase = in[i].phase();
out[i] = math::normPhaseDiff(cphase - phase) * _invDeviation;
out[i] = math::normalizePhase(cphase - phase) * _invDeviation;
phase = cphase;
}
return count;