what is the FFT logic in calculating far field defraction matlab implemetation

6 ビュー (過去 30 日間)
fima v
fima v 2021 年 4 月 15 日
Hello,there is an expression shown bellow that we need to plot in 2D grid plot as shown bellow. X and Y are 2D matrices going from -0.5 to 0.5 the Code bellow uses an FFT function FFT takes as input the func_in struct variable which has two subvariables:\ 1.the matrices which is the formula output data 2.scale variable and some n variable.
Then FFT function does some FFT2 which is described as Y = fft2(X) returns the two-dimensional Fourier transform of a matrix using a fast Fourier transform algorithm
then they do Y = fftshift(X) rearranges a Fourier transform X by shifting the zero-frequency component to the center of the array.
Then they use the sc with linspace of interval long vector.
What is the logic in the FFT matlab code?
Main function that uses FFT function:
scale = linspace(-L/2,L/2,n);
[X , Y]= meshgrid(scale, scale);
figure (1)
colormap gray
image(scale, scale, rect, 'CDataMapping','scaled');
FFT function:
function [ func_out ] = FFT( func_in,n )
func_out.sc=linspace(-interval/2,interval/2,n);% FFT creates a new scale for the output. the scale is the ratio of one over the interval of the formaer scale.

回答 (0 件)


Find more on Fourier Analysis and Filtering in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by