rfft#

Purpose#

Computes a real 1- or 2-D Fast Fourier transform.

Format#

y = rfft(x)#
Parameters:

x (NxK real matrix) – data

Returns:

y (LxM matrix) – where \(L\) and \(M\) are the smallest powers of 2 greater than or equal to \(N\) and \(K\), respectively.

Remarks#

Computes the RFFT of x, scaled by \(\frac{1}{(L*M)}\).

This uses a Temperton Fast Fourier algorithm.

If \(N\) or \(K\) is not a power of 2, x will be padded out with zeros before computing the transform.

Examples#

// Create an 8-element signal
x = { 1, 2, 3, 4, 5, 6, 7, 8 };

// Compute the real FFT
y = rfft(x);

print "Real FFT of x:";
print y;

The above code produces the following output:

Real FFT of x:

   4.5000000
 -0.50000000 +        1.2071068i
 -0.50000000 +       0.50000000i
 -0.50000000 +       0.20710678i
 -0.50000000
 -0.50000000 -       0.20710678i
 -0.50000000 -       0.50000000i
 -0.50000000 -        1.2071068i

See also

Functions rffti(), fft(), ffti(), fftm(), fftmi()