0
$\begingroup$

Two 1st order filters :

--[ b0, b1, a0, a1]
1 [ -1.40374673978609e+008 1.40374675978609e+008 1 1.000000235752411 ]
2 [ 2.22044577169459e-016 2.22044632680604e-016 1 -1 ]

gives these responses in Octave:

enter image description here

When using those same coefficients (in parallel order or even just one set of them) in another software I get different results. Example:

enter image description here

Magnitude response isn't a problem (unless not 'flat' in range 20Hz-20kHz) but the phase response is 180° even when implement only one of those filters. Shouldn't phase be 90° as it is in Octave plot.

Q1: is it just because of the transfer function (1st order (Octave) vs biquad (other software)) or is there something else beind this difference?
Q2: is it possible to plot these two filters as parallel system in Octave/MatLab

$\endgroup$
  • $\begingroup$ [ b0, b1, a0, a1] does it mean that your filter has zeros at b0, b1 and poles at a0, a1. Can you please clarify ? $\endgroup$ – pulkit Mar 13 '18 at 6:20
  • $\begingroup$ @pulkit Welcome to SE.DSP! Please do not enter comments as answers. Please earn enough rep to comment by answering questions or proposing edits to existing questions and answers. $\endgroup$ – Peter K. Mar 13 '18 at 14:24
0
$\begingroup$

Matlab results.

The filters coefficients have a big dynamic variation. So you have those results. For second filter, coefficients b are about zeros.

The first filter

b = [-1.40374673978609e+008 1.40374675978609e+008];
a = [1 1.000000235752411];
freqz(b, a)

enter image description here

The second filter

b = [2.22044577169459e-016 2.22044632680604e-016];
a = [1 -1];
freqz(b, a)

enter image description here

$\endgroup$
  • $\begingroup$ So 2nd filter does not work correctly in Matlab either? $\endgroup$ – Juha P Aug 14 '17 at 17:26
  • $\begingroup$ Why does it work incorrectly? It works correctly for these coefficients. And how did you obtain these coefficients? $\endgroup$ – Vyacheslav Klimentyev Aug 14 '17 at 18:27
  • $\begingroup$ Hmm... even no phase data for 2nd ... shouldn't there be? Actually, I'm trying to achieve Hilbert ... . How I obtained those coefficients ... prepared two 1st order all pass filters using BLT and tweaked a bit (don't laugh) inline g = tan(pi*(Fc/Fs)); b0 = div*((g-1)/(g+1)); b1 = div*1; b2 = 0; a1 = b0; a2 = 0; where div=-1.00000025, Fs=Fs*1000... and Fc=0.1 (Hz) for the 1st filter, Fs=Fs/2... and Fc=Fs (Hz) for the 2nd filter. $\endgroup$ – Juha P Aug 15 '17 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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