Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
sh-lee97 committed Oct 8, 2024
1 parent 1b92ef0 commit 474e5dc
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/processor_api/core.html
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ <h1>grafx.processors.core<a class="headerlink" href="#grafx-processors-core" tit
</p>
<p>where <span class="math notranslate nohighlight">\(h[n]\)</span> is the true infinite impulse response (IIR). Clearly, increasing the number of samples <span class="math notranslate nohighlight">\(N\)</span> reduces the error.</p>
<p>The third one, <code class="code highlight python docutils literal highlight-python"><span class="s2">&quot;ssm&quot;</span></code>, is based on the diagonalisation of the state-space model (SSM) of the biquad filter so it only works for the second-order filters.
This idea is based on <a class="reference external" href="https://benhayes.net/">Ben Hayes</a>’s derivation of associative scan for parallel IIR filter computation and implemented by <a class="reference external" href="https://yoyololicon.github.io/">Chin-Yun Yu</a>.
The direct form II implementation of the biquad filter can be written in state-space form <span id="id6">[<a class="reference internal" href="../references/reference.html#id160" title="Julius Orion Smith. Introduction to digital filters: with audio applications. Volume 2. Julius Smith, 2007.">Smi07b</a>]</span> as
<div class="math-wrapper docutils container">
<div class="math notranslate nohighlight">
Expand All @@ -433,6 +434,7 @@ <h1>grafx.processors.core<a class="headerlink" href="#grafx-processors-core" tit
\end{split}\]</div>
</div>

where the state transition transition matrices are given as
<div class="math-wrapper docutils container">
<div class="math notranslate nohighlight">
\[\begin{split}
Expand Down
1 change: 1 addition & 0 deletions docs/processor_api/core.html~
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ h_N[n] = \sum_{m=0}^\infty h[n+mN].
</p>
<p>where <span class="math notranslate nohighlight">\(h[n]\)</span> is the true infinite impulse response (IIR). Clearly, increasing the number of samples <span class="math notranslate nohighlight">\(N\)</span> reduces the error.</p>
<p>The third one, <code class="code highlight python docutils literal highlight-python"><span class="s2">&quot;ssm&quot;</span></code>, is based on the diagonalisation of the state-space model (SSM) of the biquad filter so it only works for the second-order filters.
This idea is based on <a class="reference external" href="https://benhayes.net/">Ben Hayes</a>’s derivation of associative scan for parallel IIR filter computation and implemented by <a class="reference external" href="https://yoyololicon.github.io/">Chin-Yun Yu</a>.
The direct form II implementation of the biquad filter can be written in state-space form <span id="id6">[<a class="reference internal" href="../references/reference.html#id160" title="Julius Orion Smith. Introduction to digital filters: with audio applications. Volume 2. Julius Smith, 2007.">Smi07b</a>]</span> as
<div class="math-wrapper docutils container">
<div class="math notranslate nohighlight">
Expand Down
2 changes: 1 addition & 1 deletion docs/searchindex.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/searchindex.js~

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion src/grafx/processors/core/iir.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import warnings
from functools import partial, reduce

import numpy as np
import torch
Expand All @@ -7,7 +8,6 @@
import torch.nn.functional as F
import torchaudio
from torchaudio.functional import lfilter
from functools import reduce, partial
from torchlpc import sample_wise_lpc

from grafx.processors.core.convolution import FIRConvolution
Expand Down Expand Up @@ -67,6 +67,7 @@ class IIRFilter(nn.Module):
x_i[n+1] &= A_i x_i[n] + B_i s[n], \\
y_i[n] &= C_i x_i[n] + \bar{b}_{i, 0} s[n],
$$
where the state transition transition matrices are given as
$$
A_i = \begin{bmatrix}-\bar{a}_{i, 1} & -\bar{a}_{i, 2} \\ 1 & 0 \end{bmatrix}, \quad
B_i &= \begin{bmatrix}1 \\ 0 \end{bmatrix}, \quad
Expand Down

0 comments on commit 474e5dc

Please sign in to comment.