Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Identifying common periodic waveforms (square, sine, sawtooth, ...)

Without any user interaction, how would a program identify what type of waveform is present in a recording from an ADC?

For the sake of this question: triangle, square, sine, half-sine, or sawtooth waves of constant frequency. Level and frequency are arbitrary, and they will have noise, small amounts of distortion, and other imperfections.

Various waveforms

I'll propose a few (naive) ideas, too, and you can vote them up or down.

like image 548
endolith Avatar asked Jul 17 '09 03:07

endolith


People also ask

What are the 4 main waveforms?

The most common periodic waveforms are the sine, triangle, square, and sawtooth. These waveforms are said to be periodic because the wave they represent can be repeated to produce a constant tone. The faster the wave repeats, the higher the pitch of the sound. Different waveforms have different harmonics.

What are the 3 types of waveforms?

Each of the three basic waveform outputs, sinusoidal, triangular and square are simultaneously available from independent output terminals.

How do you find a sawtooth wave from a square wave?

Invert the square wave (assuming something like +5 to -5) and use two inverting integrators (with analog switches to reset the capacitor on the positive side of the waveform), then sum the two integrator outputs with an inverting amplifier.

What is the difference between sawtooth wave and square wave?

While a square wave is constructed from only odd harmonics, a sawtooth wave's sound is harsh and clear and its spectrum contains both even and odd harmonics of the fundamental frequency.


2 Answers

You definitely want to start by taking an autocorrelation to find the fundamental.

With that, take one period (approximately) of the waveform.

Now take a DFT of that signal, and immediately compensate for the phase shift of the first bin (the first bin being the fundamental, your task will be simpler if all phases are relative). Now normalise all the bins so that the fundamental has unity gain.

Now compare and contrast the rest of the bins (representing the harmonics) against a set of pre-stored waveshapes that you're interested in testing for. Accept the closest, and reject overall if it fails to meet some threshold for accuracy determined by measurements of the noisefloor.

like image 146
Dave Gamble Avatar answered Sep 27 '22 16:09

Dave Gamble


Do an FFT, find the odd and even harmonic peaks, and compare the rate at which they decrease to a library of common waveform.. peak... ratios.

like image 32
endolith Avatar answered Sep 27 '22 16:09

endolith