1
votes

given a convolution kernel computed from sigma using the function fspecial('gaussian',,) how can I plot the frequency response in Matlab?

I would like to do this on a gaussian function, and importantly would like to derive the 1D frequency response (coz I understand them better) of the horizontal convolution kernel with size N.

Thanks for the help!!!

1
The frequency response of a Gaussian function is also a Gaussian. You can compute it analytically and then plot itLuis Mendo
Hi thanks for the reply. Sorry I don't follow you completely. So the continuous and discrete domain should be bell shaped. But how do I analyze the kernel. Is there a way of extracting sigma or computing a 1d fft on an orthogonal kernellukemtesta
I think a key bit of information I missed years ago was computing the kernel with an offset relative to the kernel center (0,0). From there the job was easy :)lukemtesta

1 Answers

1
votes
kernel2 = fspecial('gaussian', [1 5], 1.3)
spike = [1 0 0 0 0];
[h, w] = freqz(kernel2, spike, 1024);
m = abs(h)
p = angle(h);
plot(w,m);

hat tip to https://courseware.ee.calpoly.edu/~fdepiero/curr/dsp/dsp11.htm