Hi,

This patch for printing deviation in rtl_fm replace the previous one. This version have some improvements and bugfixes.

* Had forgotten to adjust the demodulation result using the sample rate.

* A flat top window is now applied before the Goertzel calculation to get
      better amplitude estimates.

    * The Goertzel bandwith is now 20Hz instead of 100Hz.

    * The deviation estimate is now adjusted to account for lost power due
      to bandpass filtering the received FM signal.

A comment about the last item: FM in theory have unlimited bandwidth so some power will be lost when the passband is limited. The adjustment I've done is really not theoretically sound but it seem to work pretty well. I used a third degree polynomial and curve fitting to estimate the needed adjustment. The polynomial will map the relation "tone frequency / sample rate" to the adjustment factor.
If someone know how to do this adjustment properly, please tell me.

The new patch (v2) has been attached to this email. I have also attached an updated version of my combined patch (v3).

Regards,
Tobias


On 2014-08-07 11:43, Tobias wrote:
Hi,

I've implemented a FM deviation measurement mode in rtl_fm. It's turned on using the -D command line switch.

        [-D [tone freq]] Print the deviation of an FM signal.
            If given without a tone frequency, the whole bandwidth
            is used in the measurement. This include a lot of noise on
            weak signals so the measurement will not be so good.
            If a deviation measurement is done on a single tone the
            tone frequency should be given to improve the accuracy
            of the estimate.

If measuring on the whole bandwidth a simple min/max measurement is done on the demodulated signal and the deviation is determined from the difference. This work ok for very strong signals but just a little bit of noise will mess up the estimate. This mode can be used to get an approximate estimate for a voice signal for example.

If a tone frequency is given then the Goertzel single bin DFT algorithm is used to find out the amplitude of the tone. This is much better since all noise outside of the binwidth (100Hz) will be removed.

The patch is attached to this mail (sm0svx-print_deviation.patch.gz). I have also attached a patch that is a combination of my previous patch and the print_deviation patch (sm0svx-combined.patch.gz). I did this since the two patches conflict with each other in quite a few places. Hopefully this will make it easier for the maintainer to merge.

The code is also available on GitHub but I didn't create a pull request since that does not seem to be the way you want to work with patches. Tell me if you want me to create a pull request after all.

    https://github.com/sm0svx/librtlsdr/tree/print_deviation
    https://github.com/sm0svx/librtlsdr/tree/sm0svx

Regards,
Tobias


Attachment: sm0svx-print_deviation-v2.patch.gz
Description: application/gzip

Attachment: sm0svx-combined-v3.patch.gz
Description: application/gzip

Reply via email to