Gaussian filter problem
Gaussian filter problem
(OP)
Hi
i am trying to filter a data set in matrix format using gaussian filter.i take the fourier transform of the data and then multiply with gaussian filter and take the inverse fourier transform of that. Now here is the function i have written(matlab) for gaussian filter design but seems to be not exactly producing correct result. could anyone check the problem in the function below plz.
function g = gauss_des(x,pos,wid)
g = 1/(wid*sqrt(2*pi)) * exp(-.5*((x-pos)/wid).^2)
where pos = centre
width = width of filter
x = digital frequency range of the filter ; for example i have used x =0:.001:.5
Thanks in advance





RE: Gaussian filter problem
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Gaussian filter problem
RE: Gaussian filter problem
Anyway, for the only example I tried there is no difference>10^-15 between your code and the results from normpdf, and the maths looks right.
So, what is the actual problem?
Cheers
Greg Locock
SIG:Please see FAQ731-376: Eng-Tips.com Forum Policies for tips on how to make the best use of Eng-Tips.
RE: Gaussian filter problem