Conversation
…ncy spectrum with negligible additional computation.
…transform is now applied after (before) the first transform is completed. This reduces the size of the problem, so the computation is less expensive.
| return jnp.fft.irfft(c, n, axis=0, norm="forward") | ||
|
|
||
| if n < c.shape[0]: | ||
| c = c[:n] |
There was a problem hiding this comment.
doesn't this truncation mean that we're still interpolating the band limited signal, not the full one?
There was a problem hiding this comment.
c.shape[0] has size f.shape[0]//2 + 1. so our band limited signal can preserve double the width of the fourier spectrum than before
| x = jnp.linspace(0, 2 * jnp.pi, n, endpoint=False) | ||
| x = jnp.exp(1j * (c.shape[0] // 2) * x).reshape(n, *((1,) * (c.ndim - 1))) |
There was a problem hiding this comment.
can you explain this part? Isn't this just multiplying the output by exp(i*n*x)?
There was a problem hiding this comment.
we transform sum_n^N c_n e^(i n x) for n>=0 to e^iNx//2 sum_k c_n e^(ikx) where k now includes the relevant negative values (that result from pulling the highest frequency outside the sum)
There was a problem hiding this comment.
|
What's the status of this? It looks like there are some merge conflicts. Previously the method was only correct for real valued data, but I've since fixed it so that it works for complex data as well, but I'd be happy to include this as a special case when the data is purely real |
The improvements in points 3 and 4 in the PR header would still apply to complex transforms.
The merge conflicts are resolved by updating the names of the functions and tests here now that the original ones support complex data. interpax-fft here simply includes #117 with labels |
|
yea so just add interpax-fft as a depedency and call it if input data is not jnp.complexobj |
This is the first of two pull requests to improve the FFT interpolation.
4 goals are achieved by this PR.