Skip to content

Instantly share code, notes, and snippets.

@cbassa
Last active November 22, 2021 16:45
Show Gist options
  • Save cbassa/04ebbe707591ee6573860268c3bd34b9 to your computer and use it in GitHub Desktop.
Save cbassa/04ebbe707591ee6573860268c3bd34b9 to your computer and use it in GitHub Desktop.
Capture spectra with STRF and an RLT SDR
#!/bin/bash
# Settings
SKY_FREQ=2242.5e6
LO_FREQ=1833e6
RATE=1e6
OUTPUT=${HOME}/satobs
FIFO=${HOME}/satobs/fifo
GAIN=30
# Remove fifo if it exists
if [ -p ${FIFO} ]; then
rm ${FIFO}
fi
# Create fifo
mkfifo ${FIFO}
# Compute IF
INTER_FREQ=`echo ${SKY_FREQ} ${LO_FREQ} | awk '{printf("%e",$1-$2)}'`
echo ${INTER_FREQ}
# Kill previous rffft instance
ps aux | grep -e "rffft" | grep -v -e "grep" | awk '{printf("kill -9 %s\n",$2)}' | sh
# Start rffft
rffft -i ${FIFO} -p ${OUTPUT} -f ${SKY_FREQ} -s ${RATE} -F char &
# Start rtl_sdr
rtl_sdr -f ${INTER_FREQ} -s ${RATE} -g ${GAIN} ${FIFO}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment