mhostetter / gr-adsb

GNU Radio OOT module for demodulating and decoding ADS-B packets
GNU General Public License v3.0
147 stars 44 forks source link

`RuntimeWarning: divide by zero encountered in divide` #50

Open wucke13 opened 1 year ago

wucke13 commented 1 year ago

This line yields the error. This was also mentioned in https://github.com/mhostetter/gr-adsb/issues/31. I see the error every time when I launch the script. I'm using a PlutoSDR as source.

https://github.com/mhostetter/gr-adsb/blob/5d0361d208072574e1a3a200fca07c0b334f16d0/python/demod.py#L101

mhostetter commented 1 year ago

Are you using real captured signals or synthetically-generated signals? This error occurs if the bit 0 positions have exactly 0.0000 amplitude, which is unlikely in real captured signals. An easy fix is to add a complex noise source (with very very small noise) to your signal.

But I agree, this error should be avoided.

wucke13 commented 1 year ago

This is whenever I start gnuradio with a real SDR. Maybe the PlutoSDR sends a bunch of zeros before actually receiving in the brief moment after the configuration was pushed via libiio?

On Thu, Dec 8, 2022, 20:39 Matt Hostetter @.***> wrote:

Are you using real captured signals or synthetically-generated signals? This error occurs if the bit 0 positions have exactly 0.0000 amplitude, which is unlikely in real captured signals. An easy fix is to add a complex noise source (with very very small noise) to your signal.

But I agree, this error should be avoided.

— Reply to this email directly, view it on GitHub https://github.com/mhostetter/gr-adsb/issues/50#issuecomment-1343262446, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE3USFM6P4IDVIZ5X46OOMTWMI2QHANCNFSM6AAAAAASYON6AU . You are receiving this because you authored the thread.Message ID: @.***>

thinkski commented 1 year ago

I encountered same and fixed in #52.