FM stereo prototype

This commit is contained in:
Ryzerth
2021-07-23 06:29:16 +02:00
parent 175e361ccd
commit 8454b40d54
10 changed files with 363 additions and 90 deletions

View File

@@ -279,11 +279,6 @@ namespace dsp {
float error;
for (int i = 0; i < count; i++) {
// Mix the VFO with the input to create the output value
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] = lastVCO;
// Calculate the phase error estimation
@@ -292,9 +287,6 @@ namespace dsp {
if (error > 3.1415926535f) { error -= 2.0f * 3.1415926535f; }
else if (error <= -3.1415926535f) { error += 2.0f * 3.1415926535f; }
// 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; }