On 12/20, Oleg Nesterov wrote:
>
> On 12/19, Julius Smith wrote:
> >
> > All we can conclude from this test is that tf2s and svf are closer to each
> > other than either is to tf2snp.
>
> Julius, I can't believe it but it seems that tf2snp is just wrong
> when cf is low ;)
>
> test1:
>
>       F = 20;
>       w1 = 2*ma.PI*F;
>       a1s = -2.0*cos((ma.PI)*-1.0 + ma.PI/4.0);
>
>       hp_df = fi.tf2s(1,0,0,a1s,1,w1);
>       hp_np = fi.tf2snp(1,0,0,a1s,1,w1);
>
>       process = 1-1' <: hp_df, hp_np;
>
> see the frequency response (0 - 200 hz), tf2snp is green:
>
>       http://people.redhat.com/onestero/svf/frr.png
>
> lets recheck. test2:
>
>       F = 20;
>       w1 = 2*ma.PI*F;
>       a1s = -2.0*cos((ma.PI)*-1.0 + ma.PI/4.0);
>
>       hp_df = fi.tf2s(1,0,0,a1s,1,w1);
>       hp_np = fi.tf2snp(1,0,0,a1s,1,w1);
>
>       process = os.oscrs(97) <: hp_df, hp_np;
>
> see the output, the first 5000 samples:
>
>       http://people.redhat.com/onestero/svf/osc.png

looks like tf2np() limits the reflection-coefficients too much...
The patch below seems to make the things better.

Forgot to mention, I ran these tests with -double.

Oleg.


diff --git a/filters.lib b/filters.lib
index 5b276e3..b530a52 100644
--- a/filters.lib
+++ b/filters.lib
@@ -1004,7 +1004,7 @@ declare tf2np copyright "Copyright (C) 2003-2019 by 
Julius O. Smith III <jos@ccr
 declare tf2np license "MIT-style STK-4.3 license";
 tf2np(b0,b1,b2,a1,a2) = allpassnnlt(M,sv) : sum(i,M+1,*(tghr(i)))
 with {
-  smax = 0.9999; // maximum reflection-coefficient magnitude allowed
+  smax = 0.999999999; // maximum reflection-coefficient magnitude allowed
   s2 = max(-smax, min(smax,a2)); // Project both reflection-coefficients
   s1 = max(-smax, min(smax,a1/(1+a2))); // into the defined stability-region.
   sv = (s1,s2); // vector of sin(theta) reflection coefficients



_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to