mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-10-21 13:19:22 +02:00
Bugfix + added meteor demodulator
This commit is contained in:
@@ -54,7 +54,8 @@ namespace dsp {
|
||||
for (int i = 0; i < count; i++) {
|
||||
|
||||
// Mix the VFO with the input to create the output value
|
||||
outVal = lastVCO * _in->readBuf[i];
|
||||
outVal.re = (lastVCO.re*_in->readBuf[i].re) - (lastVCO.im*_in->readBuf[i].im);
|
||||
outVal.im = (lastVCO.im*_in->readBuf[i].re) + (lastVCO.re*_in->readBuf[i].im);
|
||||
out.writeBuf[i] = outVal;
|
||||
|
||||
// Calculate the phase error estimation
|
||||
@@ -77,12 +78,12 @@ namespace dsp {
|
||||
}
|
||||
|
||||
if (error > 1.0f) { error = 1.0f; }
|
||||
if (error < -1.0f) { error = -1.0f; }
|
||||
else if (error < -1.0f) { error = -1.0f; }
|
||||
|
||||
// Integrate frequency and clamp it
|
||||
vcoFrequency += _beta * error;
|
||||
if (vcoFrequency > 1.0f) { vcoFrequency = 1.0f; }
|
||||
if (vcoFrequency < -1.0f) { vcoFrequency = -1.0f; }
|
||||
else if (vcoFrequency < -1.0f) { vcoFrequency = -1.0f; }
|
||||
|
||||
// Calculate new phase and wrap it
|
||||
vcoPhase += vcoFrequency + (_alpha * error);
|
||||
@@ -90,8 +91,8 @@ namespace dsp {
|
||||
while (vcoPhase < (-2.0f * FL_M_PI)) { vcoPhase += (2.0f * FL_M_PI); }
|
||||
|
||||
// Calculate output
|
||||
lastVCO.re = cosf(vcoPhase);
|
||||
lastVCO.im = sinf(vcoPhase);
|
||||
lastVCO.re = cosf(-vcoPhase);
|
||||
lastVCO.im = sinf(-vcoPhase);
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user