# RTL-SDR data types

I am using pyrtlsdr to read samples from an RTL-SDR. As in the example on the page, I am getting samples with sdr.read_samples(x).

The RTL-SDR returns 16 bits per sample: 8 bits for I, 8 bits for Q. The result of the read_samples function is a numpy array of type complex128 ("Complex number, represented by two 64-bit floats (real and imaginary components)"). This results in readings like (-0.0196078431373+0.00392156862745j).

What am I missing?

• This question seems to have been asked in the correct place already: github.com/roger-/pyrtlsdr/issues/80 – MBaz Feb 24 '18 at 17:08
• This software normalizes the samples to be withing the range [-1,1]. Have you examined multiple samples to verify that you only get 256 distinct values? – MBaz Feb 24 '18 at 17:10
• @MBaz - why 128 bit complex type, though? – HH- Apologize to Carole Baskin Feb 24 '18 at 17:11
• I don't know, but my guess would be that the software normalizes the samples to double-precision (64 bit) floats, and then packs them into a 128-bit complex. This is not an unusual practice. – MBaz Feb 24 '18 at 17:12
• I'm glad it's useful, but I don't want to make it an answer because I'm just guessing. – MBaz Feb 24 '18 at 17:15