This is the interactwave project, a Vite-based application for interactive visualization of waves.
Make sure you have Node.js installed.
To start the development server, run:
npm run devThis will start Vite's development server.
To build the project for production, run:
npm run buildThis will create a dist directory with the production build.
To preview the production build, run:
npm run previewThis will start a local server to preview the production build.
This is based on my understanding of Cooley–Tukey FFT algorithm, I am also learning it.
the
$\textit{i}$ before$\sin$ represents imaginary number, in other places, the$i$ is used for indexing for convenience.
If we isolate columns with
And isolate rows with
case 1
case 2
The first term of both cases:
The second term of both cases:
First, we compute:
Then we have:
let
Which is A, which is B in each recursive steps:
| x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | |
|---|---|---|---|---|---|---|---|---|
| step 1 | A | A | A | A | B | B | B | B |
| step 2 | A | A | B | B | A | A | B | B |
| step 3 | A | B | A | B | A | B | A | B |
- A: 0, 2, 4, 6
- A: 0, 4
- B: 2, 6
- B: 1, 3, 5, 7
- A: 1, 5
- B: 3, 7
Look up index in each step, perform A+B or A-B, and the W to multiply:
| x0 | x1 | x2 | x3 | x4 | x5 | x6 | x7 | |
|---|---|---|---|---|---|---|---|---|
| 1A | 0 | 0 | 1 | 1 | 2 | 2 | 3 | 3 |
| 1B | 4 | 4 | 5 | 5 | 6 | 6 | 7 | 7 |
| W2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| A±B | + | - | + | - | + | - | + | - |
| 2A | 0 | 1 | 0 | 1 | 2 | 3 | 2 | 3 |
| 2B | 4 | 5 | 4 | 5 | 6 | 7 | 6 | 7 |
| W4 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| A±B | + | + | - | - | + | + | - | - |
| 3A | 0 | 1 | 2 | 3 | 0 | 1 | 2 | 3 |
| 3B | 4 | 5 | 6 | 7 | 4 | 5 | 6 | 7 |
| A±B | + | + | + | + | - | - | - | - |
| W8 | 0 | 1 | 2 | 3 | 0 | 1 | 2 | 3 |
| X0 | X1 | X2 | X3 | X4 | X5 | X6 | X7 |
B is always (A+(N/2))%N, A depends on:
- Size of FFT (N')
- How many matrices? (N/N')
- Each matrix advances index by (N'/2)
for entry i:
- which matrix? : floor(i/N')
- index within matrix? : mod(i, N')
- index within half of the matrix? : mod(i, N'/2)
- index of corresponding A? mod(i, N'/2) + floor(i/N') * (N'/2)
For N=8 example:
| step | N' | #mats | Δi |
|---|---|---|---|
| 1 | 2 | 4 | 1 |
| 2 | 4 | 2 | 2 |
| 3 | 8 | 1 | 4 |