Skip to content

Commit 036c7dd

Browse files
committed
Going insane at GH readme not parding this well
1 parent 6edab6d commit 036c7dd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/nbl/builtin/hlsl/fft/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ We have then worked out
155155

156156
$F(n) = \text{bitreverse}(e^{-1}(n))$.
157157

158-
For the function $F$ that satisfies $\text{NFFT[outputIdx] = DFT[}F(\text{outputIdx})\text{]}$ (remember both $e$, the bitreversal and $F$ are parameterized on both $\log_2(\text{ElementsPerInvocation})$ and $\log_2(\text{WorkgroupSize})$), so we're done!
158+
For the function $F$ that satisfies $\text{NFFT[outputIdx] = DFT[}F(\text{outputIdx})\text{]}$ (remember both $e$, the bitreversal and $F$ are parameterized on both $\log_2(\text{ElementsPerInvocation})$ and $\log_2(\text{WorkgroupSize})$ ), so we're done!
159159
We can similarly figure out $\text{DFT[freqIdx] = NFFT[}F^{-1}(\text{freqIdx})]$.
160160

161161
In code this is computed slightly differently, notice that we can define the map $g$ by making $g$ do a circular bit shift left by one position of the higher $N - E + 1$ bits of $n$. This induces the relationships
162162

163-
$ e \circ \text{bitreverse} = \text{bitreverse} \circ g $
163+
$e \circ \text{bitreverse} = \text{bitreverse} \circ g$
164164

165-
$ \text{bitreverse} \circ e^{-1} = g^{-1} \circ \text{bitreverse}$
165+
$\text{bitreverse} \circ e^{-1} = g^{-1} \circ \text{bitreverse}$
166166

167167
which are what's used in code to compute $F$ and its inverse (there is no particular reason for this, I found those before having a proof so they stay because they're equivalent and I don't want to fix what's not broken). In the math lingo this means $e$ and $g$ are conjugate via $\text{bitreverse}$.
168168

@@ -188,7 +188,7 @@ Notice the expression $F^{-1}(-F(T))$. This is what guides the `FFTIndexingUtils
188188

189189
Being special elements (especially of real FFTs, but also in general) we want to know where they end up. Since both bitreversal and the $e$ function just move bits around, it's straightforward that $\text{NFFT}[0] = \text{DFT}[0]$, and $\text{NFFT}[0]$ obviously always happens as thread $0$'s first element (with both local and global index $0$).
190190

191-
Thread $0$ also always holds the Nyquist frequency as its second element (that for which the local index is $1$). In fact, from the rule we had deduced earlier, line 1 will read "$e(1)$ holds $\text{bitreverse}(1)$". $\text{bitreverse}(1)$ is a $1$ in the MSB followed by all $0$ s, which is exactly the index of the Nyquist frequency in the $\text{DFT} \; (2^{N-1})$ while $e(1)$ works out to be $1|0$ which means it's the second (index $1$) element of thread $0$.
191+
Thread $0$ also always holds the Nyquist frequency as its second element (that for which the local index is $1$). In fact, from the rule we had deduced earlier, line 1 will read " $e(1)$ holds $\text{bitreverse}(1)$ ". $\text{bitreverse}(1)$ is a $1$ in the MSB followed by all $0$ s, which is exactly the index of the Nyquist frequency in the $\text{DFT} \; (2^{N-1})$ while $e(1)$ works out to be $1|0$ which means it's the second (index $1$) element of thread $0$.
192192

193193
## Finding out which elements to keep when doing a real-only FFT
194194

0 commit comments

Comments
 (0)