简体   繁体   中英

How to calculate modulation transfer function of a gaussian curve in MATLAB?

I am trying to find modulation transfer function of a gaussian fitted curve by using MATLAB. The gaussian curve is as below: 高斯曲线

x- axis is distance(form -15mm to 15mm ) and y axis is count(Magnitude). I used the following code to find find fourier transfrom of gaussian curve

  FFT_y = fft(y); %take fourier transform
  FF_mag = abs(FFT_y )/(length(FFT_y )); %find magnitude
  FF_mag = (FF_mag-min(FF_mag))./(max(FF_mag)-min(FF_mag)); %normalize magnitude

I cropped FF_mag by using the following codes

FF_mag_nw = FF_mag(1:(length(FF_y)/32));
plot(FF_mag_nw);

I used 32 in above code to get main portion of graph and I got MTF plot as below: 机动特遣队

I am confused about X-axis. What will be the range of X-axis in lines per mm ? Can anyone help me give an idea to calculate X-axis of MTF plot?

Thanks in Advance! Manu

The matlab manual is very specific about the calculation. For example, check this out

dx = 0.1
x = -15:dx:15;      
Fs = 1/dx;          % Sampling frequency
L = length(x);      % Signal length
sigma = 5;
amp   = 437500;
y     = amp/sqrt(2*pi*sigma^2) * exp(-x^2/(2*sigma^2));

n = 2^nextpow2(L);
Y = fft(y,n);
f = Fs*(0:(n/2))/n;
P = abs(Y/n);
plot(f,P(1:n/2+1)) 
title('Gaussian Pulse in Frequency Domain')
xlabel('Frequency f [in units of 1/dx]')
ylabel('|P(f)|')

How many points did you use for the real space gaussian. If this number is N, to transform the fft x axis in (1/mm) you should divide by N.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM