4 ms·
For many simple use cases, it is vastly easier to count zero crossings per unit time. One period of a sinusoid contains a single positive-to-negative and a sing
by riggsd 7y ago
For many simple use cases, it is vastly easier to count zero crossings per unit time. One period of a sinusoid contains a single positive-to-negative and a single negative-to-positive transition. No DSP required, though you may first bandpass the audio if you've got a target frequency range. Assumptions: the fundamental is the strongest harmonic present, negligible DC offset.
Simple example: For a 1.0 second audio sample, if the sign changes from +/- or -/+ 880 times, the frequency is 440Hz.
- jacquesm 7y agoHow would you adapt that method to more complex waveforms such as composites resulting from interference and harmonics?
- riggsd 7y agoStrong harmonics which overpower the fundamental will fool a zero-cross analysis, resulting in, say, a double or triple frequency output if the 2nd or 3rd harmonic is strongest. The strongest signal present will overwhelm the amplitude sign of the combined signal; so it still works even in the presence of some noise or other signal. High amplitude noise will also skew results resulting in a higher frequency output. Low-pass or band-pass filter can work wonders. Again, zero-cross analysis is suitable for simple use cases where you are directly sampling a signal.
- jacquesm 7y agoI wonder if you could take just the sign changes of the input signal and use that in lieu of the zero crossings and get something useful out of it, for instance, a finger print for chords or harmonics.