mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-07-31 21:12:28 -04:00
DATV demod: leandvb: fixed possible int to float conversion issues in computation
This commit is contained in:
parent
f2e236d401
commit
c27da569d5
@ -327,7 +327,7 @@ struct fir_filter : runnable
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < ncoeffs; ++i)
|
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);
|
float c = cosf(a), s = sinf(a);
|
||||||
// TBD Support T=complex
|
// TBD Support T=complex
|
||||||
shifted_coeffs[i].re = coeffs[i] * c;
|
shifted_coeffs[i].re = coeffs[i] * c;
|
||||||
|
@ -743,7 +743,7 @@ struct cstln_lut : cstln_base
|
|||||||
|
|
||||||
{ // Average power in first quadrant with unit grid
|
{ // Average power in first quadrant with unit grid
|
||||||
int q = m / 2;
|
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);
|
scale = 1.0 / sqrtf(avgpower);
|
||||||
}
|
}
|
||||||
// Arbitrary mapping
|
// Arbitrary mapping
|
||||||
|
Loading…
x
Reference in New Issue
Block a user