I'm generating a square wave as PWM whose frequency is set to 25 Hz. On the oscilloscope, I've got:
The data referred to the image above was stored and maniputed, then I plot it using jupyter notebook, as shown below:
Applying the FFT to that signal,I've got:
The main question is: wasn't the main peak (the 2.7 V) supposed to be near 25 Hz?
UPDATE: I just did the corrections that you tell and the visualization is better! I'm still obtaining the main peak in 0 Hz, but the second harmonic is in 25 Hz ( but the amplitude is low). I also didn't get the 13 V dc offset that Chris pointed out.
UPDATE 2: I subtracted the average dc level (1.35 V) from the signal as most of you told me and I got the result I believe it's correct now:
0Hz
, becausen * 0Hz
is still0Hz
:) :) \$\endgroup\$