diff --git a/tp.gpt b/tp.gpt index 2fa12e7..046dfa9 100644 --- a/tp.gpt +++ b/tp.gpt @@ -1,7 +1,7 @@ #plot "tp.dat" using 1:3 title "input", "tp.dat" using 1:5 title "two pole", "tp.dat" using 1:6 title "34LAG", "tp.dat" using 1:7 title "78LAG" -plot "tp.dat" using 1:3 title "input" with linespoints, "tp.dat" using 1:5 title "two pole" with linespoints, "tp.dat" using 1:7 title "78LAG" with linespoints +plot "tp.dat" using 1:3 title "input" with linespoints, "tp.dat" using 1:5 title "two pole" with linespoints, "tp.dat" using 1:7 title "78LAG" with linespoints, "tp.dat" using 1:9 title "78LAG TWICE" with linespoints !sleep 10 !sleep 10 diff --git a/tp_2.gpt b/tp_2.gpt index a91ddee..926aff8 100644 --- a/tp_2.gpt +++ b/tp_2.gpt @@ -2,7 +2,7 @@ set xrange[200:1000] #plot "tp.dat" using 1:3 title "input", "tp.dat" using 1:5 title "two pole", "tp.dat" using 1:6 title "34LAG", "tp.dat" using 1:7 title "78LAG" -plot "tp.dat" using 1:3 title "input" with linespoints, "tp.dat" using 1:5 title "two pole" with linespoints, "tp.dat" using 1:7 title "78LAG" with linespoints +plot "tp.dat" using 1:3 title "input" with linespoints, "tp.dat" using 1:5 title "two pole" with linespoints, "tp.dat" using 1:7 title "78LAG" with linespoints, "tp.dat" using 1:5 title "two pole" with linespoints "tp.dat" using 1:9 title "LAG78 TWICE" with linespoints !sleep 10 !sleep 10 diff --git a/two_pole_7_8.c b/two_pole_7_8.c index 9cff118..159072f 100644 --- a/two_pole_7_8.c +++ b/two_pole_7_8.c @@ -55,7 +55,7 @@ two_pole_7_8 ( int16_t input ) { // - ( (y2>>1) + // half (y2>>2) + // quarter - (y2>>6) ); // 64th + (y2>>6) ); // 64th // @@ -83,7 +83,7 @@ two_pole_7_8 ( int16_t input ) { int main () { int i; - int16_t val,res, res34, res78,rr; + int16_t val,res, res34, res78, res78_2, rr; for (i=0;i<1000;i++) { @@ -102,8 +102,9 @@ int main () { res34 = (((res34<<2) - res34)>>2) + (val>>2); res78 = (((res78<<3) - res78)>>3) + (val>>3); + res78_2 = (((res78_2<<3) - res78_2)>>3) + (res78>>3); // feed res78 into another should be the same as two pole - printf ("%d val %d res %d res34 %d res78 %d\n",i, val,res, res34, res78); + printf ("%d val %d res %d res34 %d res78 %d res78_2 %d\n",i, val,res, res34, res78, res78_2); }