FFT of mains power - help me understand?  - Page 1
Forum section: electronics / beginners

author: Linwood
author_rank: Contributor
timestamp: February 17, 2025, 02:40:35 am
content: It's been many decades since college and FFT's, and haven't used it since. A discussion on generator THD got me interested and decided to explore my oscilloscope (SDS1104X-E) to see what was involved, and got stuck on step one. Avoiding the 1000 words here's what I see:Nice sine wave, appropriate frequency from the regular sample, but the FFT peaks look weird, specifically the top peak shows as 71.5hz not 60hz. If I expand the horizontal axis on the FFT I guess the issue is that it's flat on top, and it's picking the peak at the end of that flat top.This is mains power, I would not expect it to be perfect, but I really expected the peak to be nailed at 60hz +/- a tiny fraction. I also did the same for a UPS generated (PSW type) and got the same 71.5, though slightly higher peaks at higher frequencies.Am I missing something basic? Use small words, apparently the brain is not working well.LinwoodPS. A differential probe was used for sampling, but would not expect that to matter (Micsig MDP700)

author: Smokey
author_rank: Super Contributor
timestamp: February 17, 2025, 03:55:16 am
content: Looks like a bunch of quantization going on in that scope capture.Assuming USA, If you cram about 340V peak-peak into 8 bits of an oscilloscope conversion, that's only 1.3V/Bit.

author: Hammbone
author_rank: Newbie
timestamp: February 17, 2025, 03:58:30 am
content: I am using an analog discovery and a function generator but it should prove my point. You need more samples and bins in order to get an accurate frequency measurement. Oscilloscopes can be be difficult to change the number samples. Typically you need to turn off the math function and adjust the waveform so you have more cycles on screen then turn the math function back on. This can be annoying though because the FFT will update much slower.

author: Hammbone
author_rank: Newbie
timestamp: February 17, 2025, 06:14:29 am
content: Additionally, there is some yellow text in the middle of your oscilloscope screen. This tells you the frequency bin size. The frequency bin size is calculated by taking the sample rate (25Msamples/s) multiplied by the number of samples (1.049 MSamples). This gets you a frequency bin size of 23.84 Hz. So you have a bin at 23.84 Hz, 47.66 Hz, 71.5 Hz, etc. These are the only frequencies that can be reported with your current measurement settings. It just so happen that 60 Hz happens to be closest to 71.5Hz.

author: bdunham7
author_rank: Super Contributor
timestamp: February 17, 2025, 06:20:06 am
content: Quote from: Linwood on February 17, 2025, 02:40:35 amHz/div is way too high. The FFT is a bit of work to set up on these (not "a joy to use" IOW) but it works if you get it right. Try using a center frequency of 500Hz and a Hz/div of 100Hz, AKA a span of 1kHz.

author: Jeroen3
author_rank: Super Contributor
timestamp: February 17, 2025, 06:28:56 am
content: Reduce the samplerate to something like 100 ksps for better resulution fft.

author: Linwood
author_rank: Contributor
timestamp: February 17, 2025, 03:57:06 pm
content: Lot of help over night that makes sense, thank you all. Have to go photograph a baseball game now, but this evening will try again.What I'm trying is not exactly actionable data, this is a pure learning experience, so I appreciate the time you took to answer. Will review and see if I can make it happen, but sounds to some extent like it's not the best tool for this purpose.

author: bdunham7
author_rank: Super Contributor
timestamp: February 17, 2025, 06:18:48 pm
content: Quote from: Linwood on February 17, 2025, 03:57:06 pmIt isn't the most straightforward UI for this and the small screen does get crowded, but it will more or less do the job once you get the hang of setting it up. Getting the setting to even numbers can be frustrating as you'll have to change some scale to get your exact number dialed in then go back. It's a bit weird.This is a 60Hz signal from an AWG with some 5th and 11th harmonics added in.

author: benj38
author_rank: Frequent Contributor
timestamp: February 17, 2025, 10:05:01 pm
content: Quote from: Linwood on February 17, 2025, 02:40:35 amI could not resist commenting that this is far from being a "Nice sine wave"Anyway, you were given great advice already. Follow it.

author: Linwood
author_rank: Contributor
timestamp: February 18, 2025, 02:13:22 am
content: Quote from: benj38 on February 17, 2025, 10:05:01 pmWell, what I meant was "as opposed to random squiggles all over the display because I couldn't get the trigger or scale set properly. "Nice" is about expectations, I had mine set low.I bought the scope as a learning tool... also spelled "toy" I think. So still learning.Thanks to everyone. It makes sense, I did not realize the inter-relationship between the horizontal scale of the time plot on the frequency domain buckets. When I changed that I got something much better.I can now play with it a bit, and switching to my PSW UPS provided an interesting comparison (cleaner than I expected, hardly clean).Thanks again everyone for taking the time to help with silly questions.

author: golden_labels
author_rank: Super Contributor
timestamp: February 18, 2025, 08:00:33 am
content: To get some feel on the underlying mathematical problem, you may see 3blue1brown’s video.(1)Quote from: Linwood on February 18, 2025, 02:13:22 amApparently it was a good choice then. Obstacle-free experience teaches little.(1)3blue1brown “The more general uncertainity principle, regarding Fourier transform”: