As an experiment fed the 7/8 LAG in twice. It tstill does not perform as

well as the two pole filter
This commit is contained in:
Robin P. Clark 2019-08-26 09:41:24 +01:00
parent 8d26c1ebf4
commit 44d99a527f
3 changed files with 6 additions and 5 deletions

2
tp.gpt
View File

@ -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

View File

@ -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

View File

@ -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);
}