Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.1 - English

Change language to:
Français - 日本語 - Português - Русский

Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab Help >> Signal Processing > fft2

fft2

two-dimension fast Fourier transform

Calling Sequence

y=fft2(x)
y=fft2(x,n,m)

Arguments

x

a vector/matrix/array (Real or Complex)

y

a vector/matrix/array (Real or Complex)

m

integer, number of rows.

n

integer, number of columns.

Description

This functions performs the two-dimension discrete Fourier transform.

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 formula
a=[1 2 3 ;4 5 6 ;7 8 9 ;10 11 12]  
m=size(a,1)
n=size(a,2)

// fourier transform along the rows
for i=1:n
a1(:,i)=exp(-2*%i*%pi*(0:m-1)'.*.(0:m-1)/m)*a(:,i) 
end

// fourier transform along the columns
for j=1:m
a2temp=exp(-2*%i*%pi*(0:n-1)'.*.(0:n-1)/n)*(a1(j,:)).' 
a2(j,:)=a2temp.'
end
norm(a2-fft2(a))

See Also

  • fft — fast Fourier transform.
Report an issue
<< detrend Signal Processing fftshift >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Oct 02 13:46:50 CEST 2014