dft2.m

来自「matlab算法集 matlab算法集」· M 代码 · 共 26 行

M
26
字号

function Y = dft2 (X,dir)
%----------------------------------------------------------------
% Usage:       Y = dft2 (X,dir)
%
% Description: Compute the two-dimensional discrete Fourier 
%              transform (DFT) or its inverse.  When the number
%              of rows and columns of X is power of 2, use the
%              efficient fast Fourier transform (FFT) technique.
%
% Inputs:      X   = m by n complex matrix containing samples
%                    to be transformed.
%              dir = direction code.  If dir >= 0, compute
%                    the forwared DFT of X, otherwise compute 
%                    the inverse DFT of X.
%
% Outputs:     Y = m by n matrix containing transformed samples.
%----------------------------------------------------------------
   if dir >= 1
      Y = fft2 (X);
   else
      Y = ifft2 (X);
   end 
%----------------------------------------------------------------

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?