i am implementing a traditional IIR filter of this kind:
accum1=(*i_o * coefvect) + (coefvect* dline) + (coefvect*dline);
accum1= accum1 >> scalefactor; //scaling
accum2=(accum1 * coefvect)+ (coefvect*dline) + (coefvect*dline);
accum2=accum2 >> scalefactor; //scaling
dline=dline; //move delay line
*i_o=(accum2 >> 1); //output
all registers, coefficients and buffers are 32 bits long integer types.
i acquire 1024 samples from the ADC and i then pass the buffer to the
filter. The filter executes in 3mS (obviously this is the time it takes
to process 1024 samples, not just one) and i am wondering why it seems
to take so long to compute; i was expecting something better.
I am using the AT91SAM7S-EK adapting an example of GCC-Winarm for this
board. The clock seems to be 48MHz internally multiplied (i haven't
changed any other parameter in microcontroller configuration or board
I also tried to vary the optimization level (original was Os, i tried
and to move the IIR filter into an external module compiled with ARM
(not thumb) instructions.
The only differences i noted changing these parameters, were slight
differences in the final size of the compiled file: the filter execution
speed remained practically always the same.
My question is this: are there any methods to speed up execution?
Have i to struggle coding the filter part in assembler or it is not
a good deal? I should, at least, halve the execution speed.
I see that there is an mp3 player project based on this microcontroller,
so i think that if it can handle the burden of decoding an mp3 stream
it should be able to compute a simple iir biquad.
I close saying that i am an absolute beginner with ARMs and Winarm,
and i would thank in advance anyone who 'll answer.