# 1st order filter output

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:

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

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

• [ b0, b1, a0, a1] does it mean that your filter has zeros at b0, b1 and poles at a0, a1. Can you please clarify ? – pulkit Mar 13 '18 at 6:20
• @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. – Peter K. Mar 13 '18 at 14:24

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)


The second filter

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


• So 2nd filter does not work correctly in Matlab either? – Juha P Aug 14 '17 at 17:26
• Why does it work incorrectly? It works correctly for these coefficients. And how did you obtain these coefficients? – Vyacheslav Klimentyev Aug 14 '17 at 18:27
• 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. – Juha P Aug 15 '17 at 6:26