Point Spread Function translate to MTF

조회 수: 10 (최근 30일)
chiang che wen
chiang che wen 2016년 3월 22일
답변: Craig Draper 2020년 4월 9일
I have point spread function (PSF) containing x and y data. x=[-25.132,-18.849,-12.566,-6.283,-3,0,3,6.283,12.566,18.849,25.132] y=[0.21446,0.21446,0.21446,0.21446,44,44.15754,44,0.21446,0.21446,0.21446,0.21446] This is point spread function (PSF). From this PSF I would like to calculate the Modulation Transfer Function MTF. I write the matlab code : x=[-25.132,-18.849,-12.566,-6.283,-3,0,3,6.283,12.566,18.849,25.132] y=[0.21446,0.21446,0.21446,0.21446,44,44.15754,44,0.21446,0.21446,0.21446,0.21446] PSF=[x,y] OTF = psf2otf(PSF) plot(OTF) How could I modified correct this code?Any Help is higly welcome. Thank you very much in advance.
cheers
Che-Wen

답변 (1개)

Craig Draper
Craig Draper 2020년 4월 9일
x=[-25.132,-18.849,-12.566,-6.283,-3,0,3,6.283,12.566,18.849,25.132];
y=[0.21446,0.21446,0.21446,0.21446,44,44.15754,44,0.21446,0.21446,0.21446,0.21446];
LSF = [x,y] % This is more like a line spread function
OTF = fftshift(fft(LSF)); % OTF
MTF = abs(OTF); % absolute value of OTF
MTF = MTF./max(MTF); % normalize
% correct sampling frequency for conversion on frequency bins to frequency
Size = length(MTF);
spacing = 3;% spacing between data points
fsx = abs(1/spacing); % turn into sampling frequency
a = linspace(-Size/2,Size/2,Size); % form scale for conversion based on frequency bins
conversionx = fsx./Size; % conversion factor for frequency bin units to frequency (unit^-1)
Psi = a.*conversionx; % frequency (unit^-1)
plot(Psi,MTF)
xlim([0,Psi(end)])
xlabel('cycles/unit')
ylabel('MTF')

카테고리

Help CenterFile Exchange에서 Cell Arrays에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by