Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change ifft to fft in gate frequency domain calculation #391

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

jhillairet
Copy link
Member

@jhillairet jhillairet commented Sep 12, 2020

To address #390 , changed
kernel=fft.fftshift(fft.ifft(fft.ifftshift(gate, axes=0), axis=0))
to
kernel2=fft.ifftshift(fft.fft(fft.fftshift(gate, axes=0), axis=0))

While it produces a different mathematical result (for example due to the different iFFT/FFT normalization, see fft doc), the final result is the same as only the normalized magnitude is kept after:

kernel =abs(kernel).flatten() # take mag and flatten
kernel=kernel/sum(kernel) # normalize kernel

While the mathematical result is different due to the different iFFT/FFT normalization, final result is the same as the kernel is normalized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Bug Fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant