Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@ehpor
Copy link
Owner

@ehpor ehpor commented Apr 6, 2023

The ZoomFFT is a Fourier transform based on the chirp Z-transform. Asymptotically it is faster than the MFT - since it's implemented using FFTs, its complexity is O(N^2 log(N)) for 2D transforms - the point of equality is only reached at array sizes of 1k x 1k (input) to 1k x 1k (output) or larger.

This Fourier transform will be added to the make_fourier_transform() function with a later PR. This PR is just for adding its implementation and the tests to support it long term.

One short-term caveat for the tests: the chirp Z-transform is tested by comparing with the scipy implementation of the CZT. We're not using that implementation since the FFTs that it uses are not accelerated. However, the scipy implementation is only available from version 1.8.0 onwards, which does not support Python 3.7. Therefore, I had to disable the CZT tests when scipy >=1.8.0 is not installed, so only on Python 3.8+. This caveat will be resolved when support for Python 3.7 will be dropped from HCIPy.

@ehpor ehpor added the enhancement New feature or request label Apr 6, 2023
@ehpor ehpor self-assigned this Apr 6, 2023
@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Merging #178 (df8292a) into master (5d55c7a) will increase coverage by 0.16%.
The diff coverage is 94.50%.

@@            Coverage Diff             @@
##           master     #178      +/-   ##
==========================================
+ Coverage   81.28%   81.45%   +0.16%     
==========================================
  Files          96       98       +2     
  Lines        7182     7273      +91     
==========================================
+ Hits         5838     5924      +86     
- Misses       1344     1349       +5     
Impacted Files Coverage Δ
hcipy/fourier/zoom_fast_fourier_transform.py 93.87% <93.87%> (ø)
hcipy/fourier/chirp_z_transform.py 95.00% <95.00%> (ø)
hcipy/fourier/__init__.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ehpor ehpor requested a review from syhaffert April 8, 2023 01:51
@ehpor ehpor marked this pull request as ready for review April 8, 2023 02:00
@ehpor ehpor changed the title Add a ZoomFFT Zoom Fast Fourier Transform and Chirp Z-Transform Apr 10, 2023
@ehpor ehpor force-pushed the feature/zoom_fft branch from bda8bef to 59941c4 Compare April 19, 2023 12:26
@ehpor ehpor force-pushed the feature/zoom_fft branch from fcbaab7 to df8292a Compare April 19, 2023 13:10
@ehpor
Copy link
Owner Author

ehpor commented Apr 19, 2023

@syhaffert This is still waiting for your review, and is now blocking another PR that I'm working on.

Copy link
Collaborator

@syhaffert syhaffert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I had 1 comment.

Copy link
Collaborator

@syhaffert syhaffert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is approved for merging.

@ehpor ehpor merged commit 088fd96 into master Apr 20, 2023
@ehpor ehpor deleted the feature/zoom_fft branch April 20, 2023 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants