SDR to demodulation

Anything that we might be working on. This is where we track our individual and collective work as well as share our knowledge and experience.
Post Reply
Daniel Wee
Site Admin
Posts: 2449
Joined: Wed 25 Feb 25 2009 8:00 pm

SDR to demodulation

Post 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()
Daniel Wee
Site Admin
Posts: 2449
Joined: Wed 25 Feb 25 2009 8:00 pm

Re: SDR to demodulation

Post by Daniel Wee »

Post Reply