API Reference
flexft
CenteredDFT
Centered ordinary DFT operator.
Computes
Source code in src/flexft/core.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | |
CenteredFRDFT
Centered fractional discrete Fourier transform operator.
This wraps FRDFT with the phases needed to evaluate
where \(c=\lfloor N/2\rfloor\).
Source code in src/flexft/core.py
185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
__call__
__call__(g)
Apply the centered fractional DFT to a vector of length N.
Source code in src/flexft/core.py
209 210 211 212 | |
FRDFT
Fractional discrete Fourier transform operator.
This class represents
The ordinary DFT is recovered when \(\alpha=1/N\). The transform is evaluated
using the Bailey--Swarztrauber/Bluestein chirp-convolution algorithm.
Constructing an FRDFT precomputes the chirps and convolution kernel so the
operator can be reused with different vectors of the same length.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
N
|
Length of the input and output vectors. Must be a positive integer. |
required | |
alpha
|
Finite fractionality parameter \(\alpha\). |
required |
See Also
frdft One-shot convenience function.
Source code in src/flexft/core.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
__call__
__call__(g)
Apply the fractional DFT to a vector of length N.
Source code in src/flexft/core.py
177 178 179 180 181 182 | |
FlexFT
Approximate the continuous Fourier transform on uniform grids.
The transform convention is
The grids are
where \(c=\lfloor N/2\rfloor\). If dk is omitted, the FFT-compatible
spacing \(\delta_k=1/(N\delta_x)\) is used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
N
|
Positive input and output length. |
required | |
dx
|
Positive direct-space spacing \(\delta_x\). |
required | |
dk
|
Positive reciprocal-space spacing \(\delta_k\). If omitted, use
|
None
|
|
x0
|
Direct-space grid centre. Defaults to zero. |
0.0
|
|
k0
|
Reciprocal-space grid centre. Defaults to zero. |
0.0
|
Source code in src/flexft/core.py
223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 | |
__call__
__call__(f)
Transform samples f with shape (N,).
Source code in src/flexft/core.py
278 279 280 281 | |
FlexFT2D
Approximate the 2D CFT on uniform tensor-product grids.
dx contains the direct-space spacings and is required. dk contains
the optional reciprocal-space spacings. Each grid argument may be a scalar,
which is applied to both axes, or an axis-specific pair. The transform is
applied separably along axis 0 and then axis 1.
Source code in src/flexft/core.py
350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 | |
IFlexFT
Approximate the inverse continuous Fourier transform on uniform grids.
This approximates
dk always denotes reciprocal-space spacing and is required. dx
always denotes direct-space spacing; when omitted, the FFT-compatible value
1 / (N * dk) is used.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
N
|
Positive input and output length. |
required | |
dk
|
Positive reciprocal-space spacing \(\delta_k\). |
required | |
dx
|
Positive direct-space spacing \(\delta_x\). If omitted, use
|
None
|
|
x0
|
Direct-space grid centre. Defaults to zero. |
0.0
|
|
k0
|
Reciprocal-space grid centre. Defaults to zero. |
0.0
|
Source code in src/flexft/core.py
292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 | |
__call__
__call__(F)
Inverse-transform samples F with shape (N,).
Source code in src/flexft/core.py
336 337 338 339 | |
IFlexFT2D
Approximate the inverse 2D CFT on uniform tensor-product grids.
dk contains the required reciprocal-space spacings. dx contains the
optional direct-space spacings; if omitted, FFT-compatible values are used.
Each grid argument may be a scalar, which is applied to both axes, or an
axis-specific pair.
Source code in src/flexft/core.py
394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 | |
flexft
flexft(f, *, dx, dk=None, x0=0.0, k0=0.0)
Apply a forward FlexFT without explicitly constructing a reusable plan.
Source code in src/flexft/core.py
284 285 286 287 288 289 | |
flexft2d
flexft2d(f, *, dx, dk=None, x0=0.0, k0=0.0)
Apply a 2D forward FlexFT without constructing a reusable plan.
Source code in src/flexft/core.py
386 387 388 389 390 391 | |
frdft
frdft(g, alpha)
Apply a fractional DFT without explicitly constructing a reusable plan.
Source code in src/flexft/core.py
215 216 217 218 219 220 | |
iflexft
iflexft(F, *, dk, dx=None, x0=0.0, k0=0.0)
Apply an inverse FlexFT without constructing a reusable plan.
Source code in src/flexft/core.py
342 343 344 345 346 347 | |
iflexft2d
iflexft2d(F, *, dk, dx=None, x0=0.0, k0=0.0)
Apply a 2D inverse FlexFT without constructing a reusable plan.
Source code in src/flexft/core.py
429 430 431 432 433 434 | |