Oscilloscope: Square wave view while in FFT mode? - Page 1
Forum section: electronics / beginners

author: tinkerbotstl
author_rank: Newbie
timestamp: January 28, 2020, 11:07:35 pm
content: Howdy,I have searched the Hantek 5072P scopes menu's and settings, the manual with search tools, google, youtube - asking the same question, and asked the same question on hantek forum, all with zero results.Full question:How do you switch to a square wave view while looking at a sine wave with FFT?Please see the following pic for exactly the display view I am looking for:You can even see a guy on youtube do it with the same scope at 0:44 seconds into the video:Thank you ahead of time

author: Range
author_rank: Newbie
timestamp: January 29, 2020, 01:20:12 pm
content: Great question, I do not know how to do that either, so I'll be watching this post.

author: PA0PBZ
author_rank: Super Contributor
timestamp: January 29, 2020, 01:30:21 pm
content: If you want to look at the FFT of a square wave you obviously have to feed a square wave into the scope.

author: tinkerbotstl
author_rank: Newbie
timestamp: January 29, 2020, 05:30:57 pm
content: But if that is the case, can you please explain to me what's happening in the video I posted, he's looking at a sine wave in fft mode, then he switches the view of the same wave? It's the same wave he's looking at, I think? The click you hear in the video is the oscilloscope switching functions but the shape of the wave is the same only after he switches functions you can then see the harmonics and he States something to the effect of here's the square wave view.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 29, 2020, 05:39:03 pm
content: The guy in the video is (most likely) driving the scope with a signal generator that outputs a sine or square determined by a switch on the SIGNAL GENERATOR. He simply turns a knob or flips a switch, or punches a button on the signal generator to change from sine to square. Nothing changes on the scope

author: tinkerbotstl
author_rank: Newbie
timestamp: January 29, 2020, 05:44:24 pm
content: FYI, I do not want to get into the issues with using an oscilloscope on AC mains.I have seen examples of AC sine waves that show the exact same view on an oscilloscope, and the AC waveform is not a square wave. So how do they get similar views on an oscilloscope of the harmonics on an AC line, on a sine wave?

author: rstofer
author_rank: Super Contributor
timestamp: January 29, 2020, 05:44:58 pm
content: He says, and he did, change the input waveform from a simple sine wave to a square wave at 0:46. The signal generator is not shown.http://www.slack.net/~ant/bl-synth/4.harmonics.html

author: rstofer
author_rank: Super Contributor
timestamp: January 29, 2020, 05:49:59 pm
content: Quote from: tinkerbotstl on January 29, 2020, 05:44:24 pmIf the FFT has more than the one spike at the fundamental frequency, that is, it shows harmonics above the fundamental frequency, it is NOT a pure sine wave. This all goes to Fourier Transforms and Fourier Series. I posted above a link to a page showing how the square wave is formed from harmonics of sine waves. The more harmonics that are included, the more square the output becomes.That's kind of the point of FFT, to show harmonic content. There may be some reason to filter out high order harmonics. In fact, there may be reasons to filter out all harmonics. The FFT will display how effective the filtering actually is.

author: rstofer
author_rank: Super Contributor
timestamp: January 29, 2020, 05:56:29 pm
content: FWIW, in the video, the author's description of the harmonics is a little unconventional. Delta freq is meaningless.The fundamental (1 kHz) is first harmonic. The next spike is the 3rd harmonic at 3 times the fundamental or 3 kHz. The next spike is the 5th harmonic and it is 5 kHz. That the 5th harmonic is 4 kHz away from the fundamental is useless information. Delta freq doesn't matter! What we want is the actual frequency and in the case of a square wave the spikes will all be odd harmonics (1st, 3rd, 5th, 7th etc).

author: tinkerbotstl
author_rank: Newbie
timestamp: January 29, 2020, 05:59:53 pm
content: Maybe my AC wave does not have the harmonics I thought. I will have to look at one I know does.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 29, 2020, 06:03:19 pm
content: Quote from: tinkerbotstl on January 29, 2020, 05:44:24 pmNo, a sine wave (a pure one, or even mostly pure one) will not have the same FFT results as a square wave. That is a fundamental fact.What is the big picture of what you are trying to solve/understand. We are here to help, but need more information.

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 29, 2020, 06:05:26 pm
content: Quote from: tinkerbotstl on January 29, 2020, 05:59:53 pmDo not confuse the terms "AC" with "sine wave." Do not use them synonymously.

author: tinkerbotstl
author_rank: Newbie
timestamp: January 29, 2020, 06:11:52 pm
content: Thanks, I am trying see the harmonics on an AC line.

author: rstofer
author_rank: Super Contributor
timestamp: January 29, 2020, 06:28:08 pm
content: Quote from: tinkerbotstl on January 29, 2020, 06:11:52 pmI don't probe mains... Even if it is full of trash, there's probably nothing you can do about it.You can safely look at the power supply output if it is a normal PC because the low voltages are referenced to the chassis ground which is earth ground which matches the earth ground on the scope. Same with the USB power, one side will be earth ground. There is an exception if the PC only has a 2 conductor power cord or it uses a power brick with a 2 conductor plug.You need to think very carefully about how you probe stuff. If is often better to check things with a DMM. For example, check the voltage between what you think is ground on the PC and an actual earth ground like the BNC connector on your grounded scope. It should be 0V or very very close. If it isn't, you can't hook the probe ground lead to that point in the circuit.Dave did a video on "How Not To Blow Up Your Oscilloscope". Watch it a few times:https://youtu.be/xaELqAo4kkQBefore you start probing power systems, you need to ask yourself "why". What do you hope to learn? What can you do if the display has trash? Is making this measurement worth a) my life (in the case of mains) b) my scope and c) my power source. If you mess up on the USB connector, you can take out the entire motherboard (in the worst case).Why do you think the USB power is noisy? It probably isn't, you know.I look at signals on PCBs and breadboards and they are usually powered by a wall wart or floating power supply. The voltages are low and I like it that way. My idea of high voltage these days is 12V. No more of the high voltage, high current, industrial systems. I'm retired!

author: Wimberleytech
author_rank: Super Contributor
timestamp: January 29, 2020, 06:31:53 pm
content: Quote from: rstofer on January 29, 2020, 06:28:08 pmAMEN and ditto (but I splurge from time to time and go to 24 volts--automatic gates are sometimes 24 volt systems).

author: rstofer
author_rank: Super Contributor
timestamp: January 29, 2020, 06:35:54 pm
content: I would expect the mains to have both odd and even harmonics. I would expect spikes all over the place.If I absolutely HAD to measure the mains, I would probably use a step-down transformer to reduce the voltage and remove the earth ground reference. A little 120-6.3V filament transformer would be ideal. There would be no ground reference in the output so I could connect my scope without worry.The transformer itself will introduce and eliminate harmonics. Anything that distorts a pure sine wave will do something to the harmonics. But it might not be significant and certainly there is value in the added safety.Did I mention that I don't probe mains? Of course I did! There's a reason I don't like jamming my scope probe in wall outlets.

author: rstofer
author_rank: Super Contributor
timestamp: January 29, 2020, 06:44:29 pm
content: Quote from: Wimberleytech on January 29, 2020, 06:31:53 pmOK, just this once!The problem with a forum reply is that it won't discuss ALL of the ways this kind of thing can go sideways. I'm perfectly will to say "I don't probe mains" if it discourages the practice. I can't be there to watch the process so I just try to discourage it. Have I done it? Sure! But I'm not going to talk about it.

author: james_s
author_rank: Super Contributor
timestamp: January 29, 2020, 07:07:43 pm
content: There's an easy and safe way to probe mains if you really want to do that, use a HV differential probe. I have a Tektronix P5205 that I use when I need to measure something like the primary side of a switchmode power supply. I've never bothered to look for harmonics on the AC line though, as others have said it doesn't really matter what's there because you can't do anything about it anyway. Just measure the output of the power supply, if you see noise you can work on figuring out the source but in most cases I would expect that it's internally generated by the power supply. It's pretty hard for noise on the line to get through a switchmode power supply, those tend to generate quite a lot of their own noise.

author: PA0PBZ
author_rank: Super Contributor
timestamp: January 29, 2020, 07:08:12 pm
content: Quote from: tinkerbotstl on January 29, 2020, 06:11:52 pmFirst thing a computer power supply does is rectifying (turning into DC) the incoming AC, then it gets smoothed by one or more capacitors, then it creates a new AC voltage of much higher frequency, this goes into a transformer which outputs different voltages, they get rectified again, smoothed and finally you have your output voltages of +12, -12, +5, -5 and 3.3VWill you be able to see the incoming AC voltage harmonics on the 5V line? Nope!

author: rstofer
author_rank: Super Contributor
timestamp: January 29, 2020, 07:22:07 pm
content: These replies get back to my point:1) Where do you expect to probe?2) What do you expect to see?3) What can you do about it if you do see it?4) Is seeing something you can't change worth the risk of probing the circuit?

author: SilverSolder
author_rank: Super Contributor
timestamp: January 29, 2020, 07:34:50 pm
content: Quote from: tinkerbotstl on January 29, 2020, 06:11:52 pmAre you getting audio interference in a USB sound card or something like that?

author: tinkerbotstl
author_rank: Newbie
timestamp: January 29, 2020, 08:11:19 pm
content: I was specifically hoping to avoid all of the comments about the dangers of probing mains. Just need to see the harmonics on the AC line.

author: james_s
author_rank: Super Contributor
timestamp: January 29, 2020, 10:26:18 pm
content: Well your original question made no sense at all, because there's no such thing as a "square wave view", if you want to look at the frequency spectrum of a square wave, you feed a square wave to the scope, the FFT on the scope displays the spectra of whatever signal you put into it, nothing more.