1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-14 15:33:34 -04:00

NFMDemodSink: Proper audio scaling to 16-bit

This commit is contained in:
Kacper Michajłow
2020-11-03 14:40:14 +01:00
committed by f4exb
parent 1e5ae8ea0f
commit 00ba5115f3
5 changed files with 22 additions and 61 deletions
+13
View File
@@ -52,6 +52,19 @@ void generateLowPassFilter(int nTaps, double sampleRate, double cutoff, std::vec
int n = i - (nTaps - 1) / 2;
taps[i] *= 0.42 + 0.5 * cos((2.0 * M_PI * n) / nTaps) + 0.08 * cos((4.0 * M_PI * n) / nTaps);
}
Real sum = 0;
size_t i;
for (i = 0; i < taps.size() - 1; ++i) {
sum += taps[i] * 2.0;
}
sum += taps[i];
for (i = 0; i < taps.size(); ++i) {
taps[i] /= sum;
}
}
}