From d9d0fc00edf53bafc03517d53ef2969606d23905 Mon Sep 17 00:00:00 2001 From: Mark Jessop Date: Sat, 22 Dec 2018 14:17:27 +1030 Subject: [PATCH] Do a proper calculation of the required SDR tuning offset, based on fsk_demod's acquistion range. --- start_rx.sh | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/start_rx.sh b/start_rx.sh index 20a66bd..73d61bd 100755 --- a/start_rx.sh +++ b/start_rx.sh @@ -54,9 +54,7 @@ RX_FLOW=IQ # Modem Settings - Don't adjust these unless you really need to! # BAUD_RATE=115177 # Baud rate, in symbols/second. -OVERSAMPLING=8 # FSK Demod Oversampling rate -TUNING_OFFSET=200000 # SDR Tuning Offset, in Hz, to centre the Wenet signal in the fsk demod passband. - # 200 kHz is about right for a 'standard' 115k Wenet TX signal +OVERSAMPLING=8 # FSK Demod Oversampling rate. 8X oversampling works best for 115k FSK # # Main Script Start... Don't edit anything below this unless you know what you're doing! @@ -73,10 +71,14 @@ python TelemetryGUI.py $MYCALL & # Calculate the SDR sample rate required. SDR_RATE=$(($BAUD_RATE * $OVERSAMPLING)) -# Calculate the SDR centre frequency -RX_SSB_FREQ=$(($RXFREQ - $TUNING_OFFSET)) +# Calculate the SDR centre frequency. +# The fsk_demod acquisition window is from Rs/2 to Fs/2 - Rs. +# Given Fs is Rs * Os (Os = oversampling), we can calculate the required tuning offset with the equation: +# Offset = Fcenter - Rs*(Os/4 - 0.25) +RX_SSB_FREQ=$(echo "$RXFREQ - $BAUD_RATE * ($OVERSAMPLING/4 - 0.25)" | bc) echo "Using SDR Sample Rate: $SDR_RATE Hz" +echo "Using SDR Centre Frequency: $RX_SSB_FREQ Hz" if [ "$BIAS" = "1" ]; then echo "Enabling Bias Tee"