Author: wmb Date: 2009-08-05 22:37:27 +0200 (Wed, 05 Aug 2009) New Revision: 1276
Modified: cpu/x86/iirfilter.fth Log: IIR Filter - changed input length argument from #samples to /inbuf.
Modified: cpu/x86/iirfilter.fth =================================================================== --- cpu/x86/iirfilter.fth 2009-08-05 20:36:19 UTC (rev 1275) +++ cpu/x86/iirfilter.fth 2009-08-05 20:37:27 UTC (rev 1276) @@ -274,30 +274,26 @@ \ Stride is 2 for mono, 4 for stereo \ For stereo you must call it twice with an offset of 2 for \ inbuf and outbuf on the second call -: 8khz>48khz ( inbuf #samples outbuf stride -- ) - to sample-stride ( inbuf #samples outbuf ) - sample-outp ! ( inbuf #samples ) - init-upsample ( inbuf #samples ) - 0 ?do ( inbuf ) - dup sample-stride + ( inbuf inbuf' ) - swap <w@ ( inbuf' sample ) - up2 ( inbuf s1 s0 ) - up3 out, out, out, ( inbuf s1 ) - up3 out, out, out, ( inbuf ) - loop ( inbuf ) - drop +: 8khz>48khz ( inbuf /inbuf outbuf stride -- ) + to sample-stride ( inbuf /inbuf outbuf ) + sample-outp ! ( inbuf /inbuf ) + init-upsample ( inbuf /inbuf ) + bounds ?do ( ) + i <w@ ( sample ) + up2 ( s1 s0 ) + up3 out, out, out, ( s1 ) + up3 out, out, out, ( ) + sample-stride +loop ( ) ;
-: 16khz>48khz ( inbuf #samples outbuf stride -- ) - to sample-stride ( inbuf #samples outbuf ) - sample-outp ! ( inbuf #samples ) - init-upsample ( inbuf #samples ) - 0 ?do ( inbuf ) - dup sample-stride + ( inbuf inbuf' ) - swap <w@ ( inbuf' sample ) - up3 out, out, out, ( inbuf s1 ) - loop ( inbuf ) - drop +: 16khz>48khz ( inbuf /inbuf outbuf stride -- ) + to sample-stride ( inbuf /inbuf outbuf ) + sample-outp ! ( inbuf /inbuf ) + init-upsample ( inbuf /inbuf ) + bounds ?do ( ) + i <w@ ( sample ) + up3 out, out, out, ( ) + sample-stride +loop ( ) ;
0 [if]