DSPRelated.com
Forums

Re: iir filter implementation

Started by boon...@yahoo.com December 17, 2008
hai,
>
> iam trying to implement the iir filter on adsp21369 ezkit.the sampling rateis 48khz.
> i have implemented the filter using second order sections
> w[n]=x[n]+a1*w[n-1]+a2*w[n-2];
> y[n]=w[n]+b1*w[n-1]+b2*w[n-2];
>
> i have followed the example stereo cascade iir filter present in the analog devices website.but it is not working.
> iam having doubt in the length of delayline.
> please help me in implementing the iir filter.
>
>---------------------------------
> Here�s a new way to find what you're looking for - Yahoo! Answers
>
Hi All,
I'm using the same sharc(21369). Implement an IIR with Biquad direct form 1 in C, the FFT result of the filtered signal shown there are noise at low frequency. Based on what i read from some article that could be due to the pole close to unit cirlce or some roundoff issue. Does any one how to resolve this? Thanks.
BC
Hi,
can anybody tell me how to calculate the MIBS in 2191???
How do i find the total time required for execution,when i call some subroutine?????
Hello Shyam,

For any processor you can estimate the time by counting clock cycles and
multiply the the time per clock. If there are only a few instructions,
this is fairly accurate.

Another way is to read a counter which has an accurate timebase before and
after you call a subroutine. For long subroutines this is pretty accurate
as well.

Usually you have to set up a special test section to do this, many
applications don't need an accurate time base, just a relative one. In
some cases a percentage of the total time is also a useful number to get.
If you read a counter at several points you can get an idea of elaspsed
counts, then multiply by the time per count, then take differences for
each point in your code.

Patience, persistence, truth,
Dr. mike

On Wed, 24 Dec 2008, shyam sundar wrote:

>
> Hi,
> can anybody tell me how to calculate the MIBS in 2191???
> How do i find the total time required for execution,when i call some subroutine?????
I have small subroutine,for which i need to calculate the MIPS.(MIBS and MIPS are they different??)
How to find the number of cycles taken by each instruction???
Does finding the number of cycles help in finding out the MIPS???
I am using ADSP 2191 processor!!
Can you use the following subroutine for explaining??
Thanks in advance :)

Copy_from_TPC_OUT:


i2=dm(TEMP_TPC_outReadPtr);
l2=length(TEMP_TPC_OUT);
ar=TEMP_TPC_OUT;
reg(b2) = ar;
m2=1;

i3=dm(output_wr_ptr);
l3=length(output);
ar=output;
reg(b3) = ar;
m3=1;

ar=0;
dm(counter_8)=ar;

Copy_data:
ar=dm(i2,1);
dm(i3,m1)=ar;


ar = dm(bytes_sent);
ar= ar+1;
dm(bytes_sent)= ar;
if ne jump byte_cnt;

ar = dm(bytes_sent+1);
ar= ar+1;
dm(bytes_sent+1)= ar;
if ne jump byte_cnt;

ar = dm(bytes_sent+2);
ar= ar+1;
dm(bytes_sent+2)= ar;

byte_cnt : nop;

ar = dm(counter_8);
ar = ar + 1;
dm(counter_8) = ar;
ax0 = 8;
ar = ar - ax0;
if ne jump Copy_data;
nop;
dm(TEMP_TPC_outReadPtr)=i2;
ar=0;
reg(b2)=ar;
l2=0;

reg(b3)=ar;
l3=0;
m3=0;

rts;

--- On Sun, 12/28/08, Mike Rosing wrote:
From: Mike Rosing
Subject: Re: [adsp] How to calculate mibs????
To: "shyam sundar"
Cc: a...
Date: Sunday, December 28, 2008, 2:41 AM

Hello Shyam,

For any processor you can estimate the time by counting clock cycles and

multiply the the time per clock. If there are only a few instructions,

this is fairly accurate.

Another way is to read a counter which has an accurate timebase before and

after you call a subroutine. For long subroutines this is pretty accurate

as well.

Usually you have to set up a special test section to do this, many

applications don't need an accurate time base, just a relative one. In

some cases a percentage of the total time is also a useful number to get.

If you read a counter at several points you can get an idea of elaspsed

counts, then multiply by the time per count, then take differences for

each point in your code.

Patience, persistence, truth,

Dr. mike

On Wed, 24 Dec 2008, shyam sundar wrote:

>

> Hi,

> can anybody tell me how to calculate the MIBS in 2191???

> How do i find the total time required for execution,when i call some subroutine?? ???

>

>

>

>
On Sat, 3 Jan 2009, shyam sundar wrote:

> I have small subroutine,for which i need to calculate the MIPS.(MIBS and MIPS are they different??)

MIPS == Million Instructions Per Second

> How to find the number of cycles taken by each instruction???

From the processor manual. There is a list of instruction base clocks,
and you have to add in the addressing mode clocks. If there are external
addresses than you have to add in wait states as well.

> Does finding the number of cycles help in finding out the MIPS???

Yes. If you have a process that takes 100 cycles and your clock speed is
100 MHz then you can do 1 million of those processes per second.
Sometimes that is called a "MIPS" as well, but it seems kind of confusing
to me.

> I am using ADSP 2191 processor!!
> Can you use the following subroutine for explaining??
> Thanks in advance :)
>
> Copy_from_TPC_OUT:
>
>
> i2=dm(TEMP_TPC_outReadPtr);
> l2=length(TEMP_TPC_OUT);
> ar=TEMP_TPC_OUT;
> reg(b2) = ar;
> m2=1;
>
> i3=dm(output_wr_ptr);
> l3=length(output);
> ar=output;
> reg(b3) = ar;
> m3=1;
>
> ar=0;
> dm(counter_8)=ar;
>

You'll have to look it up in the manual. But if you setup a counter to
run at the full clock speed of the processor, just read the counter at the
start and end of the routine and you can tell from the difference how many
clock cycles were used. This is more accurate anyway since it
automatically accounts for external wait states.

Patience, persistence, truth,
Dr. mike