Filter for audio signal processing?
I would like to ask what is a good filter for audio signal processing, particularly note onset processing?
Particularly, what I need is a filter that makes peaks sharper while smoothing out others, something like in the image below:
I am not sure if what I need are low/high-pass filters becaus开发者_StackOverflow中文版e I know that those filters work in the frequency domain, and I particularly want to work with the time-domain. I am only working on monophonic signals, recorded in .WAV 44.1Khz 16-bit mono format.
Thanks!
I would suggest a non-linear approach - effectively you want to do envelope detection with a short time constant.
y_1 = 0; // init y_1 = previous value of output signal, y
loop
y = abs(x); // rectify input signal
y = k * y + (1.0 - k) * y_1; // apply single pole recursive low pass filter
y_1 = y; // save output value for next iteration
end
Choosing k
(NB: 0.0 < k < 1.0
) is the tricky part and may require some experimentation. If k
is too small then you will have a large time constant and this may result in too much lag in your onset detection. If k is too large then the time constant may be too small and you may get false positives. (In the latter case though you may be able to improve results by rejecting onsets that fall within a given minimum tine window from the previous "real" onset (e.g. 10 ms).) Start with, say, k = 0.1 and then perhaps try reducing it until the lag becomes unacceptable.
Instead of a filter for your desired audio processing, you might want to try some form of AGC (automatic gain control) to normalize the signal's envelope amplitude, with a time constant somewhere in the neighborhood of 1 beat time.
But accurate note onset detection may require more advanced signal processing and pattern matching techniques. There seem to be more than a few research papers on the topic.
精彩评论