Max Frequency of Square Wave

uncShaun
Posts: 1
Joined: Fri Jun 26, 2020 8:26 pm

Max Frequency of Square Wave

Hello,

I would like to generate square waves of 0.5 Vpp with a frequency up to 20 MHz using the fast analog outs.

Is this possible?

Looking at the output waveform on an oscilloscope the square wave starts looking bad somewhere around 4-5 MHz.

Is the DAC slew rate too slow, or is there a filter on the outputs?

Thanks.

alex123go
Posts: 14
Joined: Mon May 04, 2020 4:46 pm

Re: Max Frequency of Square Wave

Hello,

I'm not 100% sure I have the right approach, but I think it's normal (depending of what you mean by looking bad).

Here are some reasons it looks normal.

1. The bandwidth of the Red Pitaya output is 50 MHz (https://redpitaya.readthedocs.io/en/lat ... astIO.html). A square wave consists of odd multiple of the fundamental frequency (20 MHz in your case) : a*sin(2*pi*1f*t) + b*sin(2*pi*3f*t) + c*sin(2*pi*5f*t) + ... (https://mathworld.wolfram.com/FourierSe ... eWave.html)
The more multiples are generated, the more perfect the square wave looks. With your 20 MHz square wave, it contains the frequencies 20 MHz, 60 MHz, 100 MHz, etc. The 20 MHz is ok, the 60 MHz is attenuated a lot (approx -6 dB on the graph), but the 100 MHz is surely not present on your output signal. Therefore, the 20 MHz square will look a lot like a sine wave.

2. It's worth to make sure your oscilloscope has a high enough sampling rate and enough bandwidth for your signal. Most oscilloscopes are ok, but it's better to be sure.

3. Also , you can't have 20 MHz exactly. the closest you can get is 20.833 MHz, which corresponds to 6 points positive voltage and 6 points negative voltage.

Hope this helps,
Alex

bma
Posts: 6
Joined: Wed Sep 23, 2020 9:54 am

Re: Max Frequency of Square Wave

Hi,

I confirm @alex123go, above 1MHz with DAC, you see a lot of ripple.
Here a example:

Do you consider to use the GPIO of thePL ?
I didn't tried, but you will be mainly impacted by the residual capacitance, not by the harmonic cutoff.

redpitaya
Posts: 448
Joined: Wed Mar 26, 2014 7:04 pm

Re: Max Frequency of Square Wave

This distortion is not present when using good quality cables of higher bandwidth. Please try with the scope probes that came with your Red Pitaya.

redpitaya