kamalmostafa / minimodem

general-purpose software audio FSK modem
http://www.whence.com/minimodem
Other
854 stars 114 forks source link

Erroneous NOAA SAME codes #26

Open abirger opened 7 years ago

abirger commented 7 years ago

I am generating and decoding NOAA SAME sequences with minimodem on Raspberry Pi 3. Minimodem decodes all right any "live" sequence that I generated with another instance of minimodem as well as any recorded one. However, when I tried to use a professional grade hardware SAME decoder on the sequences generated with minimodem, I got less than perfect results - the HW decoder recognizes about a half of the generated sequence. For example, the decoder reports just this: ZCZC-WXR-FFW-012011-012086-012099=99?8+, when I feed it with the result of the following command: echo "ZCZC-WXR-FFW-012011-012086-012099-012103+0015-1231545-WXYZ/NWS-" | minimodem --tx -A0 same

It looks like the minimodem generates just half of the sequence right, and the second half is faulty. Any idea on why it is happening, and help with a fix would be greatly appreciated.

nkeck720 commented 6 years ago

If you're having the same issues I am - that would be pops and clicks in some of the transmissions - try running minimodem --tx --tx-carrier 300 a couple of times until the noise (repeated clicking/popping) stops. I don't know what causes this, I think that a buffer between minimodem and pulseaudio is overflowing or getting overwritten with garbage data. Either way, doing this seems to clear up the issue for a while. It also helps to not have my volume set up all the way, but that could just be because my sound card is wonky. If this doesn't see a fix soon I might just fork the repo and see if I can find a fix myself

zutroy97 commented 6 years ago

I'm using rtl_fm to pipe audio into pulseaudio and a different process to pipe from pulseaudio into minimodem for reading NOAA SAME codes. Minimodem output is not consistent yet reports a confidence level of over 18. Perhaps this is helpful to someone else.

pipeNoaa.sh - Read from Weather broadcast, convert and dump into a pulseaudio sink.

#!/bin/bash
while :
do
 rtl_fm -M fm -f 162.550M  | \
  pacat -p --rate=24000 --channels=1 -d Weather \
   --raw --stream-name=NoaaWeather -n WeatherRadio
 sleep 0.5
done

monitorNoaa.sh - Read from pulseaudio weather radio sink, convert to a wav format, pipe to minimodem.


while :
do
 FILENAME=noaaMonitoring_`date +%F`.txt
 pactl set-sink-volume 2 58000
 parec -d Weather.monitor --raw | \
   sox -r 44100 -t raw -es -b 16 -c 2 -V1 - -c 1 -t wav - | \
   minimodem --rx same --rx-one -c 3 -f - \
   >> $FILENAME 2>&1
 sleep 0.5
done```

Based on nkeck720's comment, I added the set-sink-volume to set the sink volume to 90% of maximum. I'm waiting for another event to determine if it helps with consistency.