# Identification of properties of a given FIR filter

I have a FIR filter which is described via following transfer function

$$H(z) = h(0) + h(1)\cdot z^{-1} + h(1)\cdot z^{-2} + \ldots + h(23)\cdot z^{-23},$$ where the coefficients have below given values:

$$\begin{eqnarray} h(0) &=& 1.192308e-002 \\ h(1) &=& 1.055184e-002 \\ h(2) &=& 9.226209e-003 \\ h(3) &=& 7.946184e-003 \\ h(4) &=& 6.711766e-003 \\ h(5) &=& 5.522955e-003 \\ h(6) &=& 4.379751e-003 \\ h(7) &=& 3.282153e-003 \\ h(8) &=& 2.230161e-003 \\ h(9) &=& 1.223776e-003 \\ h(10) &=& 2.629979e-004 \\ h(11) &=& -6.521739e-004 \\ h(12) &=& -1.521739e-003 \\ h(13) &=& -2.345698e-003 \\ h(14) &=& -3.12405e-003 \\ h(15) &=& -3.856795e-003 \\ h(16) &=& -4.543934e-003 \\ h(17) &=& -5.185467e-003 \\ h(18) &=& -5.781393e-003 \\ h(19) &=& -6.331712e-003 \\ h(20) &=& -6.836424e-003 \\ h(21) &=& -7.295531e-003 \\ h(22) &=& -7.70903e-003 \\ h(23) &=& -8.076923e-003 \end{eqnarray}$$

The sampling period is $$T_s = 100\,\mu\mathrm{s}$$. I was curious what are the properties of this filter. Unfortunately I don't have the Matlab software so I have taken its free of charge counterpart called Scilab and I have written following script for examining the frequency response of the filter

// coefficients of the transfer function polynomial
B = [1.192308e-002, 1.055184e-002, 9.226209e-003, 7.946184e-003, 6.711766e-003, 5.522955e-003, 4.379751e-003, 3.282153e-003, 2.230161e-003, 1.223776e-003, 2.629979e-004, -6.521739e-004, -1.521739e-003, -2.345698e-003, -3.12405e-003, -3.856795e-003, -4.543934e-003, -5.185467e-003, -5.781393e-003, -6.331712e-003, -6.836424e-003, -7.295531e-003, -7.70903e-003, -8.076923e-003];

// transfer function in the z^-1
h_invz = poly(B, 'invz', 'c');

// relative frequencies - w*k*Ts = 2*pi*f/fs*k, maximum frequency is f = fs/2
// fr_max = f_max/fs = 0.5
fr = (0:0.0001:0.5);

// complex frequency response (transfer function in z^(-1))
// z = exp(s*T) = exp([sigma + j*omega]*T)
hf = freq(h_invz, 1, exp(-%i*2*%pi*fr));

// magnitude
magnitude = abs(hf);

// phase
hf_imag = imag(hf);
hf_real = real(hf);
phase = atan(hf_imag, hf_real);

scf();
plot(fr, magnitude);
title('Magnitude');
xlabel('$$f_r = \frac{f}{f_s}$$');
ylabel('$$Mag(H(z))$$');
xgrid;
scf();
plot(fr, phase);
title('Phase');
xlabel('$$f_r = \frac{f}{f_s}$$');
ylabel('$$Arg(H(z))\,[\mathrm{rad}]$$');
xgrid;

The output of my script is following

I have basically two questions:

1. Is the frequency response I have calculated with the Scilab correct?
2. What could be said about the filter properties?

EDIT:

I have extended my Scilab script and I have analyzed the time domain behavior. Namely I have evaluated the impulse response of the filter

and also the step response of the filter