Closed argilo closed 12 months ago
GNU Radio uses volk_32f_x2_dot_prod_16i
in the Float->Short variants of the Decimating & Interpolating FIR Filter blocks. Distortion can be observed with the following flow graph:
Before:
After:
It's a bit easier to see what's going on with the floating point signal in the picture as well:
Before:
After:
It turns out there are two GNU Radio tests which assert the truncate-toward-zero behaviour:
Those tests now fail. I'll have to think about what the best solution is.
The failing tests were fixed in https://github.com/gnuradio/gnuradio/pull/6980.
Fixes #673.
Most kernels with integer outputs use
rintf
to round the output. Butvolk_32f_x2_dot_prod_16i
andvolk_32fc_s32f_deinterleave_real_16i
cast directly toint16_t
, which introduces truncate-toward-zero distortion. Here I've switched the affected kernels to userintf
instead.