n-point spectrum, rfft returns only the first n//2 + 1 unique complex coefficients, cutting storage roughly in half.
rfft
Compute the 1-D FFT of a real-valued array.| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Real-valued input array. |
n | number | a.shape[axis] | Number of points in the transform. |
axis | number | -1 | Axis along which to compute the FFT. |
norm | 'backward' | 'ortho' | 'forward' | 'backward' | Normalization mode. |
NDArray — Complex128 array of length n//2 + 1 along the transformed axis.
irfft
Compute the inverse ofrfft. Reconstructs the full real-valued signal from its positive-frequency spectrum.
| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array from rfft (complex, length n//2 + 1). |
n | number | (a.shape[axis] - 1) * 2 | Length of the output along the transformed axis. |
axis | number | -1 | Axis along which to compute the inverse FFT. |
norm | 'backward' | 'ortho' | 'forward' | 'backward' | Normalization mode. |
NDArray — Real-valued float64 array of length n.
rfft2
Compute the 2-D FFT of a real-valued array. Appliesfft along the first axis and rfft along the last axis, so the last axis is truncated to n//2 + 1.
| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Real-valued input array (at least 2-D). |
s | [number, number] | shape of a along axes | Shape of the output along the transform axes. |
axes | [number, number] | [-2, -1] | Axes over which to compute the 2-D FFT. |
norm | 'backward' | 'ortho' | 'forward' | 'backward' | Normalization mode. |
NDArray — Complex128 array. The last transform axis has length s[1]//2 + 1.
irfft2
Compute the inverse ofrfft2.
| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array (complex, from rfft2). |
s | [number, number] | inferred | Shape of the real-valued output along the transform axes. |
axes | [number, number] | [-2, -1] | Axes over which to compute the inverse FFT. |
norm | 'backward' | 'ortho' | 'forward' | 'backward' | Normalization mode. |
NDArray — Real-valued float64 array.
rfftn
Compute the N-dimensional FFT of a real-valued array. Appliesfft along all axes except the last, then rfft along the last axis.
| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Real-valued input array. |
s | number[] | shape of a along axes | Shape of the output along the transform axes. |
axes | number[] | all axes | Axes over which to compute the FFT. |
norm | 'backward' | 'ortho' | 'forward' | 'backward' | Normalization mode. |
NDArray — Complex128 array. The last transform axis has length s[-1]//2 + 1.
irfftn
Compute the inverse ofrfftn.
| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array (complex, from rfftn). |
s | number[] | inferred | Shape of the real-valued output along the transform axes. |
axes | number[] | all axes | Axes over which to compute the inverse FFT. |
norm | 'backward' | 'ortho' | 'forward' | 'backward' | Normalization mode. |
NDArray — Real-valued float64 array.
hfft
Compute the FFT of a signal with Hermitian symmetry (i.e., the spectrum is real-valued). This is the inverse ofihfft.
| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array with Hermitian symmetry. |
n | number | (a.shape[axis] - 1) * 2 | Length of the output. |
axis | number | -1 | Axis along which to compute. |
norm | 'backward' | 'ortho' | 'forward' | 'backward' | Normalization mode. |
NDArray — Real-valued float64 array of length n.
ihfft
Compute the inverse ofhfft. Takes a real-valued signal and returns the Hermitian-symmetric spectrum.
| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Real-valued input array. |
n | number | a.shape[axis] | Length of the input to use. |
axis | number | -1 | Axis along which to compute. |
norm | 'backward' | 'ortho' | 'forward' | 'backward' | Normalization mode. |
NDArray — Complex128 array of length n//2 + 1.