# fft2

Two Dimensional Fast Fourier Transform.

f = fft2(x)

f = fft2(x,m,n)

## Inputs

x
The signal to be transformed into the frequency domain.
Type: double
Dimension: vector | matrix
m
The number of columns in the fft.
Type: integer
Dimension: scalar
n
The number of rows in the fft.
Type: integer
Dimension: scalar

## Outputs

f
The frequency domain representation of x.

## Example

Magnitude plot of fft2 for a signal with two frequency components in each direction.

f1x = 25;              % first x frequency component
f2x = 40;              % second x frequency component
fsx = 100;             % sampling frequency in x
tsx = 1/fsx;           % sampling time interval in x
n = 20;	         % number of x samples
tx = [0:1:(n-1)]*tsx;  % x time vector
signalx = 20*sin(2*pi*f1x*tx) + 8*sin(2*pi*f2x*tx);
fqx = freq(n,fsx);     % x frequency vector
f1y = 60;              % first y frequency component
f2y = 80;              % second y frequency component
fsy = 200;             % sampling frequency in y
tsy = 1/fsx;           % sampling time interval in y
m = 10;	         % number of y samples
ty = [0:1:(m-1)]*tsy;  % y time vector
signaly = 12*sin(2*pi*f1y*ty) + 16*sin(2*pi*f2y*ty);
contour3(fqx, fqy, abs(ft));