1
$\begingroup$

I have implemented FIR filter using tapped delay line method. I start getting output as soon as first input sample is passed to it, I am wondering from which sample I will get the proper output(without transient outputs) from filter.

Does it depend on location of highest magnitude tap or it's just dependent on the length of filter.The number of filter coefficients I am using are N(odd) and symmetric. for verifying I took the following filter taps as example :-

$F1$ $=$ $[1 0 0 0 0 0 0];$

$F2$ $=$ $[0 1 0 0 0 0 0];$

$F3$ $=$ $[0 0 1 0 0 0 0];$
and so on,if I pass sine wave using filter coefficients $F1$ then the first sample of the output is itself meaningful but if I use $F2$ and $F3$ then meaningful output is from second and third output samples respectively. I am also wondering how matlab command $filter()$ works.

$\endgroup$

2 Answers 2

2
$\begingroup$

If it's a linear phase FIR filter, then the inputs signals will be shifted (delayed) by an amount of group delay at the output.

For a linear phase FIR filter of length $L = 2K+1$ the group delay will be $N = K$ samples. For even length $L = 2K$ FIR filters it will be at $N = (L-1)/2$ ; half-sample position.

For non-linear phase FIR filters, group delay will be dependent on the specific frequency of the applied input signals. It should be computed from

$$ \tau = - \frac{d \phi(\omega)}{d\omega} $$

where $\phi(\omega)$ is the phase response of the filter.

The matlab function filter(b,a,x) computes all the samples begining up to input signal length. So the first samples are transients.

$\endgroup$
1
$\begingroup$

It depends on what you mean by "meaningful". All outputs are meaningful in the sense that they combine the current input value with past input values. Initially, there are of course no past input samples. But if you agree that "no past samples" means "past samples with value zero" then that's exactly what happens if the delay elements are initialized with zeros. It is also possible to initialize the delay elements with any other values if that is more meaningful for a given application.

Matlab's filter routine just implements a direct form-II transposed structure of a filter with a rational transfer function (generally IIR, but FIR is a special case). By default, the delay elements are initialized with zeros, but it is possible to supply other initial conditions.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.