Sign in

username or email:

password:



Not a member?
Forgot your password?

Search compdsp



Search tips

Ads

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGA

Discussion Groups | Comp.DSP | Frame-based processing for fir implementation

There are 2 messages in this thread.

You are currently looking at messages 1 to .


Is this discussion worth a thumbs up?

0

Frame-based processing for fir implementation - Clay - 2012-08-05 21:12:00

Hi,

I'm trying to implement an fir filter but the input does a frame based
processing. I'm having trouble understanding it conceptually. I know we
arrange the new samples of the input in the buffer. We loop through an
outer loop that produces each output sample and an inner loop that does the
MAC. The next part is what confuses me. I know we have to shift the
previous samples back in time, but can anyone tell me how that's done in a
frame base processing? I read somewhere that the number of samples to move
is one less than the number of coefficients in the filter but I don't know
why that's the case. Also, I read that you copy the end of the previous
input samples to the beginning of the new input samples but I don't if or
why that's the case either. 

Any help would be appraciated.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Frame-based processing for fir implementation - Shawn Stevenson - 2012-08-06 12:37:00



>Hi,
>
>I'm trying to implement an fir filter but the input does a frame based
>processing. I'm having trouble understanding it conceptually. I know we
>arrange the new samples of the input in the buffer. We loop through an
>outer loop that produces each output sample and an inner loop that does
the
>MAC. The next part is what confuses me. I know we have to shift the
>previous samples back in time, but can anyone tell me how that's done in
a
>frame base processing? I read somewhere that the number of samples to
move
>is one less than the number of coefficients in the filter but I don't
know
>why that's the case. Also, I read that you copy the end of the previous
>input samples to the beginning of the new input samples but I don't if or
>why that's the case either. 
>
>Any help would be appraciated.
>

Hi Clay,

In frame based processing of an FIR a number of previous input samples need
to be shifted as you have said.  Let's say the N inputs are processed each
block, and the filter length is K.  N + K - 1 samples are required each
frame, where only N of these samples are new. I'll assume all the samples
are arranged in one buffer of size (N+K-1) before starting the outer loop. 
At the beginning of the frame, one needs to copy the N new samples to the
end of the previous (K-1) samples.  Then the filtering is done (your
outer/inner loops).  And finally, the most recent (K-1) samples are copied
to the beginning of the buffer for the start of the next frame.

Why is the number of samples moved K-1? Consider the case where N is 1.  K
samples are needed for the convolution; 1 sample is the new sample and
(K-1) samples are previous ones.

I have some C code online if you are looking for examples of the data
copying:

http://www.dsprelated.com/showcode/42.php

Hope that helps!
Shawn

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.