Skip to content

Commit

Permalink
fix(docs): fix LaTeX rendering in README
Browse files Browse the repository at this point in the history
  • Loading branch information
ascpixi authored Dec 23, 2024
1 parent 5b9ffa0 commit 911a15a
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@ In an HFTNN forward transform, the following steps are performed:

1. Given a discrete signal $x[n]$, the signal is partitioned into non-overlapping, windowed segments of length $N$. Each segment is denoted as $x_{\text{chunk}}[k]$, where $k$ is the segment index.

$$
x_{\text{chunk}}[k] = x[n], \quad \text{for } n = kN \text{ to } (k+1)N - 1
$$
$$
x_{\text{chunk}}[k] = x[n], \quad \text{for } n = kN \text{ to } (k+1)N - 1
$$

2. The Fourier transform of each segment $x_{\text{chunk}}[k]$ is denoted as $X_{\text{chunk}}[k]$.

$$
X_{\text{chunk}}[k] = \mathcal{F}\left(x_{\text{chunk}}[k]\right)
$$
$$
X_{\text{chunk}}[k] = \mathcal{F}\left(x_{\text{chunk}}[k]\right)
$$

3. For each Fourier transform bin, harmonics are selected within a specified range of octaves, including neighboring bins. Let $\text{HFT}$ be the resulting array.

$$
\text{HFT}[j] = \left[\text{magnitude}, \text{phase}\right]
$$
$$
\text{HFT}[j] = \left[\text{magnitude}, \text{phase}\right]
$$

Here, $j$ represents the index iterating over the selected harmonics and neighboring bins.

4. The frequency corresponding to each harmonic is calculated using the function $\text{freq}(j)$. The corresponding FFT bin index is denoted as $\text{binIdx}(j)$.

$$
\text{freq}(j) = \text{intervalToFreq}\left(j, \text{fundamental}, \text{frequenciesInOctave}\right)
$$
$$
\text{freq}(j) = \text{intervalToFreq}\left(j, \text{fundamental}, \text{frequenciesInOctave}\right)
$$

$$
\text{binIdx}(j) = \text{freqToFftBin}\left(\text{freq}(j), \text{sampleRate}, \text{signalLength}\right)
$$
$$
\text{binIdx}(j) = \text{freqToFftBin}\left(\text{freq}(j), \text{sampleRate}, \text{signalLength}\right)
$$

5. To handle edge cases where the computed bin index $\text{binIdx}$ and neighboring indices $\text{idx}$ may exceed array bounds, a conditional statement is used.

$$
\text{HFT}[j] =
\begin{cases}
[0, 0], & \text{if } \text{idx} < 0 \text{ or } \text{idx} \geq \text{bins.length} \\
[\text{magnitude}, \text{phase}], & \text{otherwise}
\end{cases}
$$
$$
\text{HFT}[j] =
\begin{cases}
[0, 0], & \text{if } \text{idx} < 0 \text{ or } \text{idx} \geq \text{bins.length} \\
[\text{magnitude}, \text{phase}], & \text{otherwise}
\end{cases}
$$

A similar algorithm is employed for the inverse temporal transform.

Expand Down

0 comments on commit 911a15a

Please sign in to comment.