End sem 7; week 2 winter session 2025
This commit is contained in:
@@ -1,13 +1,31 @@
|
||||
from rtlsdr import RtlSdr
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
import scipy as sp
|
||||
#from rtlsdr.rtlsdrtcp.client import RtlSdrTcpClient
|
||||
import asyncio
|
||||
from rtlsdr import RtlSdr
|
||||
from bfm_demod import BfmDemod
|
||||
from gfsk_demod import GFSKDemod
|
||||
import sounddevice as sd
|
||||
import numpy as np
|
||||
|
||||
async def streaming():
|
||||
|
||||
def main():
|
||||
#sdr = RtlSdrTcpClient(hostname='localhost', port=12345)
|
||||
sdr = RtlSdr()
|
||||
|
||||
async for samples in sdr.stream():
|
||||
|
||||
await sdr.stop()
|
||||
sdr.set_sample_rate(2.048E6)
|
||||
sdr.set_center_freq(434.55E6)
|
||||
sdr.set_freq_correction(60)
|
||||
sdr.set_gain("auto")
|
||||
|
||||
stream = sd.OutputStream(samplerate=48E3, dtype=np.float32, channels=1)
|
||||
|
||||
sink = GFSKDemod(sdr=sdr)
|
||||
#sink = BfmDemod(sdr=sdr, stream=stream)
|
||||
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(sink.start())
|
||||
|
||||
sdr.close()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user