1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-04-11 05:59:32 -04:00

DATV demod: leandvb: fixed possible int to float conversion issues in computation

This commit is contained in:
f4exb 2019-07-17 16:10:57 +02:00
parent f2e236d401
commit c27da569d5
2 changed files with 2 additions and 2 deletions

View File

@ -327,7 +327,7 @@ struct fir_filter : runnable
{
for (int i = 0; i < ncoeffs; ++i)
{
float a = 2 * M_PI * f * (i - ncoeffs / 2);
float a = 2 * M_PI * f * (i - ncoeffs / 2.0);
float c = cosf(a), s = sinf(a);
// TBD Support T=complex
shifted_coeffs[i].re = coeffs[i] * c;

View File

@ -743,7 +743,7 @@ struct cstln_lut : cstln_base
{ // Average power in first quadrant with unit grid
int q = m / 2;
float avgpower = 2 * (q * 0.25 + (q - 1) * q / 2 + (q - 1) * q * (2 * q - 1) / 6) / q;
float avgpower = 2 * (q * 0.25 + (q - 1) * q / 2.0 + (q - 1) * q * (2 * q - 1) / 6.0) / q;
scale = 1.0 / sqrtf(avgpower);
}
// Arbitrary mapping