2023-08-01 04:24 AM
I am using STM32H735G-DK for signal processing. I input a 10KHZ sine wave with an amplitude of 1V from a signal generator. Using STM32H735G-DK with a sampling rate of 48000HZ, I square the sine wave and output it to an oscilloscope. However, there is a significant discrepancy between the output waveform and the calculated waveform. I would like to know what might not have been set correctly?"
2023-08-07 11:47 AM
You cannot see a 10 kHz square wave with a 48 kHz sample rate, because of this:
https://en.wikipedia.org/wiki/Square_wave#Fourier_analysis
So what you see is the base 10 kHz sine with a 30 kHz aliased around 24 kHz and resulting in 18 kHz. Ideally you should see just the 10 kHz sine, but the hardware low-pass filters are not perfect. Actually, if you would see a 10 kHz square wave, it would mean that the DAC implementation is extremely bad.