Page 1 of 1

### Max Frequency of Square Wave

Posted: Wed Jul 29, 2020 2:57 pm
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.

### Re: Max Frequency of Square Wave

Posted: Thu Jul 30, 2020 4:02 pm
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