Add chirp Z-transform, zoom FFT
See original GitHub issueAs mentioned in numpy/numpy/issues/1177, Chirp Z-transform and special cases of it have been submitted to SciPy under public domain by Paul Kienzle and Nadav Horesh: [SciPy-user] Chirp Z transform
The special cases of CZT are zoom FFT and “scaled FFT” (not sure what that does). DFT is also a special case of CZT, so if you call czt(data)
with the default options, it’s an FFT, but faster for prime sizes because of Bluestein’s algorithm, useful in resample
for instance? (#3956):
x = rand(42073) # prime length
allclose(czt(x), fft(x))
Out[37]: True
timeit czt(x)
10 loops, best of 3: 53.9 ms per loop
timeit fft(x)
1 loops, best of 3: 2.35 s per loop
2.35 / 53.9e-3 # speedup factor
Out[40]: 43.59925788497217
@stefanv said:
Thank you both for the contribution! I’ve reviewed the code and think it should be included in SciPy. Would someone else like to have a look before I commit it?
Where would the best place for this be? scipy.fftpack?
I think it makes sense to put it in scipy.fftpack, too, though that doesn’t have any classes, just functions. (Unless it should all be put in numpy, but I’m guessing zoom FFT is too specialized for that?)
Issue Analytics
- State:
- Created 9 years ago
- Reactions:2
- Comments:15 (14 by maintainers)
With the switch to
pocketfft
(which automatically uses Bluestein’s algorithm when useful), this is most likely no longer needed for prime-sized FFTs.For the CZT itself I’ll be happy to help with any necessary adjustments to the new FFT infrastructure.
Yes, gh-4607 is enough. Feature request issues are good for discussion, but no need to keep them open once there’s a PR.
Issues our mainly for bugs, our bug count (discovered + undiscovered) is finite, while potential new feature count is infinite:)