View Single Post
  #4   Report Post  
Old January 17th 05, 08:40 AM
Paul Keinanen
 
Posts: n/a
Default

On Sun, 16 Jan 2005 15:36:09 -0800, Tim Wescott
wrote:

You could also do this by coding up the digital filters using only
shifts. This is not for the faint of heart if you haven't done DSP
before, but it can be done and should get you fairly good results.


With FIR filters and 100-200 bytes of RAM, the shifting needs to be
done only once when the sample arrives, by saving each intermediate
value after each shift into a table. When the next sample arrives, the
old sample table (instead of the original sample value only) is
shifted into the next position (tap) of the FIR. This shifting can be
done either by block copying or pointer arithmetics.

Since all taps in the FIR have access to all shifted versions of the
corresponding sample, all that needs to be done, is adding together
those values selected by the coefficient multiplier.

If the tap multipliers are constant and there are sufficiently ROM to
have a separate routine for each tap, the elements selected are known
at compile time, so you do not have to shift and test the multiplier.
Assuming the original sample value is in Shifted[0] and the left
shifted values in Shifted[1..7] and the sample value needs to be
multiplied e.g. by 19 (00010011) the multiply by 19 routine would be
similar to

Mul_19:

Add Shifted[0]
Add Shifted[1]
Add Shifted[4]
return

Thus,even if the processor lacks the multiply instruction, you only
need to make on average 4 additions (for 8 bit multipliers) at each
tap. However, the additions must be 16 bit wide for 8 bit samples and
coefficients.

Paul OH3LWR