I am reading samples with an RTL-SDR, centered on an FM broadcast station:
with closing(RtlSdr()) as sdr: sdr.sample_rate = 2.4e6 sdr.center_freq = 88.9e6 sdr.gain = 'auto' x1 = sdr.read_samples(16384)
read_samples() function normalizes the data:
>>> sdr.read_samples.__doc__ Read specified number of complex samples from tuner. Real and imaginary parts are normalized to be in the range [-1, 1]. Data is safe after this call (will not get overwritten by another one).
This returns an array that I can work with, with numpy, scipy, etc.
I create arrays for the real and imaginary parts:
x3_real = x3.real; x3_imag = x3.imag
For each pair in (
for i,q in zip(x_real, x_imag)), I calculate
h=math.sqrt(i**2 + q**2). I don't expect
h to ever be larger than sqrt(2), because the real and imaginary parts are normalized to [-1, 1].
Then I downsample to several different frequencies, less than the sampling frequency, using scipy.signal's
x3 = signal.decimate(x3, ds_factor, zero_phase=True)
and repeat the hypotenuse calculations. In x2 I do not see numbers > sqrt(2), however I see numbers > sqrt(2) in the decimated signal (x3). Why is this?