简体   繁体   English

如何在MATLAB中计算高斯曲线的调制传递函数?

[英]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.我正在尝试使用 MATLAB 找到高斯拟合曲线的调制传递函数。 The gaussian curve is as below:高斯曲线如下: 高斯曲线

x- axis is distance(form -15mm to 15mm ) and y axis is count(Magnitude). x 轴是距离(从-15mm to 15mm ),y 轴是计数(幅度)。 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

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:我在上面的代码中使用了 32 来获取图形的主要部分,我得到了 MTF 图,如下所示: 机动特遣队

I am confused about X-axis.我对X轴感到困惑。 What will be the range of X-axis in lines per mm ? X 轴的lines per mm范围是多少? Can anyone help me give an idea to calculate X-axis of MTF plot?谁能帮我提供一个计算 MTF 图的 X 轴的想法?

Thanks in Advance!提前致谢! Manu摩奴

The matlab manual is very specific about the calculation. matlab手册对计算非常具体。 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.如果这个数字是 N,要在 (1/mm) 中转换 fft x 轴,你应该除以 N。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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