main application with tuning, playing, and GUI
This commit is contained in:
27
fmdemod.py
Normal file
27
fmdemod.py
Normal 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
|
||||
Reference in New Issue
Block a user