Convolution with Gaussian filter with fixed resolution for non-uniform data?

6 次查看(过去 30 天)
I have non unifrom data (x,y) (attached, simplified). I need to use gaussin filter of fixed window size with fixed resolution. Finally I have to use convolution of gaussian filtered data with y.
I know how to do for whole data without bothering about resolution,as follows. It works fine.
sigma = std(x);
gaussFilter =gausswin(3*sigma+1)';
a=gaussFilter/sum(gaussFilter);
abx=conv(y,a,'same');
But resolution is very important for my case. When I consider the resolution, I am blanck. I tried like one below (with resolution 0.5) but failed.
sigma = std(x); %fixed window size
xn=zeros(1,ceil(max(x)));
for k=1:0.5:size(xn,2) %gives resolution
gaussFilter(k)=gausswin(3*sigma+1)';
xa(k)=gaussFilter(k)/sum(gaussFilter(k));%normalization
end
abx=conv(y,xa,'same');
It means I use Gaussian filter of fixed window size at all x=1:0.5:end. Another question is that, Can Gausswin be used for non-uniform data?
Thank you so much.

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Preprocessing 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by