Skip to content

Commit

Permalink
fix: one equation per block
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyolicoris committed Mar 29, 2024
1 parent f91394e commit 033c85d
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,21 @@ def compexp_gain(
```

$$
x_{\rm rms}[n] = \alpha_{\rm rms} x^2[n] + (1 - \alpha_{\rm rms}) x_{\rm rms}[n-1] \\
x_{\rm log}[n] = 20 \log_{10} x_{\rm rms}[n] \\
g_{\rm log}[n] = \min\left(0, \left(1 - \frac{1}{CR}\right)\left(CT - x_{\rm log}[n]\right), \left(1 - \frac{1}{ER}\right)\left(ET - x_{\rm log}[n]\right)\right) \\
g[n] = 10^{g_{\rm log}[n] / 20} \\
x_{\rm rms}[n] = \alpha_{\rm rms} x^2[n] + (1 - \alpha_{\rm rms}) x_{\rm rms}[n-1]
$$
$$
x_{\rm log}[n] = 20 \log_{10} x_{\rm rms}[n]
$$
$$
g_{\rm log}[n] = \min\left(0, \left(1 - \frac{1}{CR}\right)\left(CT - x_{\rm log}[n]\right), \left(1 - \frac{1}{ER}\right)\left(ET - x_{\rm log}[n]\right)\right)
$$
$$
g[n] = 10^{g_{\rm log}[n] / 20}
\hat{g}[n] = \begin{rcases} \begin{dcases}
\alpha_{\rm at} g[n] + (1 - \alpha_{\rm at}) \hat{g}[n-1] & \text{if } g[n] < g[n-1] \\
\alpha_{\rm at} g[n] + (1 - \alpha_{\rm at}) \hat{g}[n-1] & \text{if } g[n] < g[n-1]
\alpha_{\rm rt} g[n] + (1 - \alpha_{\rm rt}) \hat{g}[n-1] & \text{otherwise}
\end{dcases}\end{rcases} \\
\end{dcases}\end{rcases}
$$
$$
y[n] = \hat{g}[n] x[n]
$$

0 comments on commit 033c85d

Please sign in to comment.