Skip to content

Commit

Permalink
Add test programs raise versions and regenerate.
Browse files Browse the repository at this point in the history
  • Loading branch information
sletz committed Jan 28, 2025
1 parent 1bc89d9 commit bf97622
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 30 deletions.
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -389,5 +389,5 @@ <h4 class="modal-title" id="keyboardModalLabel">Keyboard Shortcuts</h4>

<!--
MkDocs version : 1.5.3
Build Date UTC : 2025-01-27 18:27:35.007343+00:00
Build Date UTC : 2025-01-28 09:54:48.731705+00:00
-->
100 changes: 79 additions & 21 deletions docs/libs/filters/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,14 @@
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#fisvf_morph" class="nav-link">(fi.)svf_morph</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#fisvf_notch_morph" class="nav-link">(fi.)svf_notch_morph</a>
<ul class="nav flex-column">
</ul>
</li>
<li class="nav-item" data-level="3"><a href="#fisvftpt" class="nav-link">(fi.)SVFTPT</a>
<ul class="nav flex-column">
</ul>
Expand Down Expand Up @@ -2050,6 +2058,56 @@ <h4 id="usage_67">Usage</h4>
<li><code>[gain]</code>: gain in dB</li>
</ul>
<hr />
<h3 id="fisvf_morph"><code>(fi.)svf_morph</code></h3>
<p>An SVF-based filter that can smoothly morph between
being lowpass, bandpass, and highpass.</p>
<h4 id="usage_68">Usage</h4>
<pre><code>_ : svf_morph(freq, Q, blend) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>freq</code>: cutoff frequency</li>
<li><code>Q</code>: quality factor</li>
<li><code>blend</code>: [0..2] continuous, where 0 is <code>lowpass</code>, 1 is <code>bandpass</code>, and 2 is <code>highpass</code>. For performance, the value is not clamped to [0..2].</li>
</ul>
<h4 id="example-test-program_5">Example test program</h4>
<pre><code>process = no.noise : svf_morph(freq, q, blend)
with {
blend = hslider(&quot;Blend&quot;, 0, 0, 2, .01) : si.smoo;
q = hslider(&quot;Q&quot;, 1, 0.1, 10, .01) : si.smoo;
freq = hslider(&quot;freq&quot;, 5000, 100, 18000, 1) : si.smoo;
};
</code></pre>
<h4 id="reference_24">Reference</h4>
<ul>
<li><a href="https://github.com/mtytel/vital/blob/636ca0ef517a4db087a6a08a6a8a5e704e21f836/src/synthesis/filters/digital_svf.cpp#L292-L295">https://github.com/mtytel/vital/blob/636ca0ef517a4db087a6a08a6a8a5e704e21f836/src/synthesis/filters/digital_svf.cpp#L292-L295</a></li>
</ul>
<hr />
<h3 id="fisvf_notch_morph"><code>(fi.)svf_notch_morph</code></h3>
<p>An SVF-based notch-filter that can smoothly morph between
being lowpass, notch, and highpass.</p>
<h4 id="usage_69">Usage</h4>
<pre><code>_ : svf_notch_morph(freq, Q, blend) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>freq</code>: cutoff frequency</li>
<li><code>Q</code>: quality factor</li>
<li><code>blend</code>: [0..2] continuous, where 0 is <code>lowpass</code>, 1 is <code>notch</code>, and 2 is <code>highpass</code>. For performance, the value is not clamped to [0..2].</li>
</ul>
<h4 id="example-test-program_6">Example test program</h4>
<pre><code>process = no.noise : svf_notch_morph(freq, q, blend)
with {
blend = hslider(&quot;Blend&quot;, 0, 0, 2, .01) : si.smoo;
q = hslider(&quot;Q&quot;, 1, 0.1, 10, .01) : si.smoo;
freq = hslider(&quot;freq&quot;, 5000, 100, 18000, 1) : si.smoo;
};
</code></pre>
<h4 id="reference_25">Reference</h4>
<ul>
<li><a href="https://github.com/mtytel/vital/blob/636ca0ef517a4db087a6a08a6a8a5e704e21f836/src/synthesis/filters/digital_svf.cpp#L256C36-L263">https://github.com/mtytel/vital/blob/636ca0ef517a4db087a6a08a6a8a5e704e21f836/src/synthesis/filters/digital_svf.cpp#L256C36-L263</a></li>
</ul>
<hr />
<h3 id="fisvftpt"><code>(fi.)SVFTPT</code></h3>
<p>Topology-preserving transform implementation following Zavalishin's method.</p>
<p>Outputs: lowpass, highpass, bandpass, normalised bandpass, notch, allpass,
Expand All @@ -2060,7 +2118,7 @@ <h3 id="fisvftpt"><code>(fi.)SVFTPT</code></h3>
<code>SVFTPT.SVF(1000.0, .707)</code>.</p>
<p>Even though the implementation is different, the characteristics of this
filter are comparable to those of the <code>svf</code> environment in this library.</p>
<h4 id="usage_68">Usage:</h4>
<h4 id="usage_70">Usage:</h4>
<pre><code>_ : SVFTPT.xxx(CF, Q) : _
</code></pre>
<p>Where:</p>
Expand All @@ -2082,7 +2140,7 @@ <h3 id="fidynamicsmoother"><code>(fi.)dynamicSmoother</code></h3>
<p>This implementation does not use an approximation for the CF computation,
and it deploys guards to prevent overshooting with extreme sensitivity
values.</p>
<h4 id="usage_69">Usage:</h4>
<h4 id="usage_71">Usage:</h4>
<pre><code>_ : dynamicSmoother(sensitivity, baseCF) : _
</code></pre>
<p>Where:</p>
Expand All @@ -2093,7 +2151,7 @@ <h4 id="usage_69">Usage:</h4>
<li><code>baseCF</code>: cutoff frequency, in Hz, when there is no variation in the
input signal</li>
</ul>
<h4 id="reference_24">Reference</h4>
<h4 id="reference_26">Reference</h4>
<ul>
<li><a href="https://cytomic.com/files/dsp/DynamicSmoothing.pdf">https://cytomic.com/files/dsp/DynamicSmoothing.pdf</a></li>
</ul>
Expand All @@ -2102,7 +2160,7 @@ <h3 id="fioneeuro"><code>(fi.)oneEuro</code></h3>
<p>The One Euro Filter (1€ Filter) is an adaptive lowpass filter.
This kind of filter is commonly used in object-tracking,
not necessarily audio processing.</p>
<h4 id="usage_70">Usage</h4>
<h4 id="usage_72">Usage</h4>
<pre><code>_ : oneEuro(derivativeCutoff, beta, minCutoff) : _
</code></pre>
<p>Where:</p>
Expand All @@ -2125,12 +2183,12 @@ <h2 id="linkwitz-riley-4th-order-2-way-3-way-and-4-way-crossovers">Linkwitz-Rile
filter implemented above by setting the Q-factor to 1.0 / sqrt(2.0).
These will be cascaded in pairs to build the LR4 highpass and lowpass.
For the phase correction, we will use the 2nd-order Butterworth allpass.</p>
<h4 id="reference_25">Reference</h4>
<h4 id="reference_27">Reference</h4>
<p>Zavalishin, Vadim. "The art of VA filter design." Native Instruments, Berlin, Germany (2012).</p>
<hr />
<h3 id="filowpasslr4"><code>(fi.)lowpassLR4</code></h3>
<p>4th-order Linkwitz-Riley lowpass.</p>
<h4 id="usage_71">Usage</h4>
<h4 id="usage_73">Usage</h4>
<pre><code>_ : lowpassLR4(cf) : _
</code></pre>
<p>Where:</p>
Expand All @@ -2140,7 +2198,7 @@ <h4 id="usage_71">Usage</h4>
<hr />
<h3 id="fihighpasslr4"><code>(fi.)highpassLR4</code></h3>
<p>4th-order Linkwitz-Riley highpass.</p>
<h4 id="usage_72">Usage</h4>
<h4 id="usage_74">Usage</h4>
<pre><code>_ : highpassLR4(cf) : _
</code></pre>
<p>Where:</p>
Expand All @@ -2150,7 +2208,7 @@ <h4 id="usage_72">Usage</h4>
<hr />
<h3 id="ficrossover2lr4"><code>(fi.)crossover2LR4</code></h3>
<p>Two-way 4th-order Linkwitz-Riley crossover.</p>
<h4 id="usage_73">Usage</h4>
<h4 id="usage_75">Usage</h4>
<pre><code>_ : crossover2LR4(cf) : si.bus(2)
</code></pre>
<p>Where:</p>
Expand All @@ -2160,7 +2218,7 @@ <h4 id="usage_73">Usage</h4>
<hr />
<h3 id="ficrossover3lr4"><code>(fi.)crossover3LR4</code></h3>
<p>Three-way 4th-order Linkwitz-Riley crossover.</p>
<h4 id="usage_74">Usage</h4>
<h4 id="usage_76">Usage</h4>
<pre><code>_ : crossover3LR4(cf1, cf2) : si.bus(3)
</code></pre>
<p>Where:</p>
Expand All @@ -2171,7 +2229,7 @@ <h4 id="usage_74">Usage</h4>
<hr />
<h3 id="ficrossover4lr4"><code>(fi.)crossover4LR4</code></h3>
<p>Four-way 4th-order Linkwitz-Riley crossover.</p>
<h4 id="usage_75">Usage</h4>
<h4 id="usage_77">Usage</h4>
<pre><code>_ : crossover4LR4(cf1, cf2, cf3) : si.bus(4)
</code></pre>
<p>Where:</p>
Expand All @@ -2183,7 +2241,7 @@ <h4 id="usage_75">Usage</h4>
<hr />
<h3 id="ficrossover8lr4"><code>(fi.)crossover8LR4</code></h3>
<p>Eight-way 4th-order Linkwitz-Riley crossover.</p>
<h4 id="usage_76">Usage</h4>
<h4 id="usage_78">Usage</h4>
<pre><code>_ : crossover8LR4(cf1, cf2, cf3, cf4, cf5, cf6, cf7) : si.bus(8)
</code></pre>
<p>Where:</p>
Expand All @@ -2207,10 +2265,10 @@ <h3 id="fiitu_r_bs_1770_4_kfilter"><code>(fi.)itu_r_bs_1770_4_kfilter</code></h3
magnitude difference at 48kHz between the ITU-defined filter and
<code>itu_r_bs_1770_4_kfilter</code> is 0.001dB, which obviously could be
less.</p>
<h4 id="usage_77">Usage</h4>
<h4 id="usage_79">Usage</h4>
<pre><code>_ : itu_r_bs_1770_4_kfilter : _
</code></pre>
<h4 id="reference_26">Reference</h4>
<h4 id="reference_28">Reference</h4>
<ul>
<li><a href="https://www.itu.int/rec/R-REC-BS.1770">https://www.itu.int/rec/R-REC-BS.1770</a></li>
<li><a href="https://gist.github.com/jkbd/07521a98f7873a2dc3dbe16417930791">https://gist.github.com/jkbd/07521a98f7873a2dc3dbe16417930791</a></li>
Expand All @@ -2219,7 +2277,7 @@ <h2 id="averaging-functions">Averaging Functions</h2>
<hr />
<h3 id="fiavg_rect"><code>(fi.)avg_rect</code></h3>
<p>Moving average.</p>
<h4 id="usage_78">Usage</h4>
<h4 id="usage_80">Usage</h4>
<pre><code>_ : avg_rect(period) : _
</code></pre>
<p>Where:</p>
Expand All @@ -2233,15 +2291,15 @@ <h3 id="fiavg_tau"><code>(fi.)avg_tau</code></h3>
that is, tau is the integral of the filter's impulse response. This
response is slower to reach the final value but has less ripples in
non-steady signals.</p>
<h4 id="usage_79">Usage</h4>
<h4 id="usage_81">Usage</h4>
<pre><code>_ : avg_tau(period) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>period</code> is the time, in seconds, for the system to decay by 1/e,
or to reach 1-1/e of its final value.</li>
</ul>
<h4 id="reference_27">Reference</h4>
<h4 id="reference_29">Reference</h4>
<ul>
<li><a href="https://ccrma.stanford.edu/~jos/mdft/Exponentials.html">https://ccrma.stanford.edu/~jos/mdft/Exponentials.html</a></li>
</ul>
Expand All @@ -2250,15 +2308,15 @@ <h3 id="fiavg_t60"><code>(fi.)avg_t60</code></h3>
<p>Averaging function based on a one-pole filter and the t60 response time.
This response is particularly useful when the system is required to
reach the final value after about <code>period</code> seconds.</p>
<h4 id="usage_80">Usage</h4>
<h4 id="usage_82">Usage</h4>
<pre><code>_ : avg_t60(period) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>period</code> is the time, in seconds, for the system to decay by 1/1000,
or to reach 1-1/1000 of its final value.</li>
</ul>
<h4 id="reference_28">Reference</h4>
<h4 id="reference_30">Reference</h4>
<ul>
<li><a href="https://ccrma.stanford.edu/~jos/mdft/Audio_Decay_Time_T60.html">https://ccrma.stanford.edu/~jos/mdft/Audio_Decay_Time_T60.html</a></li>
</ul>
Expand All @@ -2268,15 +2326,15 @@ <h3 id="fiavg_t19"><code>(fi.)avg_t19</code></h3>
This response is close to the moving-average algorithm as it roughly reaches
the final value after <code>period</code> seconds and shows about the same
oscillations for non-steady signals.</p>
<h4 id="usage_81">Usage</h4>
<h4 id="usage_83">Usage</h4>
<pre><code>_ : avg_t19(period) : _
</code></pre>
<p>Where:</p>
<ul>
<li><code>period</code> is the time, in seconds, for the system to decay by 1/e^2.2,
or to reach 1-1/e^2.2 of its final value.</li>
</ul>
<h4 id="reference_29">Reference</h4>
<h4 id="reference_31">Reference</h4>
<p>Zölzer, U. (2008). Digital audio signal processing (Vol. 9). New York: Wiley.</p>
<h2 id="kalman-filters">Kalman Filters</h2>
<hr />
Expand All @@ -2285,7 +2343,7 @@ <h3 id="fikalman"><code>(fi.)kalman</code></h3>
Note that the only compile-time constant arguments are <code>N</code> and <code>M</code>.
Other arguments are capitalized because they're matrices, and it makes
reading them much easier.</p>
<h4 id="usage_82">Usage</h4>
<h4 id="usage_84">Usage</h4>
<pre><code>kalman(N, M, B, R, H, Q, F, reset, u, z) : si.bus(N)
</code></pre>
<p>Where:</p>
Expand Down
2 changes: 2 additions & 0 deletions docs/libs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,8 @@ <h2 id="filters">filters</h2>
<a href="filters/#fifilterbank">(fi.)filterbank</a> &nbsp; &nbsp;
<a href="filters/#fifilterbanki">(fi.)filterbanki</a> &nbsp; &nbsp;
<a href="filters/#fisvf">(fi.)svf</a> &nbsp; &nbsp;
<a href="filters/#fisvf_morph">(fi.)svf_morph</a> &nbsp; &nbsp;
<a href="filters/#fisvf_notch_morph">(fi.)svf_notch_morph</a> &nbsp; &nbsp;
<a href="filters/#fisvftpt">(fi.)SVFTPT</a> &nbsp; &nbsp;
<a href="filters/#fidynamicsmoother">(fi.)dynamicSmoother</a> &nbsp; &nbsp;
<a href="filters/#fioneeuro">(fi.)oneEuro</a> &nbsp; &nbsp;
Expand Down
2 changes: 1 addition & 1 deletion docs/search/search_index.json

Large diffs are not rendered by default.

Binary file modified docs/sitemap.xml.gz
Binary file not shown.
32 changes: 27 additions & 5 deletions filters.lib
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fi = library("filters.lib"); // for compatible copy/paste out of this file
la = library("linearalgebra.lib");

declare name "Faust Filters Library";
declare version "1.6.0";
declare version "1.7.0";

//===============================Basic Filters============================================
//========================================================================================
Expand Down Expand Up @@ -2816,7 +2816,19 @@ svf = environment {
// * `Q`: quality factor
// * `blend`: [0..2] continuous, where 0 is `lowpass`, 1 is `bandpass`, and 2 is `highpass`. For performance, the value is not clamped to [0..2].
//
// Reference:
//
// #### Example test program
//
// ```
// process = no.noise : svf_morph(freq, q, blend)
// with {
// blend = hslider("Blend", 0, 0, 2, .01) : si.smoo;
// q = hslider("Q", 1, 0.1, 10, .01) : si.smoo;
// freq = hslider("freq", 5000, 100, 18000, 1) : si.smoo;
// };
// ```
//
// #### Reference
// <https://github.com/mtytel/vital/blob/636ca0ef517a4db087a6a08a6a8a5e704e21f836/src/synthesis/filters/digital_svf.cpp#L292-L295>
//-----------------------------------------------------
declare svf_morph author "David Braun";
Expand Down Expand Up @@ -2847,7 +2859,19 @@ with {
// * `Q`: quality factor
// * `blend`: [0..2] continuous, where 0 is `lowpass`, 1 is `notch`, and 2 is `highpass`. For performance, the value is not clamped to [0..2].
//
// Reference:
//
// #### Example test program
//
// ```
// process = no.noise : svf_notch_morph(freq, q, blend)
// with {
// blend = hslider("Blend", 0, 0, 2, .01) : si.smoo;
// q = hslider("Q", 1, 0.1, 10, .01) : si.smoo;
// freq = hslider("freq", 5000, 100, 18000, 1) : si.smoo;
// };
// ```
//
// #### Reference
// <https://github.com/mtytel/vital/blob/636ca0ef517a4db087a6a08a6a8a5e704e21f836/src/synthesis/filters/digital_svf.cpp#L256C36-L263>
//-----------------------------------------------------------
declare svf_notch_morph author "David Braun";
Expand Down Expand Up @@ -3299,7 +3323,6 @@ avg_rect(period, x) = x : ba.slidingMean(rint(period * ma.SR));
// or to reach 1-1/e of its final value.
//
// #### Reference
//
// <https://ccrma.stanford.edu/~jos/mdft/Exponentials.html>
//-----------------------------------------------------------------------------
declare avg_tau author "Dario Sanfilippo and Julius O. Smith III";
Expand Down Expand Up @@ -3327,7 +3350,6 @@ avg_tau(period, x) = fi.lptau(period, x);
// or to reach 1-1/1000 of its final value.
//
// #### Reference
//
// <https://ccrma.stanford.edu/~jos/mdft/Audio_Decay_Time_T60.html>
//-----------------------------------------------------------------------------
declare avg_t60 author "Dario Sanfilippo and Julius O. Smith III";
Expand Down
4 changes: 2 additions & 2 deletions version.lib
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
//
//------------------------------------------------------------
version = 2, // MAJOR version when we make incompatible API changes,
47, // MINOR version when we add functionality in a backwards compatible manner,
3; // PATCH version when we make backwards compatible bug fixes.
48, // MINOR version when we add functionality in a backwards compatible manner,
0; // PATCH version when we make backwards compatible bug fixes.


0 comments on commit bf97622

Please sign in to comment.