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

@@ -43,7 +43,7 @@ namespace dsp::demod {
pilotFirTaps = taps::bandPass<complex_t>(18750.0, 19250.0, 3000.0, _samplerate, true);
pilotFir.init(NULL, pilotFirTaps);
rtoc.init(NULL);
pilotPLL.init(NULL, 25000.0 / _samplerate, 0.0, math::freqToOmega(19000.0, _samplerate), math::freqToOmega(18750.0, _samplerate), math::freqToOmega(19250.0, _samplerate));
pilotPLL.init(NULL, 25000.0 / _samplerate, 0.0, math::hzToRads(19000.0, _samplerate), math::hzToRads(18750.0, _samplerate), math::hzToRads(19250.0, _samplerate));
lprDelay.init(NULL, ((pilotFirTaps.size - 1) / 2) + 1);
lmrDelay.init(NULL, ((pilotFirTaps.size - 1) / 2) + 1);
audioFirTaps = taps::lowPass(15000.0, 4000.0, _samplerate);
@@ -82,8 +82,8 @@ namespace dsp::demod {
pilotFirTaps = taps::bandPass<complex_t>(18750.0, 19250.0, 3000.0, samplerate, true);
pilotFir.setTaps(pilotFirTaps);
pilotPLL.setFrequencyLimits(math::freqToOmega(18750.0, _samplerate), math::freqToOmega(19250.0, _samplerate));
pilotPLL.setInitialFreq(math::freqToOmega(19000.0, _samplerate));
pilotPLL.setFrequencyLimits(math::hzToRads(18750.0, _samplerate), math::hzToRads(19250.0, _samplerate));
pilotPLL.setInitialFreq(math::hzToRads(19000.0, _samplerate));
lprDelay.setDelay(((pilotFirTaps.size - 1) / 2) + 1);
lmrDelay.setDelay(((pilotFirTaps.size - 1) / 2) + 1);

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;