Calling Sequence

Arguments

Description

Thisfunctionsperformsthetwo-dimensiondiscreteFouriertransform.

y=fft2(x)y and x have the same size

y=fft2(x,m,n): If m (respectively
n) is less than the rows number (respectively columns) of
x then the x rows number (resp. columns) is
truncated, else if m (resp. n) is more than the rows number
(resp. columns) of x then x rows are completed
by zero (resp. columns) .

if x is a matrix then y is a matrix, if
x is a hypermatrix then y is a hypermatrix, with
the size of the first dimension of y is equal to
m, the size of the second dimension of y is
equal to n, the size of the ith dimension of y
(for i>2, case hypermatrix) equal to the size of the ith dimension of
x. (i.e size(y,1)=m, size(y,2)=n and size(y,i)=size(x,i) for
i>2)

Examples

//Comparison with explicit formulaa=[123;456;789;101112]m=size(a,1)n=size(a,2)// fourier transform along the rowsfori=1:na1(:,i)=exp(-2*%i*%pi*(0:m-1)'.*.(0:m-1)/m)*a(:,i)end// fourier transform along the columnsforj=1:ma2temp=exp(-2*%i*%pi*(0:n-1)'.*.(0:n-1)/n)*(a1(j,:)).'a2(j,:)=a2temp.'endnorm(a2-fft2(a))