I have some confusion about the terminologies and simulation of an FIR system. I shall appreciate help in rectifying my mistakes and informing what is correct.
Assuming a FIR filter with coefficient array A=[1,c2,c3,c4]
. The number of elements are L
so the length of the filter L
but the order is L-1
.
Confusion1: Is the intercept 1
considered as a coefficient? Is it always 1?
Confusion2: Is my understanding correct that for the given example the length L= 4
and order=3
?
Confusion3: Mathematically, I can write it as:
where u
is the input data and l
starts from zero. Then to simulate the above equation I have done the following convolution. Is it correct?:
N =100; %number of data
A = [1, 0.1, -0.5, 0.62];
u = rand(1,N);
x(1) = 0.0;
x(2) = 0.0;
x(3) = 0.0;
x(4) = 0.0;
for n = 5:N
x(n) = A(1)*u(n) + A(2)*u(n-1)+ A(3)*u(n-3)+ A(4)*u(n-4);
end