平均的影响
使用移动平均滤波器将消除信号中的不规则性。噪声变为 E/N,其中 N 是移动平均滤波器的长度。使用 MA 的副作用是信号峰值变得更宽和更浅。
此外,信号的频率成分也会发生变化。时域中的移动平均滤波器与通过 sinc 函数对频域信号进行卷积是一样的,一切都被弄脏了。
峰值检测算法
峰值检测是 9/10 工程问题中的常见问题。(不是真的,但 TON 取决于他们)
通常这是这样做的:
中值阈值
1) Look for all peaks in your signal. (i.e., a point that is larger than the two
adjacent points
2) take this list of points and for each one of them compute:
med_threshold = median(Peak,Width) + constantThresholmedian where median is the
median value of the data centered at "Peak" with Width being the number of
points to look at.
a) The Width(usually written as Lambda in literature) and constantThreshold
(usually written as C) are determined by trial and error and using the ROC
curve (Acronym below)
3) if the peak's magnitude is above this threshold accept it as a true peak.
Else: Discard it, its a false peak
4) Generate a Receiver Operating Characteristic Curve(ROC) to how well the algorithm
is performing.
这是一个例子:
suppose we have the signal X = [ 0 0 0 0 1 3 **9** 2 1 1 **2** 1 1 ]
1) 9 and 2 are both potential peaks
2) Lets use a window of 5 and a threshold =2
so at 9 we have [1 3 9 1 2] -> [1 1 2 3 9] so Median(9,5) = 2
9 > 2 +2, therefor its a peak
Lets take a look at 2: [ 1 1 2 1 1] -> [1 1 1 1 2 ] Median(2,5) = 1
2 < 1+2, therefor it is NOT a peak.
确定频率
既然您已经有效地找到了峰值的时间定位,请尝试找到它们的频率:
1) Use the locations of the peaks to generate a pulse train
a) this means create sum(Dirac_delta[t-L(n)]) where L(n) is the nth time that
you've localized through median thresholding
2) Apply FFT Algorithm
3) Look for largest peak.
交替频率估计
1) Think of this like a beat in a piece of music (I learned about thresholding by
researching Onset Detection.
2) Compute the average time distance between detected peaks.
3) now call your results BPM or PPM (pulses per minute)
其他研究途径
虽然您可能对峰值信号感到满意,但有些算法适用于完全不同的问题,称为起始检测。
起始检测是音乐信息检索研究中的一个重要领域。它用于确定何时播放音符。
如果您将磁带磁头信号视为高度采样的信号,您可以应用本文中可以找到的许多算法:
http://www.elec.qmul.ac.uk/people/juan/Documents/Bello-TSAP-2005.pdf