dgiardini / rtl-ais

A simple AIS tuner and generic dual-frequency FM demodulator
Other
266 stars 89 forks source link

fixed shifting of filter history in fifth_order() #12

Closed v15n closed 7 years ago

v15n commented 7 years ago

fifth_order() filters and decimates by two, and therefore always shifts by two input samples for every output sample. However, for the first output sample, it shifted the state from the previous call to fifth_order() by only one input sample, and it never used the last sample in its input buffer.

dgiardini commented 7 years ago

This code was taked from the original keenerd's rtl_fm.c, I think this could be intentional, at line 163 you can see the comment: / a downsample should improve resolution, so don't fully shift / Did you notice a reception improvement after the correction ?

On Thu, Apr 27, 2017 at 10:25 AM, Vincent notifications@github.com wrote:

fifth_order() filters and decimates by two, and therefore always shifts by two input samples for every output sample. However, for the first output sample, it shifted the state from the previous call to fifth_order() by only one input sample, and it never used the last sample in its input buffer.

You can view, comment on, or merge this pull request online at:

https://github.com/dgiardini/rtl-ais/pull/12 Commit Summary

  • fixed shifting of filter history in fifth_order()

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/dgiardini/rtl-ais/pull/12, or mute the thread https://github.com/notifications/unsubscribe-auth/AMKXzxh8qbNyLQSOmoJG3Fpz3IOV8TE3ks5r0JdHgaJpZM4NKNh2 .

v15n commented 7 years ago

That comment refers to the bitshift in the line below it (the FIR filter has a DC gain of 32, but the result is only shifted right by 4 bits, so not 'fully'). It's not related to time shifting of the samples.

I think I receive some more messages with the patch applied, but I don't think I could quantify that with statistical significance (too few ships within range at my location).

dgiardini commented 7 years ago

Excelent Vincent, I'll be merging your patch to the main branch.

On Sat, Apr 29, 2017 at 1:45 PM, Vincent notifications@github.com wrote:

That comment refers to the bitshift in the line below it (the FIR filter has a DC gain of 32, but the result is only shifted right by 4 bits, so not 'fully'). It's not related to time shifting of the samples.

I think I receive some more messages with the patch applied, but I don't think I could quantify that with statistical significance (too few ships within range at my location).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dgiardini/rtl-ais/pull/12#issuecomment-298179961, or mute the thread https://github.com/notifications/unsubscribe-auth/AMKXz3pARsTe1vWiYvcQDqjReaTR_d-lks5r02kmgaJpZM4NKNh2 .

--

This message represents the official view of the voices in my head