DSPRelated.com
Forums

IIR filter

Started by aamer June 19, 2008
Hi all,

I implemented IIR lowpass filter on ARM 7 simulator and its taking 21
MIPS. What could be the case with DSP TMS320C6416. Is it true that
TMS320C6416 has inbuilt function for FIR or is it that I have to write the
whole C code (for FIR filter)on TMS320CXX as well.

Any suggestions?

Regards
aamer

aamer wrote:

> Hi all, > > I implemented IIR lowpass filter on ARM 7 simulator and its taking 21 > MIPS.
This can't be right.
> What could be the case with DSP TMS320C6416. Is it true that > TMS320C6416 has inbuilt function for FIR or is it that I have to write the > whole C code (for FIR filter)on TMS320CXX as well.
No slightest clue, huh?
> Any suggestions?
If this is business, hire a consultant. If this is homework, do it yourself. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
aamer schrieb:
> Hi all, > > I implemented IIR lowpass filter on ARM 7 simulator and its taking 21 > MIPS. What could be the case with DSP TMS320C6416. Is it true that > TMS320C6416 has inbuilt function for FIR or is it that I have to write the > whole C code (for FIR filter)on TMS320CXX as well. > > Any suggestions?
Mips is a bad way to measure performance. It's a number based on "instructions per second" but it does not express how many cycles an instruction needs and how much work a single instruction does at the first place. A bad way to measure performance imho. It does not take the architecture or the memory latency (*big* factor) into account. Even worse is to measure performance in megahertz btw. The TMS320C64 does not has a magical IIR-Instruction. But it has lots of instructions that can be used as building-blocks to implement IIR filters in an efficient way. The compiler will in general not use these on it's own because they are to special for the code-generator. To save you from writing assembly these instructions are exposed to you as c-like funcion intrinsics. If you want to use them you will have to rewrite your code. If you want optimal performance you have to learn quite a bit of the architecture and start optimizing on your own. If you otoh need a quick solution to get going take a look at the libraries TI supplies with their compiler. They contain high level filter-loops that are okay. Nils
Vladimir Vassilevsky wrote:
> [much] >
But what would Vlad III say (have said)? ;/
aamer wrote:
> Hi all, > > I implemented IIR lowpass filter on ARM 7 simulator and its taking 21 > MIPS.
Do you mean that the filter takes 21MIPS to execute, or that it takes 21 million instructions? How fast are you iterating it? How big is it? If you're sampling at 21MHz, you've got one efficient filter!
> What could be the case with DSP TMS320C6416.
Different.
> Is it true that > TMS320C6416 has inbuilt function for FIR or is it that I have to write the > whole C code (for FIR filter)on TMS320CXX as well.
Most real DSP processors have MAC instructions that considerably speed up FIR filters (and IIR filters if you use them right). Vendors always give you library functions to implement the FIR filter, and they never work right. So you have to write them. Usually in assembly, although I'm told that some optimizers can recognize a MAC-able algorithm and generate the right assembly. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html