FPGA Intellectual Property
PCI Express*, Networking and Connectivity, Memory Interfaces, DSP IP, and Video IP
6352 Discussions

Question about FIR filter outputs

Altera_Forum
Honored Contributor II
1,398 Views

Hi, 

 

I designed FIR filter and I try to undestand why the number of output samples is different from the input? It lacks 2-3 samples. 

Thank you for your help.
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
280 Views

How do you do the counting? hopefully not by fingers... 

 

Every filter output needs initial time to settle. 

the internal delay line(same as number of taps) have to be filled up first. The output will only be correct after this delay line is full.  

 

just in case, groupdelay of FIR is order/2 and is a different concept.
0 Kudos
Altera_Forum
Honored Contributor II
280 Views

On each rising edge of ast_source_valid (enable output), I write the result in file. 

 

ex: I have a FIR filter with 16 coefficients. 5000 input samples with an enable => 4997 output samples. Why 3 missing samples? 

 

If I want all my samples out, how do I do? I find nothing about it in the documentation. 

 

Thanks
0 Kudos
Altera_Forum
Honored Contributor II
280 Views

I don't use fir compilers or simulink. I guess your enable signal doesn't go high until after few clks. 

 

I don't think you should worry about it if that is the case. In many designs we don't care about startup functionality as long as things will soon settle. 

 

Check the filtering itself. apply fft in Matlab to your output/input and see the response and check if it matches the function freqz(taps)
0 Kudos
Altera_Forum
Honored Contributor II
280 Views

Why are you worried about 3 missing outputs? They're probably gone forever because of latency. Also, are you using the avalon data out valid signal as your "data valid" signal or just sampling it according to your data in side, if you are that's a no no? :) I bet if you run 10000 inputs you'll get 9997. I tend to look at the streaming data anyway in signaltap. The first n samples out of an n stage FIR will be invalid carp data anyway. Why not run 10000 samples through and grab the most recent 5000? or at least give time for your fir n data stages to fill up. Put an impulse through it and see if that helps to determine the problem.

0 Kudos
Altera_Forum
Honored Contributor II
280 Views

A couple of them probably got stuck in the Avalon ST FIFO. I ran into that problem a couple versions ago (haven't checked the latest version yet, so can't be sure). If it's really a big deal for you, just zero pad your original input a little bit.

0 Kudos
Reply