From dd657ad3f1428b026486db3ec36691df17ddf515 Mon Sep 17 00:00:00 2001 From: "Steve M. Robbins" Date: Sat, 22 Oct 2011 04:54:51 +0200 Subject: Import nyquist_3.05.orig.tar.gz [dgit import orig nyquist_3.05.orig.tar.gz] --- tran/aresonvc.alg | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 tran/aresonvc.alg (limited to 'tran/aresonvc.alg') diff --git a/tran/aresonvc.alg b/tran/aresonvc.alg new file mode 100644 index 0000000..277ef8a --- /dev/null +++ b/tran/aresonvc.alg @@ -0,0 +1,34 @@ +(ARESONVC-ALG +(NAME "aresonvc") +(ARGUMENTS ("sound_type" "s1") ("sound_type" "hz") ("double" "bw") + ("int" "normalization")) +(LINEAR s1) +(INLINE-INTERPOLATION T) +(ALWAYS-SCALE hz) +(START (MAX s1 hz)) +(TERMINATE (MIN s1 hz)) +(LOGICAL-STOP (MIN s1)) +(SAMPLE-RATE (MAX s1)) +(STEP-FUNCTION hz) +(STATE ("double" "c3co" "exp(bw * -PI2 / s1->sr)") + ("double" "c3p1" "susp->c3co + 1.0") + ("double" "c3t4" "susp->c3co * 4.0") + ("double" "omc3" "1.0 - susp->c3co") + ("double" "c2" "0.0") + ("double" "c1" "0.0") + ("int" "normalization" "normalization") + ("double" "y1" "0.0") + ("double" "y2" "0.0; + hz->scale = (sample_type) (hz->scale * (PI2 / s1->sr))")) +(DEPENDS ("c2" "hz" "c3t4 * cos(hz) / c3p1") + ("c1" "hz" "(normalization == 0 ? 0.0 : + (normalization == 1 ? 1.0 - omc3 * sqrt(1.0 - c2 * c2 / c3t4) : + 1.0 - sqrt(c3p1 * c3p1 - c2 * c2) * omc3 / c3p1))")) +(CONSTANT "c1" "c2" "c3co" "c3p1" "c3t4" "omc3" "normalization") +(FORCE-INTO-REGISTER c3t4 c3p1 normalization omc3) +(INNER-LOOP-LOCALS " register double y0, current;") +(INNER-LOOP "current = s1; + y0 = c1 * current + c2 * y1 - c3co * y2; + output = (sample_type) y0; + y2 = y1; y1 = y0 - current") +) -- cgit v1.2.3