Page 1 of 1

SDR to demodulation

Posted: Tue 20 Jul 20 2021 12:06 pm
by Daniel Wee
Linux appears to have much better driver support for SDR radios such as the RTL_SDR and HackRF One which is what we're using. You will need to first install the relevant modules:-

Code: Select all

sudo apt install hackrf libhackrf-dev
We then need some kind of Python wrapper to aid experimentation. I am getting some luck with:-

https://github.com/dressel/pyhackrf

Code: Select all

from libhackrf import *
from matplotlib.pyplot import psd, xlabel, ylabel, show

hackrf = HackRF()
hackrf.sample_rate = 2e6
hackrf.center_freq = 145e6

samples = hackrf.read_samples(2e6)

psd(samples, NFFT=1024, Fs=hackrf.sample_rate/1e6, Fc=hackrf.center_freq/1e6)
xlabel('Frequency (MHz)')
ylabel('Relative power (dB)')
show()

Re: SDR to demodulation

Posted: Tue 20 Jul 20 2021 12:09 pm
by Daniel Wee