Compute the one-dimensional discrete Fourier Transform. This function computes the one-dimensional *n*-point discrete Fourier Transform (DFT) with the efficient Fast Fourier Transform (FFT) algorithm [CT]_. Parameters ---------- a : array_like Input array, can
(a, n=None, axis=-1, norm=None, out=None)
| 119 | |
| 120 | @array_function_dispatch(_fft_dispatcher) |
| 121 | def fft(a, n=None, axis=-1, norm=None, out=None): |
| 122 | """ |
| 123 | Compute the one-dimensional discrete Fourier Transform. |
| 124 | |
| 125 | This function computes the one-dimensional *n*-point discrete Fourier |
| 126 | Transform (DFT) with the efficient Fast Fourier Transform (FFT) |
| 127 | algorithm [CT]_. |
| 128 | |
| 129 | Parameters |
| 130 | ---------- |
| 131 | a : array_like |
| 132 | Input array, can be complex. |
| 133 | n : int, optional |
| 134 | Length of the transformed axis of the output. |
| 135 | If `n` is smaller than the length of the input, the input is cropped. |
| 136 | If it is larger, the input is padded with zeros. If `n` is not given, |
| 137 | the length of the input along the axis specified by `axis` is used. |
| 138 | axis : int, optional |
| 139 | Axis over which to compute the FFT. If not given, the last axis is |
| 140 | used. |
| 141 | norm : {"backward", "ortho", "forward"}, optional |
| 142 | Normalization mode (see `numpy.fft`). Default is "backward". |
| 143 | Indicates which direction of the forward/backward pair of transforms |
| 144 | is scaled and with what normalization factor. |
| 145 | |
| 146 | .. versionadded:: 1.20.0 |
| 147 | |
| 148 | The "backward", "forward" values were added. |
| 149 | out : complex ndarray, optional |
| 150 | If provided, the result will be placed in this array. It should be |
| 151 | of the appropriate shape and dtype. |
| 152 | |
| 153 | .. versionadded:: 2.0.0 |
| 154 | |
| 155 | Returns |
| 156 | ------- |
| 157 | out : complex ndarray |
| 158 | The truncated or zero-padded input, transformed along the axis |
| 159 | indicated by `axis`, or the last one if `axis` is not specified. |
| 160 | |
| 161 | Raises |
| 162 | ------ |
| 163 | IndexError |
| 164 | If `axis` is not a valid axis of `a`. |
| 165 | |
| 166 | See Also |
| 167 | -------- |
| 168 | numpy.fft : for definition of the DFT and conventions used. |
| 169 | ifft : The inverse of `fft`. |
| 170 | fft2 : The two-dimensional FFT. |
| 171 | fftn : The *n*-dimensional FFT. |
| 172 | rfftn : The *n*-dimensional FFT of real input. |
| 173 | fftfreq : Frequency bins for given FFT parameters. |
| 174 | |
| 175 | Notes |
| 176 | ----- |
| 177 | FFT (Fast Fourier Transform) refers to a way the discrete Fourier |
| 178 | Transform (DFT) can be calculated efficiently, by using symmetries in the |