Programmer Guide/Command Reference/EVAL/fft: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
Fast fourier transform.
Compute the discrete fourier transform of a real signal using the '''fft''' or the '''dft''' algorithm.
----
----
;Usage 1:<code>fft(<var>x</var>)</code>
;Usage 1:<code>fft(<var>n</var>)</code>
:;<var>n</var>: desired signal window length (scalar)
;Result 1:The next (nearest) possible signal window length.
----
;Usage 2:<code>fft(<var>x</var>)</code>
:;<var>x</var>: signal vector or matrix; if ''x'' is a matrix a spectrum of each column is computed
:;<var>x</var>: signal vector or matrix; if ''x'' is a matrix a spectrum of each column is computed
;Result:A matrix ''y'' with [[../ncol|ncol(''x'')]] columns and L+2 rows, where each column ''y''[*,j] contains the complex spectrum of the column (channel) ''x''[*,i]. The transformation length L is set to [[../npow2|npow2(nrow(''x''))]].
;Result 2:A matrix ''y'' with [[../ncol|ncol(''x'')]] columns and L+2 rows, where each column ''y''[*,j] contains the complex spectrum of the column (channel) ''x''[*,i]. The transformation length L is set to [[../npow2|npow2(nrow(''x''))]].
----
----
;Usage 2:<code>fft(<var>x</var>, <var>n</var> {, <var>ytype</var>, <var>poffset</var>, <var>prange</var>, <var>aref</var>})</code>
;Usage 3:<code>fft(<var>x</var>, <var>n</var> {, <var>ytype</var>, <var>poffset</var>, <var>prange</var>, <var>aref</var>})</code>
:;<var>x</var>: signal vector or matrix; if ''x'' is a matrix a spectrum of each column is computed
:;<var>x</var>: signal vector or matrix; if ''x'' is a matrix a spectrum of each column is computed
:;<var>n</var>: desired length of analysis window;
:;<var>n</var>: desired length of analysis window;
Line 12: Line 16:
::*If the analysis window length L is a power of 2 (L=2^M), the '''fft''' algorithm is used, otherwise the '''dft''' is used.
::*If the analysis window length L is a power of 2 (L=2^M), the '''fft''' algorithm is used, otherwise the '''dft''' is used.
::*If L is greater than [[../nrow|nrow(''x'')]], zero padding is applied to the signal.
::*If L is greater than [[../nrow|nrow(''x'')]], zero padding is applied to the signal.
:;<var>ytype</var>: signal vector or matrix; if ''x'' is a matrix a spectrum of each column is computed
:;<var>ytype</var>: select the type and format of the computed spectrum (see '''Result 3''')
:;<var>poffset</var>: offset in samples to the signal begin or the selected ''zero phase'' position (default=0)
::''poffset'' equal '''0'': <code>phase[i] = atan2(im[i], re[i])</code>
::''poffset'' not equal '''0''': <code>phase[i] = (atan2(im[i], re[i]) - 2*pi*i/L * ''poffset'') % (2 * pi)</code>





Revision as of 11:06, 12 April 2011

Compute the discrete fourier transform of a real signal using the fft or the dft algorithm.


Usage 1
fft(n)
n
desired signal window length (scalar)
Result 1
The next (nearest) possible signal window length.

Usage 2
fft(x)
x
signal vector or matrix; if x is a matrix a spectrum of each column is computed
Result 2
A matrix y with ncol(x) columns and L+2 rows, where each column y[*,j] contains the complex spectrum of the column (channel) x[*,i]. The transformation length L is set to npow2(nrow(x)).

Usage 3
fft(x, n {, ytype, poffset, prange, aref})
x
signal vector or matrix; if x is a matrix a spectrum of each column is computed
n
desired length of analysis window;
  • If n < nrow(x), the analysis window length L is set to nrow(x), otherwise L is set to n.
  • If the analysis window length L is a power of 2 (L=2^M), the fft algorithm is used, otherwise the dft is used.
  • If L is greater than nrow(x), zero padding is applied to the signal.
ytype
select the type and format of the computed spectrum (see Result 3)
poffset
offset in samples to the signal begin or the selected zero phase position (default=0)
poffset equal '0: phase[i] = atan2(im[i], re[i])
poffset not equal 0: phase[i] = (atan2(im[i], re[i]) - 2*pi*i/L * poffset) % (2 * pi)


See also
ifft, dft, dct, cepstrum, lpc, , complex arithmetic

<function list>

Navigation menu

Personal tools