0
$\begingroup$

I am trying to detect whether a received waveform is a Sinusoid, Square Wave, or any other. How should I go about doing this, if the signal frequency can be different every time?

Reference Square Wave with 10Hz frequency Recieved Wave with 70Hz frequency

I have looked online and come across methods like Correlation or DTW, but I don't think any of them would be helpful in this case.

$\endgroup$

1 Answer 1

0
$\begingroup$

Do you want to distinguish between sine and square only, or could there be 1000s of different waveforms?

If the waveform is perfectly periodic, you could use correlation to find the fundamental period, theb use a dft/fft of that length to find the harmonics. The relative frequency/gain/phase of harmonics should be constant for a given waveform up until Nyquist.

For just a few (perfect) waveforms, I think that you could do some ad hoc in the time domain. The derivative should be quite different for square waves and sines.

$\endgroup$
1
  • $\begingroup$ Thanks, this seems helpful, I will try it. And yes, I have a select few waveforms so the harmonic methods might work. $\endgroup$ Commented May 19, 2022 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.