fftfreq
Return the Discrete Fourier Transform sample frequencies. The returned array contains the frequency bin centers in cycles per unit of the sample spacing.| Name | Type | Default | Description |
|---|---|---|---|
n | number | — | Window length (number of samples). |
d | number | 1.0 | Sample spacing (inverse of the sampling rate). |
NDArray — Float64 array of length n containing the sample frequencies. For even n, the layout is [0, 1, ..., n/2-1, -n/2, ..., -1] / (d*n). For odd n, it is [0, 1, ..., (n-1)/2, -(n-1)/2, ..., -1] / (d*n).
rfftfreq
Return the Discrete Fourier Transform sample frequencies for use withrfft. Since rfft returns only the positive half of the spectrum, this function returns frequencies for bins 0, 1, ..., n//2.
| Name | Type | Default | Description |
|---|---|---|---|
n | number | — | Window length (number of samples in the original signal, not the rfft output). |
d | number | 1.0 | Sample spacing. |
NDArray — Float64 array of length n//2 + 1 containing the non-negative sample frequencies.
fftshift
Shift the zero-frequency component to the center of the spectrum. This is useful for visualizing the Fourier transform with the DC component in the middle.| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array. |
axes | number | number[] | all axes | Axes over which to shift. |
NDArray — The shifted array.
ifftshift
Inverse offftshift. Undoes the centering performed by fftshift, moving the zero-frequency component back to the beginning.
| Name | Type | Default | Description |
|---|---|---|---|
a | ArrayLike | — | Input array. |
axes | number | number[] | all axes | Axes over which to shift. |
NDArray — The unshifted array.