Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gaussian filter problem

Status
Not open for further replies.

barbosa11

Computer
Jul 18, 2009
2

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
 
Replies continue below

Recommended for you

Wild and crazy idea - why are you filtering in the frequency domain?


Cheers

Greg Locock

SIG:please see FAQ731-376 for tips on how to make the best use of Eng-Tips.
 
It just doesn't seem very useful, there are lots of ways of smearing the frequency domain that have well known effects in the time domain, whereas the ifft of a normal distribution curve could be ugly.

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 for tips on how to make the best use of Eng-Tips.
 
Wouldn't you need a 2 dimensional transform for a matrix?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor