Electronic – Differentiating between a square wave or sawtooth wave with a circuit…

analoganalysiswave

I want to build a simple sensor that takes a 100 kHz square or sawtooth wave with a known amplitude and outputs a high if it receives a square wave or a low for sawtooth.

I'm pretty sure this requires some sort of comparator, but I'm not sure how to approach this problem myself. Could anyone outline some sort of approach? (I'd like to figure out the details).

Thank you in advance!

Best Answer

If the frequency for both waves is going to be 100 kHz with the same amplitude, you could construct a narrow bandpass filter at 200 kHz to put the signal through. In theory a pure squarewave should only have odd harmonics, so there should not be much output at the second harmonic frequency. On the other hand, a sawtooth wave has booth even and odd harmonics, so you will get a greater output. The peak amplitude for the second harmonic of a sawtooth wave will simply be \$ \frac{2A}{\pi} \$, where A is the peak amplitude of the input sawtooth. If wish you can then follow up the output of the bandpass filter with a peak detector and some kind of comparator.