Page 1 of 1

Undersampling with the Red Pitaya

Posted: Wed Aug 02, 2017 8:53 am
by Dazza101
Hi All,

I'm working on an FMCW radar that uses the Red Pitaya for control and as the ADC. I'm using the provided C API and a decimation factor of 8, to perform undersampling in the second Nyquist band.
As my signal increases past Fs/2 my signal amplitude begins to drop drastically. For example: a 10 MHz 2 Vpp signal appears as 0.8 Vpp once sampled. All my development work takes place in C and I have yet to fiddle with the FPGA. I'm wondering if the Red Pitaya applies some sort of digital frequency compensation based on the set decimation factor? And If I could disable or correct this?

Kind Regards
Darryn

Re: Undersampling with the Red Pitaya

Posted: Wed Aug 02, 2017 5:39 pm
by jeanminet
Hi,

Maybe the decimation includes the averaging of the 8 consecutive samples in the FPGA.
The frequency response of the averaging is sin(x)/x where x = pi * 8 * f / 125 MHz.
That gives 0.9 Vpp for a 10 MHz, 2 Vpp signal.

Looking at the corresponding Verilog module (https://github.com/RedPitaya/RedPitaya/ ... dec_avg.sv), it looks like you can disable averaging.

Jean

Re: Undersampling with the Red Pitaya

Posted: Wed Aug 02, 2017 9:34 pm
by Dazza101
Hi Jean!

Thank you for your reply! I think you are exactly right - I hadn't considered the effect of averaging.
I've attached the theoretical frequency response of an 8-point moving average, which appears to correspond to my recordings.
I'll test with other frequencies when I have access to my RP tomorrow.

Kind Regards
Darryn

Re: Undersampling with the Red Pitaya

Posted: Thu Aug 05, 2021 6:05 am
by smwright
This was helpful, I am also trying to undersample, but using python. It there a way to turn OFF the averaging? Other posts explained that the SCPI commands for AVG are not supported. There is a post from 2015 that refers to an FPGA register that shuts it off using the monitor utility, but this did not work. Please, is there anyway to disable averaging when using remote control (python w/ scpi commands) when decimating, otherwise it is impossible to undersample.