Matlab - 信号噪声消除
我有一个数据向量,其中包含 -20 20 范围内的整数。
下面是一个包含值的图:
这是矢量数据中 96 个元素的示例。从上图可以看出,大多数元素位于 -2, 2 区间内。
我想消除数据中的噪音。我想消除低振幅峰值,并保留高振幅峰值,即像索引 74 处的峰值。
基本上,我只是想增加高振幅峰值和低振幅峰值之间的对比度,如果它是可以消除低振幅峰值。
你能建议我一种方法吗?
我尝试过mapstd函数,但问题是它也标准化了高振幅峰值。
我正在考虑使用小波变换工具箱,但我不知道如何从小波分解系数重建数据。
你能给我推荐一种方法吗?
I have a vector of data, which contains integers in the range -20 20.
Bellow is a plot with the values:
This is a sample of 96 elements from the vector data. The majority of the elements are situated in the interval -2, 2, as can be seen from the above plot.
I want to eliminate the noise from the data. I want to eliminate the low amplitude peaks, and keep the high amplitude peak, namely, peaks like the one at index 74.
Basically, I just want to increase the contrast between the high amplitude peaks and low amplitude peaks, and if it would be possible to eliminate the low amplitude peaks.
Could you please suggest me a way of doing this?
I have tried mapstd
function, but the problem is that it also normalizes that high amplitude peak.
I was thinking at using the wavelet transform toolbox, but I don't know exact how to reconstruct the data from the wavelet decomposition coefficients.
Can you recommend me a way of doing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
检测异常值的一种方法是使用三标准差规则。一个例子:
编辑:
看来我误解了这里的目标。如果你想做相反的事情,也许是这样的:
One approach to detect outliers is to use the three standard deviation rule. An example:
EDIT:
It seems I misunderstood the goal here. If you want to do the opposite, maybe something like this instead:
如果它仅用于演示目的,并且您实际上不会将这些缩放值用于任何用途,我有时喜欢通过以下方式增加对比度:
编辑:因为我们要发布图像,所以这是我的(之前/之后) :
If it's for demonstrative purposes only, and you're not actually going to be using these scaled values for anything, I sometimes like to increase contrast in the following way:
edit: since we're posting images, here's mine (before/after):
您可以尝试分割窗口过滤器。如果 x 是您当前的样本,则过滤器将类似于:
对于每个样本 x,您对左侧 (L) 的周围样本带和右侧的周围样本带进行平均。如果您的样本呈阳性和阴性(就像您的一样),您应该获取腹肌。价值第一。然后将样本 x 除以这些周围样本的平均值。
每次执行此操作时,峰值都会增强,噪声会变平。您可以执行多次以增加效果。它对这些带宽度的选择有些敏感,但可以工作。例如:
两遍:
You might try a split window filter. If x is your current sample, the filter would look something like:
For each sample x, you average a band of surrounding samples on the left (L) and a band of surrounding samples on the right. If your samples are positive and negative (as yours are) you should take the abs. value first. You then divide the sample x by the average value of these surrounding samples.
Each time you do this the peaks are accentuated and the noise is flattened. You can do more than one pass to increase the effect. It is somewhat sensitive to the selection of the widths of these bands, but can work. For example:
Two passes:
您实际需要的是某种压缩来缩放数据,即:-2 到 2 之间的值按某个因子缩放,其他所有值按另一个因子缩放。完成这样的事情的一种粗略方法是将所有小值设置为零,即
请不要认为这是一个非常非线性的操作(例如,当您想要值为 2.1 和 1.9 的峰值时,它们将产生非常不同的行为:将被删除,另一个将被保留)。因此,对于显示,这可能就是您所需要的,对于进一步处理,它可能取决于您想要做什么。
What you actually need is some kind of compression to scale your data, that is: values between -2 and 2 are scale by a certain factor and everything else is scaled by another factor. A crude way to accomplish such a thing, is by putting all small values to zero, i.e.
Please do not that this is a very nonlinear operation (e.g. when you have wanted peaks valued at 2.1 and 1.9, they will produce very different behavior: one will be removed, the other will be kept). So for displaying, this might be all you need, for further processing it might depend on what you are trying to do.
为了消除低幅度峰值,您将把所有低幅度信号等同于噪声并忽略。
如果你有任何先验知识,就使用它。
如果您的信号是 a,则
其中 X 是噪声的最大预期大小。
如果您想变得更奇特,并“即时”找到这个,请使用 3 的 kmeans。它位于统计工具箱中,此处:
http://www.mathworks.com/help/toolbox/stats/kmeans.html
或者,您可以对绝对值使用 Otsu 方法数据,并使用符号返回。
请注意,这些以及我在该线程上看到的所有其他技术都假设您正在进行后期处理。如果您实时进行此处理,事情就必须改变。
To eliminate the low amplitude peaks, you're going to equate all the low amplitude signal to noise and ignore.
If you have any apriori knowledge, just use it.
if your signal is a, then
where X is the max expected size of your noise.
If you want to get fancy, and find this "on the fly" then, use kmeans of 3. It's in the statistics toolbox, here:
http://www.mathworks.com/help/toolbox/stats/kmeans.html
Alternatively, you can use Otsu's method on the absolute values of the data, and use the sign back.
Note, these and every other technique I've seen on this thread is assuming you are doing post processing. If you are doing this processing in real time, things will have to change.