Wednesday, December 27, 2017

[Discuss-gnuradio] Serious bug in tag propagation with non-integer relative rate

Hi Eugene

> From: Eugene Grayver
> Date: Thu, 9 Nov 2017 19:52:35 +0000
>
> There is a major problem with the way tags are propagated in blocks
> with non-integer relative rate. If the ratio is not a power of two,
> the numerical accuracy of the floating point will cause the output
> tags to diverge from the input tags. Consider the fractional
> resampler. It accumulates the timing offset in the range of 0 to 1.
> However tag propagation multiplies the ratio by the sample number. As
> the sample number grows the LSB accuracy of the ratio gets scaled by
> the ever larger value. For a ratio of 1.001 we saw divergence of
> 1000s of samples over a few minutes at 10msps.

Could you please test the following branch to see if it fixes the
problem? Maybe test something simple first, like an FIR filter
decimating by 5 or 3?

https://github.com/awalls-cx18/gnuradio.git branch: tag_fix3

Or if you have a GRC or python script I can use myself for testing,
that would be great.

> I rewrote tag propagation for the resampler but did not rework the
> generic logic. I think the key point is to use the delta between read
> and written items to take out the large integer difference and then
> apply the scaling to a local delta within the current window.
>

The fix that I have made stores the relative_rate as an integer
numerator and an integer denominator, and it uses integer arithmetic to
propagate tags. (Except if enable_update_rate() is True, in which case,
precision tag placement was abandonded by the block author anyway.)

Thanks,
Andy

_______________________________________________
Discuss-gnuradio mailing list
Discuss-gnuradio@gnu.org
https://lists.gnu.org/mailman/listinfo/discuss-gnuradio

No comments:

Post a Comment