EveryCircuit
Contact
Reviews
Home
eekee
modified 7 years ago

Measuring the sines in a square wave

2
2
139
01:27:05
"Overnight circuit" -- don't expect too much from a quick look, or even from an hour! It needs to be that slow, or it doesn't work right. Table of results below. One reason for the slowness is that the 9kHz filter needs an extremely high Q to filter out 7kHz. Only 1/1000 (-60dB) of the 7kHz harmonic comes through the 9kHz filter. The other filters don't need to be so tight, but there's no point finding the lower resistor values when the 9kHz filter takes so long to come up to full output anyway. Or maybe there was a point: It would have saved me finding the right value for the extra capacitor in at least 2 of the filters. With such a high Q, the filters need to be very accurate. The other reason it's so slow is because transient simulation isn't very good at simulating filters, so it needs that 29.3kHz source with the consequent limit on how fast the simulation runs. It's 29.3kHz because I wanted to avoid anything that might be a multiple of any of the signals. Results from +-1v square wave input: 1khz 1.23v 3khz 388mv 5khz 209mv 7khz 125mv 9khz 76mv All are in phase, if that makes sense. Precision may be 0.1% at best. Re-assembling the results: http://everycircuit.com/circuit/4904379164655616
published 7 years ago
hurz
7 years ago
its a nightmare to do such things in everycircuit, as slow everything is, but transient needs its time. a spectrum analyser for odd harmonics, for odd and even and limited to 9 harmonics it might be use to condens other waveshapes then rectangles. like heartbeat waveform, or results of other circuits. any very time consuming. definitive not the right tools but i can imagine its fun to do it this way and understand fourier from base! btw, its used to compress data. its with loss cuz of limited harmonics and quantization of values, but can be taken to approximate complex wave shape to a smaller vector. ringing is a problem to fit begin and end of periodes. with some postprocessing on this vector it can be made with simple triangle or hamming, kaiser ir gauss or cosinus.... just fun to go back and forth in mind and circuits on everycurcuit. back and forth in time and frequency domain and see how dufferent they can be use and also to see how equivalent in shap of filter graph bode plot and response in time domain they are. fun fun fun!
eekee
7 years ago
Ah yes! Thanks for these suggestions :)

EveryCircuit is an easy to use, highly interactive circuit simulator and schematic capture tool. Real-time circuit simulation, interactivity, and dynamic visualization make it a must have application for professionals and academia. EveryCircuit user community has collaboratively created the largest searchable library of circuit designs. EveryCircuit app runs online in popular browsers and on mobile phones and tablets, enabling you to capture design ideas and learn electronics on the go.

Copyright © 2026 by MuseMaze, Inc.     Terms of use     Privacy policy