Skip to content

Commit

Permalink
Cleanup TX/RX scripts and disable buffering.
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiw committed Aug 18, 2024
1 parent 169a4f3 commit 5a325b1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
17 changes: 10 additions & 7 deletions radae_demo_rx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@
RADAE_PATH=$1
RADAE_VENV=$2

# Current RADAE scripts seem to require being executed from
# the RADAE folder.
cd $RADAE_PATH

# The below does the following:
# * For each block of OTA audio from freedv-gui:
# * Convert the audio into IQ data via zero-padding.
# * Convert the 8 kHz audio into IQ data via zero-padding.
# * Pass the IQ data into the RADAE decoder
# * Send the resulting 16 kHz audio back to freedv-gui.
$RADAE_VENV/bin/python3 $RADAE_PATH/int16tof32.py --zeropad | $RADAE_VENV/bin/python3 $RADAE_PATH/radae_rx.py $RADAE_PATH/model19_check3/checkpoints/checkpoint_epoch_100.pth -v 2 --auxdata | $RADAE_PATH/build/src/lpcnet_demo -fargan-synthesis - -
# * Send the resulting 16 kHz audio back to freedv-gui for playback.
#
# Note: Current RADAE scripts seem to require being executed from
# the RADAE folder.
cd $RADAE_PATH
export PATH=$RADAE_VENV/bin:$PATH
stdbuf -i0 -o0 python3 int16tof32.py --zeropad | \
stdbuf -i0 -o0 python3 radae_rx.py model19_check3/checkpoints/checkpoint_epoch_100.pth -v 2 --auxdata | \
stdbuf -i0 -o0 build/src/lpcnet_demo -fargan-synthesis - -
18 changes: 10 additions & 8 deletions radae_demo_tx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
RADAE_PATH=$1
RADAE_VENV=$2

# Current RADAE scripts seem to require being executed from
# the RADAE folder.
cd $RADAE_PATH

# The below does the following:
# * For each block of OTA audio from freedv-gui:
# * Convert the audio into IQ data via zero-padding.
# * Pass the IQ data into the RADAE encoder
# * For each block of microphone audio from freedv-gui:
# * Extract features from 16 kHz input audio.
# * Pass features into the RADAE encoder.
# * Send the resulting 8 kHz audio back to freedv-gui.
#
# Note: Current RADAE scripts seem to require being executed from
# the RADAE folder.
cd $RADAE_PATH
export PATH=$RADAE_VENV/bin:$PATH
$RADAE_PATH/build/src/lpcnet_demo -features - - | $RADAE_VENV/bin/python3 $RADAE_PATH/radae_tx.py $RADAE_PATH/model19_check3/checkpoints/checkpoint_epoch_100.pth --auxdata | python3 $RADAE_PATH/f32toint16.py --real --scale 16383
stdbuf -i0 -o0 build/src/lpcnet_demo -features - - | \
stdbuf -i0 -o0 python3 radae_tx.py model19_check3/checkpoints/checkpoint_epoch_100.pth --auxdata | \
stdbuf -i0 -o0 python3 f32toint16.py --real --scale 16383

0 comments on commit 5a325b1

Please sign in to comment.