11.07.2015 Views

section 7 - Index of

section 7 - Index of

section 7 - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

All coefficients are divided by 2:w( n )/2=x( n)/2-ai 1/2*w( n-1 )-ai2/2*w( n-2)y( n )/2=w( n )/2+bi 1/2*w( n-1 )+bi2/2*w( n-2)X Memory OrganizationwN(n-1) Data + 2*nsec - 1wN(n-2)w1 (n-1)RO'" w1 (n-2) DataY Memory Organizationb1 N/2 Coef. + 4*nsec - 1b2N/2a1N/2a2N/2b11/2b2112a11/2R4.. a21/2 Coef.,.*********************************************************************************************************************initialization,.*************************************nsec equ 4start equ $40data equ 0coef equ 0input equ $ffeOoutput equ $ffe1igain equ 0.5ori #$08,mr ;set scaling modemove #data,rO ;point to filter statesmove #coef,r4 ;point to filter coefficientsmove #2*nsec -1 ,mOmove #4*nsec -1 ,m4move #igain,y1 ;y1 =initial gainopt ccfilter loop: 4*nsec + 9,.*********************************************************************movep y:input,yOmpy yO,y1,a x:(rO) +,xO y:(r4)+,yO;getsample;xO=1st <strong>section</strong> w(n-2),yO=ai2/2do#nsec,end_cellmac -xO,yO,a x:(rO) -,x1 y:(r4) +,yOmacr -x1,yO,a x1 ,x:(rO) + y:(r4) +,yOmac xO,yO,a a,x:(rO)+ y:(r4) +,yOmac x1,yO,a x:(rO) +,xO y:(r4) +,yO;do each <strong>section</strong>;x1 =w(n-1 ),yO=ai1/2;push w(n-1) to w(n-2),yO=bi2/2;push w(n) to w(n-1 ),yO=bi1/2;next iter:xO=w(n-2),yO=ai2/2end_cellrnd a ;round resultmovep a,y:output ;output sample,.****************************************************************************************endFigure 8-3 8-Pole 4-Multiply Cascaded Canonic IIR Filter (Sheet 2 <strong>of</strong> 2)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!