Programmer Guide/Command Reference/EVAL/ifft: 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}}}}
Compute the discrete fourier transform of a real signal using the '''fft''' or the '''dft''' algorithm.
Compute the inverse discrete fourier transform of a (conj. sym.) complex spectrum using the inverse '''fft''' or '''dft''' algorithm.
----
----
;Usage 1:<code>fft(<var>n</var>)</code>
;Usage:<code>ifft(<var>x</var>, {, <var>xtype</var>, <var>poffset</var>, <var>prange</var>})</code>
:;<var>n</var>: desired signal window length (scalar)
:;<var>x</var>: complex spectrum vector or matrix; if ''x'' is a matrix an inverse transform is computed for each column
;Result 1:The next (nearest) possible signal window length.
:*The spectra stored in ''x'' must be the 1st half of conj. sym. spectra, because a <code>complex->real</code> version of the inverse transformation is used and the results are real numbered signals.
----
:*Each spectrum consists of <code>N=nrow(''x'')/2</code> complex values. The transformation length is set to <code>L=2*(N-1)</code>
;Usage 2:<code>fft(<var>x</var>)</code>
:*If the transformation length <code>L</code> is a power of 2 (<code>L=2^M<code>), the inverse '''fft''' algorithm is used, otherwise the inverse '''dft''' is used.
:;<var>x</var>: signal vector or matrix; if ''x'' is a matrix a spectrum of each column is computed
:;<var>xtype</var>: select the complex number format of ''x'' (default=0)
;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''[*,j]. The transformation length L is set to [[../npow2|npow2(nrow(''x''))]].
----
;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>n</var>: desired length of analysis window;
::*If <code>''n'' < nrow(''x'')</code>, 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|nrow(''x'')]], zero padding is applied to the signal.
:;<var>ytype</var>: select the type and format of the computed spectrum (default=0) -> see '''Result 3'''
:;<var>poffset</var>: offset in samples to the signal begin or the selected ''zero phase'' position (default=0)
:::{|class="keinrahmen"
:::{|class="keinrahmen"
|''poffset''='''0''' ||-> <code>phase[i] = atan2(im[i], re[i])</code>
|''xtype''='''0''' ||-> cartesian <code>{ re, im, .. }</code>
|-
|-
|otherwise ||-> <code>phase[i] = (atan2(im[i], re[i]) - 2*pi*i/L * ''poffset'') % (2 * pi)</code>
|otherwise ||-> polar <code>{ amp, phase, .. }</code>
|}
|}
:;<var>prange</var>: selects the range of phase values (default=0)
:;<var>poffset</var>: offset in samples to the signal begin or the selected ''zero phase'' position (default=0)
:If this value is not equal 0, the phase values stored in ''x'' are '''locked''' (see [[../fft|fft]]) and must be transformed to '''normal''' phase values before the inverse ft-transform is performed.
:;<var>prange</var>: selects the range of phase values stored in ''x'' (default=0)
:::{|class="keinrahmen"
:::{|class="keinrahmen"
|''prange''='''0'' ||-> <code>0 <= phase[i] < 2*pi</code>
|''prange''='''0'' ||-> <code>0 <= phase[i] < 2*pi</code>
Line 29: Line 21:
|otherwise ||-> <code>-pi <= phase[i] < pi</code>
|otherwise ||-> <code>-pi <= phase[i] < pi</code>
|}
|}
:;<var>aref</var>: reference amplitude if the log. spectrum (''ytype''=4) is requested (default=1)
:*The arguments ''poffset'' and ''prange'' are ignored if ''xtype'' equals '''0''' (''x'' in cartesian format).
;Result 3: A matrix ''y'' with [[../ncol|ncol(''x'')]] columns, where each column ''y''[*,j] contains the spectrum of the column (channel) ''x''[*,j]. The type and the length of the spectra is selected by the argument ''ytype''.
;Result 3: A matrix ''y'' with [[../ncol|ncol(''x'')]] columns, where each column ''y''[*,j] contains the result of the inverse transform (the real valued signal) of the column ''x''[*,j]. Each signal vector ''y''[*,j] consists of <code>L</code> (real) samples.
::{|class="einrahmen"
;See also: [[Programmer_Guide/Command_Reference/EVAL/fft|fft]], [[Programmer_Guide/Command_Reference/EVAL/dft|dft]], [[Programmer_Guide/Command_Reference/EVAL/dct|dct]], [[Programmer_Guide/Command_Reference/EVAL/cepstrum|cepstrum]], [[Programmer_Guide/Command_Reference/EVAL/lpc|lpc]], [[Programmer_Guide/Command_Reference/EVAL/complex arithmetic|complex arithmetic]]
!''ytype'' !! description !! content of ''y''[*,j] !! nrow(''y'')
|-
|'''0'''
|complex spectrum in cartesian format
|<code>{ re<sub>0</sub>, im<sub>0</sub>, re<sub>1</sub>, im<sub>1</sub>, ... }</code>
|L+2
|-
|'''1'''
|complex spectrum in polar format
|<code>{ amp<sub>0</sub>, phase<sub>0</sub>, amp<sub>1</sub>, phase<sub>1</sub>, ... }<BR>with: amp<sub>i</sub>=sqrt(re<sub>i</sub><sup>2</sup> + im<sub>i</sub><sup>2</sup>),<BR>phase<sub>i</sub> see ''poffset''</code>
|L+2
|-
|'''2'''
|amplitude spectrum
|<code>{ amp<sub>0</sub>, amp<sub>1</sub>, ... }</code>
|L+1
|-
|'''3'''
|power spectrum
|<code>{ amp<sub>0</sub><sup>2</sup>, amp<sub>1</sub><sup>2</sup>, ... }</code>
| L+1
|-
|'''4'''
|logarithmic amplitude spectrum
|<code>{ lev<sub>0</sub>, lev<sub>1</sub>, ... }<BR>with: lev<sub>i</sub>=20*log<sub>10</sub>(amp<sub>i</sub>/''aref'')</code>
| L+1
|}
----
;See also: [[Programmer_Guide/Command_Reference/EVAL/ifft|ifft]], [[Programmer_Guide/Command_Reference/EVAL/dft|dft]], [[Programmer_Guide/Command_Reference/EVAL/dct|dct]], [[Programmer_Guide/Command_Reference/EVAL/cepstrum|cepstrum]], [[Programmer_Guide/Command_Reference/EVAL/lpc|lpc]], [[Programmer_Guide/Command_Reference/EVAL/complex arithmetic|complex arithmetic]]


[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
// ifft( Y , YFORMAT=0 , POFFSET=0 , PRANGE=0 )
// function:
// Y vector or matrix, each row contains a complex spectrum
// YFORMAT input format
// YFORMAT=0 -> complex (re0 im0 re1 im1 ..)
// YFORMAT=1 -> complex polar (amp0 phase0 amp1 phase1 ..)
// POFFSET phase locking offset (sample offset to the signal begin or to the selected "zero phase position")
// PRANGE phase range
// PRANGE=0 -> phase values are in the range 0..2*pi
// PRANGE=1 -> phase values are in the range -pi..pi
// result:
// vector or matrix X containing one real timesignal
// ncol(X) = ncol(Y)
// nrow(X) = nrow(Y)-2

Revision as of 13:28, 12 April 2011

Compute the inverse discrete fourier transform of a (conj. sym.) complex spectrum using the inverse fft or dft algorithm.


Usage
ifft(x, {, xtype, poffset, prange})
x
complex spectrum vector or matrix; if x is a matrix an inverse transform is computed for each column
  • The spectra stored in x must be the 1st half of conj. sym. spectra, because a complex->real version of the inverse transformation is used and the results are real numbered signals.
  • Each spectrum consists of N=nrow(x)/2 complex values. The transformation length is set to L=2*(N-1)
  • If the transformation length L is a power of 2 (L=2^M), the inverse fft algorithm is used, otherwise the inverse dft is used.
xtype
select the complex number format of x (default=0)
xtype=0 -> cartesian { re, im, .. }
otherwise -> polar { amp, phase, .. }
poffset
offset in samples to the signal begin or the selected zero phase position (default=0)
If this value is not equal 0, the phase values stored in x are locked (see fft) and must be transformed to normal phase values before the inverse ft-transform is performed.
prange
selects the range of phase values stored in x (default=0)
prange='0 -> 0 <= phase[i] < 2*pi
otherwise -> -pi <= phase[i] < pi
  • The arguments poffset and prange are ignored if xtype equals 0 (x in cartesian format).
Result 3
A matrix y with ncol(x) columns, where each column y[*,j] contains the result of the inverse transform (the real valued signal) of the column x[*,j]. Each signal vector y[*,j] consists of L (real) samples.
See also
fft, dft, dct, cepstrum, lpc, complex arithmetic

<function list>

Navigation menu

Personal tools