# Understanding unexpected i/q calculation on a downsampled signal

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'


The 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 decimate() function:

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?

Because the decimate function does not try to keep power constant.

Remember that decimation is not inherently an LTI operation; so, probably, the authors of that function simply did not care too much for keeping the amplitude of a passband signal constant.

Note that a decimation step typically includes filtering to $\frac1{\text{ds_factor}}$ of the original bandwidth to avoid aliases. That filter might or might not have a passband gain $\le 1$.

A general remark:

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].

In fact, if coming right out of a receiver with good IQ balance, don't expect $h\ge1$, even!

Remember that I and Q aren't independent; they are the inphase and quadrature component of a signal whose max power, no matter which phase, is limited! Thus, as long as you don't risk clipping in your receiver, $i^2 \le {1-q^2}\iff q^2\le 1-i^2$!

If your I and Q would be independently limited to an amplitude of 1, your $\sqrt 2$ would be right. They are not – imagine, for example, the passband signal that gives you $i\equiv1$: it's the cosine with the carrier frequency $1\cdot\cos(2\pi f_c t + 0)$ (note the $0$ phase). Now, any cosine with larger power would clip, right? Obviously, cosines of the same amplitude would also be at the extreme power limit, no matter whether they have zero phase. The moment the phase is not zero, you'll see some of the cosine's energy appear on Q, and missing on I. However, it's the same power.

• Thank you. I am using this data to get a general understanding of the signal under observation. E.g. if all the points form a circle toward the outskirts of a constellation diagram created from this data, I assume it's an FM signal. For my outliers (which I've seen up to 3!), can I simply throw them away? There don't seem to be very many as extreme as 3, but there are many that are > 1, < 1.5 – horse hair Mar 9 '18 at 21:29
• I don't understand your comment. What do you mean with "throw away", and why are they even a problem? again, you're not describing what you're doing to the signal, only the symptopms. Also, this sounds like you've got a totally different question, something like "how can I implement a robust FM demodulator given signal outliers". By the way, your FM classification method is unsuitable - any modulation that is constant envelope but not frequency-synchronized would form such a circle, and the whole point of doing FM is that it's robust to amplitude variations, i.e. fading channels. – Marcus Müller Mar 9 '18 at 22:15