Skip to content

Commit 0efc3a3

Browse files
committed
Add review changes
1 parent 7e720c8 commit 0efc3a3

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

spec/extensions/fourier_transform_functions.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ A conforming implementation of the array API standard must provide and support t
1717
(function-fft)=
1818
### fft(a, /, *, n=None, axis=-1, norm='backward')
1919

20-
Computes the one-dimensional discrete Fourier transform. The expected behavior includes a round-trip transform using the inverse function, `fft(ifft(a)) == a`.
20+
Computes the one-dimensional discrete Fourier transform. The expected behavior includes a round-trip transform using the inverse function, `ifft(fft(a)) == a` within numerical accuracy.
2121

2222
#### Parameters
2323

@@ -47,7 +47,7 @@ Computes the one-dimensional discrete Fourier transform. The expected behavior i
4747

4848
- **out**: _<array>_
4949

50-
- An array transformed along the axis indicated by the `axis` keyword.
50+
- A complex-valued array transformed along the axis indicated by the `axis` keyword. The length along the transformed axis is `n//2+1`.
5151

5252
#### Raises
5353

@@ -56,7 +56,7 @@ Computes the one-dimensional discrete Fourier transform. The expected behavior i
5656
(function-ifft)=
5757
### ifft(a, /, *, n=None, axis=-1, norm='backward')
5858

59-
Computes the one-dimensional inverse discrete Fourier transform.
59+
Computes the one-dimensional inverse discrete Fourier transform. The expected behavior includes a round-trip transform using the inverse function, `ifft(fft(a)) == a` within numerical accuracy.
6060

6161
#### Parameters
6262

@@ -86,7 +86,7 @@ Computes the one-dimensional inverse discrete Fourier transform.
8686

8787
- **out**: _<array>_
8888

89-
- An array transformed along the axis indicated by the `axis` keyword.
89+
- A complex-valued array transformed along the axis indicated by the `axis` keyword. The length along the transformed axis is `n//2+1`.
9090

9191
#### Raises
9292

@@ -95,7 +95,7 @@ Computes the one-dimensional inverse discrete Fourier transform.
9595
(function-fftn)=
9696
### fftn(a, /, *, s=None, axes=None, norm='backward')
9797

98-
Computes the n-dimensional discrete Fourier transform.
98+
Computes the n-dimensional discrete Fourier transform. The expected behavior includes a round-trip transform using the inverse function, `ifftn(fftn(a)) == a` within numerical accuracy.
9999

100100
#### Parameters
101101

@@ -105,7 +105,7 @@ Computes the n-dimensional discrete Fourier transform.
105105

106106
- **s**: _Union\[ Sequence\[ int ], Tuple\[ int, ... ] ]_
107107

108-
- Size of each transformed axis of the output. If given, each axis will be either zero-padded or trimmed to the length `s[i]` before computing the Fourier transform. Otherwise, the length of the input along the axis given by the `axes` keyword. Default: `None`.
108+
- Size of each transformed axis of the output. If given, each axis `i` will be either zero-padded or trimmed to the length `s[i]` before computing the Fourier transform. Otherwise, the shape of the input along the axes given by the `axes` keyword. Default: `None`.
109109

110110
- **axes**: _Union\[ Sequence\[ int ], Tuple\[ int, ... ] ]_
111111

@@ -130,12 +130,12 @@ Computes the n-dimensional discrete Fourier transform.
130130
#### Raises
131131

132132
- If `s` and `axes` have different lengths.
133-
- If an element of `axes` is larger than the number of axes of `a`.
133+
- If `axes` contains any invalid axis of `a`.
134134

135135
(function-ifftn)=
136136
### ifftn(a, /, *, s=None, axes=None, norm='backward')
137137

138-
Computes the n-dimensional inverse discrete Fourier transform.
138+
Computes the n-dimensional inverse discrete Fourier transform. The expected behavior includes a round-trip transform using the inverse function, `ifftn(fftn(a)) == a` within numerical accuracy.
139139

140140
#### Parameters
141141

@@ -170,12 +170,12 @@ Computes the n-dimensional inverse discrete Fourier transform.
170170
#### Raises
171171

172172
- If `s` and `axes` have different lengths.
173-
- If an element of `axes` is larger than the number of axes of `a`.
173+
- If `axes` contains any invalid axis of `a`.
174174

175175
(function-rfft)=
176176
### rfft(a, /, *, n=None, axis=-1, norm='backward')
177177

178-
Computes the one-dimensional discrete Fourier transform for real-valued input.
178+
Computes the one-dimensional discrete Fourier transform for real-valued input. The expected behavior includes a round-trip transform using the inverse function, `irfft(rfft(a), n=a.shape[axis]) == a` within numerical accuracy.
179179

180180
#### Parameters
181181

@@ -185,7 +185,7 @@ Computes the one-dimensional discrete Fourier transform for real-valued input.
185185

186186
- **n**: _int_
187187

188-
- Length of the input array. If given, the input will be either zero-padded or trimmed to this length before computing the real Fourier transform. Otherwise, the length of the input along the axis specified by the `axis` keyword is used. Default: `None`.
188+
- Length of the transformed axis of the *input*. If given, the input will be either zero-padded or trimmed to this length before computing the real Fourier transform. Otherwise, the length of the input along the axis specified by the `axis` keyword is used. Default: `None`.
189189

190190
- **axis**: _int_
191191

@@ -205,7 +205,7 @@ Computes the one-dimensional discrete Fourier transform for real-valued input.
205205

206206
- **out**: _<array>_
207207

208-
- An array transformed along the axis indicated by the `axis` keyword.
208+
- A complex-valued array transformed along the axis indicated by the `axis` keyword. The length along the transformed axis is `n//2+1`.
209209

210210
#### Raises
211211

@@ -214,7 +214,7 @@ Computes the one-dimensional discrete Fourier transform for real-valued input.
214214
(function-irfft)=
215215
### irfft(a, /, *, n=None, axis=-1, norm='backward')
216216

217-
Computes the one-dimensional inverse discrete Fourier transform for real-valued input.
217+
Computes the one-dimensional inverse of `rfft`. The expected behavior includes a round-trip transform using the inverse function, `irfft(rfft(a), n=a.shape[axis]) == a` within numerical accuracy.
218218

219219
#### Parameters
220220

@@ -224,7 +224,7 @@ Computes the one-dimensional inverse discrete Fourier transform for real-valued
224224

225225
- **n**: _int_
226226

227-
- Length of the transformed axis of the output. If given, the input will be either zero-padded or trimmed to this length before computing the real Fourier transform. Otherwise, it will default to `2 * (m - 1)` where `m` is the length of the input along the axis given by the `axis` keyword. Default: `None`.
227+
- Length of the transformed axis of the *output*. If given, the input will be either zero-padded or trimmed to `n//2+1` before computing the inverse of `rfft`. Otherwise, it will default to `2 * (m - 1)` where `m` is the length of the input along the axis given by the `axis` keyword. Default: `None`.
228228

229229
- **axis**: _int_
230230

@@ -244,7 +244,7 @@ Computes the one-dimensional inverse discrete Fourier transform for real-valued
244244

245245
- **out**: _<array>_
246246

247-
- An array transformed along the axis indicated by the `axis` keyword.
247+
- A real-valued array transformed along the axis indicated by the `axis` keyword. The length along the transformed axis is `n` (if given) or `2 * (m - 1)`.
248248

249249
#### Raises
250250

@@ -253,7 +253,7 @@ Computes the one-dimensional inverse discrete Fourier transform for real-valued
253253
(function-rfftn)=
254254
### rfftn(a, /, *, s=None, axes=None, norm='backward')
255255

256-
Computes the n-dimensional discrete Fourier transform for real-valued input.
256+
Computes the n-dimensional discrete Fourier transform for real-valued input. The expected behavior includes a round-trip transform using the inverse function, `irfftn(rfftn(a), s=a.shape) == a` within numerical accuracy.
257257

258258
#### Parameters
259259

@@ -263,7 +263,7 @@ Computes the n-dimensional discrete Fourier transform for real-valued input.
263263

264264
- **s**: _Union\[ Sequence\[ int ], Tuple\[ int, ... ] ]_
265265

266-
- Size of each transformed axis of the output. If given, each axis will be either zero-padded or trimmed to the length `s[i]` before computing the real Fourier transform. Otherwise, no padding will be performed in each dimension. Default: `None`.
266+
- Size of each transformed axis of the output. If given, each axis `i` will be either zero-padded or trimmed to the length `s[i]` before computing the real Fourier transform. Otherwise, the shape of the input along the axes given by the `axes` keyword. The last element `s[-1]` is for computing `rfft(a[axes[-1]], n=s[-1])` whereas other elements for `fft(a[axes[i]], n=s[i])`. Default: `None`.
267267

268268
- **axes**: _Union\[ Sequence\[ int ], Tuple\[ int, ... ] ]_
269269

@@ -283,17 +283,17 @@ Computes the n-dimensional discrete Fourier transform for real-valued input.
283283

284284
- **out**: _<array>_
285285

286-
- An array transformed along the axes indicated by the `axes` keyword.
286+
- A complex-valued array transformed along the axes indicated by the `axes` keyword. The length along the last transformed axis is `s[-1]//2+1` and along other axes `s[i]`.
287287

288288
#### Raises
289289

290290
- If `s` and `axes` have different lengths.
291-
- If an element of `axes` is larger than the number of axes of `a`.
291+
- If `axes` contains any invalid axis of `a`.
292292

293293
(function-irfftn)=
294294
### irfftn(a, /, *, s=None, axes=None, norm='backward')
295295

296-
Computes the n-dimensional inverse discrete Fourier transform for real-valued input.
296+
Computes the n-dimensional inverse of `rfftn`. The expected behavior includes a round-trip transform using the inverse function, `irfftn(rfftn(a), s=a.shape) == a` within numerical accuracy.
297297

298298
#### Parameters
299299

@@ -303,7 +303,7 @@ Computes the n-dimensional inverse discrete Fourier transform for real-valued in
303303

304304
- **s**: _Union\[ Sequence\[ int ], Tuple\[ int, ... ] ]_
305305

306-
- Size of each transformed axis of the output. If given, each axis will be either zero-padded or trimmed to the length `s[i]` before computing the Fourier transform. Otherwise, no padding will be performed in each dimension. Default: `None`.
306+
- Size of each transformed axis of the *output*. If given, the last axis will be either zero-padded or trimmed to `s[-1]//2+1`, whereas all other axes `i` are either zero-padded or trimmed to the length `s[i]`, before computing the inverse of `rfftn`. Otherwise, the last axis is either zero-padded or trimmed to `2 * (m - 1)`, where `m` is the length of the input along the axis, and all other axes use the input shape. The last element `s[-1]` is for computing `irfft(a[axes[-1]], n=s[-1])` whereas other elements for `ifft(a[axes[i]], n=s[i])`. Default: `None`.
307307

308308
- **axes**: _Union\[ Sequence\[ int ], Tuple\[ int, ... ] ]_
309309

@@ -323,12 +323,12 @@ Computes the n-dimensional inverse discrete Fourier transform for real-valued in
323323

324324
- **out**: _<array>_
325325

326-
- An array transformed along the axes indicated by the `axes` keyword.
326+
- A real-valued array transformed along the axes indicated by the `axes` keyword. The length along the last transformed axis is `s[-1]` (if given) or `2 * (m - 1)`, and all other axes `s[i]`.
327327

328328
#### Raises
329329

330330
- If `s` and `axes` have different lengths.
331-
- If an element of `axes` is larger than the number of axes of `a`.
331+
- If `axes` contains any invalid axis of `a`.
332332

333333
(function-hfft)=
334334
### hfft(a, /, *, n=None, axis=-1, norm='backward')

0 commit comments

Comments
 (0)