MCPcopy Create free account
hub / github.com/numpy/numpy / rfft2

Function rfft2

numpy/fft/_pocketfft.py:1209–1257  ·  view source on GitHub ↗

Compute the 2-dimensional FFT of a real array. Parameters ---------- a : array Input array, taken to be real. s : sequence of ints, optional Shape of the FFT. axes : sequence of ints, optional Axes over which to compute the FFT. norm : {"backward

(a, s=None, axes=(-2, -1), norm=None)

Source from the content-addressed store, hash-verified

1207
1208@array_function_dispatch(_fftn_dispatcher)
1209def rfft2(a, s=None, axes=(-2, -1), norm=None):
1210 """
1211 Compute the 2-dimensional FFT of a real array.
1212
1213 Parameters
1214 ----------
1215 a : array
1216 Input array, taken to be real.
1217 s : sequence of ints, optional
1218 Shape of the FFT.
1219 axes : sequence of ints, optional
1220 Axes over which to compute the FFT.
1221 norm : {"backward", "ortho", "forward"}, optional
1222 .. versionadded:: 1.10.0
1223
1224 Normalization mode (see `numpy.fft`). Default is "backward".
1225 Indicates which direction of the forward/backward pair of transforms
1226 is scaled and with what normalization factor.
1227
1228 .. versionadded:: 1.20.0
1229
1230 The "backward", "forward" values were added.
1231
1232 Returns
1233 -------
1234 out : ndarray
1235 The result of the real 2-D FFT.
1236
1237 See Also
1238 --------
1239 rfftn : Compute the N-dimensional discrete Fourier Transform for real
1240 input.
1241
1242 Notes
1243 -----
1244 This is really just `rfftn` with different default behavior.
1245 For more details see `rfftn`.
1246
1247 Examples
1248 --------
1249 >>> a = np.mgrid[:5, :5][0]
1250 >>> np.fft.rfft2(a)
1251 array([[ 50. +0.j , 0. +0.j , 0. +0.j ],
1252 [-12.5+17.20477401j, 0. +0.j , 0. +0.j ],
1253 [-12.5 +4.0614962j , 0. +0.j , 0. +0.j ],
1254 [-12.5 -4.0614962j , 0. +0.j , 0. +0.j ],
1255 [-12.5-17.20477401j, 0. +0.j , 0. +0.j ]])
1256 """
1257 return rfftn(a, s, axes, norm)
1258
1259
1260@array_function_dispatch(_fftn_dispatcher)

Callers

nothing calls this directly

Calls 1

rfftnFunction · 0.85

Tested by

no test coverage detected