0
$\begingroup$

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

enter image description here

enter image description here

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

enter image description here

and also the step response of the filter

enter image description here

$\endgroup$

1 Answer 1

1
$\begingroup$

Is the frequency response I have calculated with the Scilab correct?

Sort of. Your sample rate is 10kHz so your frequency axis should go from 0Hz to 5kHz. Other than that, it looks about right.

What could be said about the filter properties?

Not a whole lot. It's a fairly odd filter. The impulse response looks like a truncated exponential decay with zero mean and large transients at both ends. So it's bit of mixture of a bandpass and a comb filter. It's not something I've seen before.

$\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.