Direct sampling to bandwidth output, how done?

Main forum to discuss RTL-SDR related topics.
Post Reply
tustinfarm
Posts: 6
Joined: Wed Jan 29, 2020 12:18 am

Direct sampling to bandwidth output, how done?

Post by tustinfarm » Sat Aug 01, 2020 3:17 pm

This is fairly deep technical question that applies to all SDRs, purely my curiosity, posting on the chance there is an SDR expert out there who can answer it in a simple manner, or post a hyperlink...

I have always wondered how the raw ADC samples in the RTL-SDR dongle (28.8 megasamples/second?) are processed and downsampled to the lower rates needed to transfer data out of the dongle to the PC software for a given bandwidth setting. In other words, a 2 MHz bandwidth setting requires a lot more bits/second from the USB connection than a 1 MHz setting, but how exactly is the original raw data from the ADC sampling transformed in the dongle? Is a FFT done, followed by filtering at the selected the bandwidth, then a reverse transform? Or some kind of mathematical averaging on the entire stream to downconvert it?

hotpaw2
Posts: 137
Joined: Sat Jan 14, 2017 11:07 pm
Contact:

Re: Direct sampling to bandwidth output, how done?

Post by hotpaw2 » Mon Aug 03, 2020 3:44 pm

The mathematically correct solution is to use a perfect band-limiting anti-aliasing or low-pass filter before decimation or interpolation. In reality, no filter is perfect. So an anti-aliasing filter should have a stop band attenuation below the radio's desired noise floor at and above the new downsampled sample rate.

Anti-alias filtering can be implemented in software or hardware by many different methods, including using a high-order IIR filter, or using a windowed Sinc or computer optimized FIR filter. An IIR is usually implemented by sections of recursive arithmetic (biquads, corresponding to sections of analog LC filters). A IIR works similar to averaging, but due to feedback and multiple sections, is a lot smoother in the frequency domain. A FIR filter can be implemented by straight convolution (a lot of vector arithmetic), perhaps using a polyphase filter bank or Farrow interpolator for each set of FIR filter coefficients. or by overlap-add/save FFT/IFFT fast convolution for greater efficiency. There are other solutions including CIC filters and incremental multi-rate filtering and downsampling (reducing the sample rate in steps).

For fractional sample rate ratio changes, one can also upsample before downsampling, but I prefer polyphase interpolation methods to upsampling as more computationally efficient.

Band-pass filtering plus under-sampling can also be used for downsampling a tuned spectrum slice. But, more commonly, heterodyning down to complex or IQ baseband before low-pass filtering seems to be a more efficient and commonly implemented algorithm.

Post Reply