I'm trying to find the zero crossings of a sine wave to transform the sine wave into a square wave. The only problem is that the sine wave is noisy, so I'm getting lots of jitter and false zero crossings.
Can anyone recommend any simple psuedocode or relevant materials? So far I have something like this:
if (sample[i]>0 && sample[i+1]<0) || (sample[i]<0 && sample[i+1]>0)
Can anyone recommend a more robust method?
No comments:
Post a Comment