[英]Creating a 1D Second derivative of gaussian Window
In MATLAB I need to generate a second derivative of a gaussian window to apply to a vector representing the height of a curve. 在MATLAB中,我需要生成高斯窗口的二阶导数以应用于代表曲线高度的向量。 I need the second derivative in order to determine the locations of the inflection points and maxima along the curve.
我需要二阶导数以确定沿曲线的拐点和最大值的位置。 The vector representing the curve may be quite noise hence the use of the gaussian window.
代表曲线的向量可能是相当大的噪声,因此使用了高斯窗口。 What is the best way to generate this window?
生成此窗口的最佳方法是什么? Is it best to use the gausswin function to generate the gaussian window then take the second derivative of that?
最好使用gausswin函数生成高斯窗口,然后取其二阶导数吗? Or to generate the window manually using the equation for the second derivative of the gaussian?
还是使用高斯二阶导数的公式手动生成窗口? Or even is it best to apply the gaussian window to the data, then take the second derivative of it all?
甚至最好是将高斯窗口应用于数据,然后取所有数据的二阶导数? (I know these last two are mathematically the same, however with the discrete data points I do not know which will be more accurate)
(我知道这最后两个在数学上是相同的,但是对于离散数据点,我不知道哪个会更准确)
The maximum length of the height vector is going to be around 100-200 elements. 高度向量的最大长度将约为100-200个元素。
Thanks Chris 谢谢克里斯
I would create a linear filter composed of the weights generated by the second derivative of a Gaussian function and convolve this with your vector. 我将创建一个由高斯函数的二阶导数生成的权重组成的线性滤波器,并将其与向量进行卷积。
The weights of a second derivative of a Gaussian are given by: 高斯二阶导数的权重由下式给出:
Where: 哪里:
In terms of your comment on the equivalence of smoothing first and taking a derivative later, I would say it is more involved than that. 关于您对先平滑然后再取导数的等效性的评论,我想说的要比这更复杂。 As which derivative operator would you use in the second step?
作为第二步中将使用哪个导数运算符? A simple central difference would not yield the same results.
一个简单的中心差异将不会产生相同的结果。
You can get an equivalent (but approximate) response to a second derivative of a Gaussian by filtering the data with two Gaussians of different scales and then taking the point-wise differences between the two resulting vectors. 通过使用两个不同比例的高斯滤波数据,然后取两个结果向量之间的逐点差异,您可以获得对高斯二阶导数的等效(但近似)响应。 See Difference of Gaussians for that approach.
有关该方法,请参见高斯差异 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.