Replies: 1 comment
-
Hi @sijieh23, I guess cupyx.scipy.fft implements the DFT basis exp(-i*2*pi*k*n/N), it assumes that the samples live on the index grid n = 0, 1, ..., N-1, the angle grid is 2*pi*n/N(origin at 0). If your query points are at x_q = -pi + 2*pi*n/N (origin at -pi), the constant shift of -pi introduces a mode wise phase ramp.
k = np.arange(n)
phase = np.exp(1j*np.pi*k)
u_hat = u_hat * phase or simply:
plan.setpts(xq+cp.pi) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm using type 2 transform for interpolation on a nonuniform grid. Throughout the document, it says the default domain for the query points is$x_q\in[-\pi, \pi)$ . However, I quickly tried it, and it seems like $x_q\in[0, 2\pi)$ is the default one instead of $x_q\in[-\pi, \pi)$ .
I'm attaching my code here:
I'm attaching the results here. The top panel is for$x_q\in[0, 2\pi)$ , while the bottom one is for $x_q\in[-\pi, \pi)$ . Clearly, the bottom one does not agree with the expected result.
So I'm wondering if I'm missing something here, or if it's just a bug in the document?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions