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

前端 未结 7 2240
盖世英雄少女心
盖世英雄少女心 2021-02-09 10:31

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

7条回答
  •  逝去的感伤
    2021-02-09 10:55

    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.

提交回复
热议问题