Professional Documents
Culture Documents
I.
INTRODUCTION
Fig. 1. The overall system diagram of the software defined radio kit
394
PYTHON
III.
RTL-SDR
395
VI.
THE WORK
When the above function is called, the program will set the
center frequency of the tuner to the lowest possible value for
obtaining the lowest portion of the radio frequency spectrum,
then, the center frequency will be increased by half sampling
rate for obtaining the higher portion of the radio frequency
spectrum. The center frequency will be increased until it
reaches the highest possible value, and the whole radio has
been constructed.
C. Capture Program
Capture program is a program for recording the radio signal
at a specified frequency range. The program takes five
parameters that are, center frequency of the tuner, sampling
396
x = iq_mod(iq_sample, fs)
Fig. 4. The overall setup of the example experiment
397
#Differentiator
dx_dt = diff(x, n=1, axis=0)/dt
dx_dt = concatenate([dx_dt,[0]])
#Envelope Detector
x_hilbert = signal.hilbert(dx_dt)
x_env = sqrt( power(x_hilbert, 2) +
power(dx_dt, 2) )
x_env = abs(x_env)
#DC Block
dc_level = average(x_env)
x_demod = subtract(x_env, dc_level)
#Plot the PSD
psd_plot(x_demod, NFFT=1024, fs=fs)
#Downsampling to ~ 44.1kHz
x_down = signal.decimate(x_demod, 23)
#Write WaveFile
wavfile.write('demod.wav', 44100, x_down)
398
IX.
CONCLUSIONS
Fig. 9. The spectrum comparison between the demodulated signal and the
original signal.
[2]
[3]
[4]
[5]
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
399