main application with tuning, playing, and GUI

This commit is contained in:
Brandon4466
2024-01-14 23:41:53 -08:00
commit 7ee950b2c5
21 changed files with 388 additions and 0 deletions

27
fmdemod.py Normal file
View File

@@ -0,0 +1,27 @@
from pydub import AudioSegment
from pydub.effects import low_pass_filter
from pydub.playback import play
import sounddevice as sd
import numpy as np
# Input file path
input_file = "fm_data.raw"
# Load the audio file
audio = AudioSegment.from_file(input_file, format="raw", sample_width=2, channels=1, frame_rate=170000)
# Apply low pass filter (if needed)
audio = low_pass_filter(audio, 75000)
play(audio)
# Convert to numpy array
# samples = np.array(audio.get_array_of_samples())
# # Play the audio using sounddevice
# sd.play(samples, samplerate=audio.frame_rate)
# sd.wait()
# audio.export("fm_data.wav", format="wav")
# rx_fm -f 94.7M -M fm -s 170k -A fast -l 0 -E deemp -d driver=hackrf fm_data.raw