AnsweredAssumed Answered

High Pass Filter problem

Question asked by Kirill on Jun 15, 2011
Latest reply on Aug 2, 2011 by Mitesh

Hello! I need to design IIR High Pass Filter on ADSP 21xx. My coefficients are: Numerator is 0.035; -0.175; 0.351; -0.351; 0.175; -0.035. Denominator is 1; 0.483; 0.715; 0.169; 0.068; 0.004. Can you help me debug my program? Where is a error? Thank you for your attention!

My listing is:

 

#define n 5
#define z_out 0x700

.section/data     data1;
.VAR               x_input[z_out+n] = "xin.dat";
.VAR               x_output[z_out+n];

.section/pm       pm_da;
.VAR            y_input[2*n+1] = "bix.dat";

.section/pm interrupts;                         /*------Interrupt vector table------*/
__reset: JUMP start; nop; nop; nop;           /* 0x0000: Reset vector*/
RTI; nop; nop; nop;                                   /* 0x0004: IRQ2*/
RTI; nop; nop; nop;                                   /* 0x0008: IRQL1*/
RTI; nop; nop; nop;                                   /* 0x000C: IRQL0*/
RTI; nop; nop; nop;                                   /* 0x0010: SPORT0 transmit*/
RTI; nop; nop; nop;                                   /* 0x0014: SPORT0 receive*/
RTI; nop; nop; nop;                                   /* 0x0018: IRQE*/
RTI; nop; nop; nop;                                   /* 0x001C: BDMA*/
RTI; nop; nop; nop;                                   /* 0x0020: SPORT1 transmit*/
RTI; nop; nop; nop;                                   /* 0x0024: SPORT1 receive*/
RTI; nop; nop; nop;                                   /* 0x0028: Timer*/
RTI; nop; nop; nop;                                   /* 0x002C: Power down*/


.section/pm program;
start:  I1=x_input+n;     /*pointer to x input buffer*/
I2=x_output;
I4=y_input;     /*pointer to y input buffer*/
M0 = 1;
M1 = -1;
M5 = 1;
L0 = 0;
L1 = 0;
L2 = 0;
L4 = 2*n+1;
SE = 4;
AX0 = 0;
CNTR = n;
DO     goclr     UNTIL     CE;
goclr:  DM(I2,M0) = AX0;
CNTR = z_out;
DO     go     UNTIL     CE;
I0=I1;
CNTR = n;
MR = 0,   MX0 = DM(I0,M1),   MY0 = PM( I4 , M5 );
DO   sop1  UNTIL   CE;
sop1 :     MR=MR+MX0*MY0(SS), MX0=DM(I0,M1), MY0=PM(I4,M5);
MR=MR+MX0*MY0(SS);
I0=I2;
MX0 = DM(I0,M1);
CNTR = n-1;
MX0 = DM(I0,M1),   MY0 = PM( I4 , M5 );
DO   sop2  UNTIL   CE;
sop2 :     MR=MR+MX0*MY0(SS), MX0=DM(I0,M1), MY0=PM(I4,M5);
MR=MR+MX0*MY0(SS);
IF MV SAT MR;
SR = LSHIFT MR0(LO);
SR = SR OR ASHIFT MR1(HI);
DM(I2,M0)=SR1;
go:          MODIFY(I1,M0);
IDLE;



 

Attachments

Outcomes