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

incorrect/missing FFT behavior and documentation #382

Open
gewang opened this issue Oct 18, 2023 · 0 comments
Open

incorrect/missing FFT behavior and documentation #382

gewang opened this issue Oct 18, 2023 · 0 comments

Comments

@gewang
Copy link
Member

gewang commented Oct 18, 2023

from discord (c/o rwixen) "The FFT unit analyzer appears to round up the FFT size to the next power of two. It would be nice if the documentation reflected this. It would also be nice if the documentation said that the output is half the size of the FFT, containing only the frequencies below the Nyquist frequency."

"The FFT unit analyzer's .cvals() array is always size 8 when I use the transform(float[] from), regardless of the FFT size. When I instead use upchuck(), the size of the .cvals() array is appropriately half of the (power-of-two) FFT size."

"The FFT unit analyzer seems to be giving an incorrect output for an impulse input, for which the expected output should be constant. Instead, the output has a larger value for DC than for other frequencies. The attached file surfaces the issue."

Impulse impulse => FFT fft => blackhole;
impulse => Flip flip => blackhole;

8 => int N;
N => fft.size;
N => flip.size;

impulse.next(1);
N::samp => now;
fft.upchuck();
flip.upchuck();

<<<"x[n]">>>;
for (0 => int i; i < N; 1 +=> i) {
    <<<i, flip.fval(i)>>>;
}

<<<"X[n]">>>;
for (0 => int i; i < N / 2; 1 +=> i) {
    <<<i, fft.fval(i)>>>;
}
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