Software Defined Radio
  • Cover
  • Summary
  • About This Training
    • Objectives
    • Skills
    • Prerequisites
  • Introduction
    • Definitions
    • FCC
    • NCC Group
    • OsmoconSDR
    • Tips and Tricks
  • Setup
  • Hardware
    • HackRF
      • Firmware
    • RTL2838UHIDIR
    • LimeSDR
  • Laboratory
    • GNU Radio Companion
    • Python
    • GSM
    • VHF
    • SDR#
    • multimon-ng
    • Software Defined Radio Argilo
  • Python
    • FM Radio
Powered by GitBook
On this page
  1. Laboratory

Python

from rtlsdr import RtlSdr

sdr = RtlSdr()

# configure device
sdr.sample_rate = 2.048e6  # Hz
sdr.center_freq = 70e6     # Hz
sdr.freq_correction = 60   # PPM
sdr.gain = 'auto'

print(sdr.read_samples(512))
from pylab import *
from rtlsdr import *

sdr = RtlSdr()

# configure device
sdr.sample_rate = 2.4e6
sdr.center_freq = 95e6
sdr.gain = 4

samples = sdr.read_samples(256*1024)

# use matplotlib to estimate and plot the PSD
psd(samples, NFFT=1024, Fs=sdr.sample_rate/1e6, Fc=sdr.center_freq/1e6)
xlabel('Frequency (MHz)')
ylabel('Relative power (dB)')

show()
PreviousGNU Radio CompanionNextGSM

Last updated 7 years ago