I have an incoming sine test signal from a microphone. I know that I can find a peak amplitude just by scanning the vaweform samples and looking for max magnitude (taking into account that it may be also negative). I take chunks about 500ms.
The problem is that incoming signal might contain occasional short peaks because of noises. That is why I cannot measure the max magnitude - I might find the peak level of the noise.
Is there some stable algorithm which would allow me to calculate an major peak value of the waveform chunk but throw away some short noisy peaks which are not useful signal?
I do not need something super accurate, I just want to throw away most of the possible noise peaks.