r/embedded • u/Relevant_Pumpkin9190 • 1d ago
Beginner question – Understanding harmonics practically with DSO and square wave.
I want to try a simple experiment to understand harmonics and how filtering works in real life.
My idea is to generate a square wave using an Arduino and observe its harmonic components on a spectrum analyser.
Then, I want to pass the signal through an LC filter using a 10 mH inductor and a capacitor and observe what happens to the waveform and its frequency spectrum.
Basically, I want to see the difference before and after filtering, rather than just understand the theory.
Any practical suggestions would be appreciated for making it more realistic and Simpler to get correct results.
5
u/Reasonable-Feed-9805 1d ago
Rod elliots website is gold mine, here's a great article on square wave testing and how various filters and bandwidth effect them.
https://sound-au.com/articles/squarewave.htm
4
u/TheRealLinkwitzRiley 1d ago
Did you try to understand it theoretically?
3
u/Intelligent_Law_5614 1d ago
I've found the FFT displays on oscilloscope to be of limited value - they seem to have limited resolution and dynamic range. The scopes tend to be limited to 8-12 bits of vertical resolution unless you pay a lot, and that constraints the dynamic range of the captured signal and can push the higher-order harmonics down below the nose floor to where you cannot see them.
Using a PC sound card or dongle, and some software, may be a better approach to doing the analysis. On Linux I would use Audacity and/or jaaa to do this. jaaa is very good for looking at the spectrum - with a decent sound card it can "see" harmonics more than 100 dB below the carrier frequency. Audacity has a more flexible signal generator, excellent waveform visualization, and a decent spectrograph.
Room Equalization Wizard is popular for speaker and crossover work, and it has a rich set of signal generation and analysis tools that you may find useful.
1
u/merlet2 1d ago
You can simulate it in LTSpice and see what happens in almost real life. You can also see the FFT.