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

even shapes required for real_domain_fft #21

Open
VolkerH opened this issue Apr 17, 2019 · 0 comments
Open

even shapes required for real_domain_fft #21

VolkerH opened this issue Apr 17, 2019 · 0 comments

Comments

@VolkerH
Copy link
Contributor

VolkerH commented Apr 17, 2019

While experimenting with real_domain_fft I noticed that this has different input shape requirements compared to complex_domain_fft. As a result, pad_modes in ['none', '2357'] will throw an error for some input shapes.

A notebook to reproduce this is here:
https://github.com/VolkerH/flowdec/blob/realdomainexperiments/python/examples/notebooks/experimenting%20with%20real_domain%20option.ipynb

I first noticed this here:
VolkerH/Lattice_Lightsheet_Deskew_Deconv#37

Suggested fix:

  • apply desired pad mode
  • if real_domain_fft: check if shape after padding is odd in any dimension and increase shape by one.

It is not obvious whether handling pad_mode == None like this is desirable behaviour. If users don't want padding maybe a warning should be issued that padding happens anyway.

Edit:
While
https://www.tensorflow.org/api_docs/python/tf/signal/rfft3d
doesn't explicitly mention the permitted shape, the fact that fft_length / 2 positive-frequency terms are returned seems to confirm that even dimensions are rquired.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant