help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Signal: zp2sos and cplxpair problem


From: Sergei Steshenko
Subject: Re: Signal: zp2sos and cplxpair problem
Date: Mon, 30 Apr 2012 06:49:09 -0700 (PDT)

--- On Mon, 4/30/12, Doug Stewart <address@hidden> wrote:

From: Doug Stewart <address@hidden>
Subject: Re: Signal: zp2sos and cplxpair problem
To: "steven_ew" <address@hidden>
Cc: address@hidden
Date: Monday, April 30, 2012, 6:32 AM



On Mon, Apr 30, 2012 at 7:24 AM, steven_ew <address@hidden> wrote:

Hi



I am new to Octave but quite experience in Matlab. I am trying to get a

script to run that creates and applies a Butterworth filter (it is a script

I have used lots in Matlab).



The key lines are :



bandHz = [100 500];

sampleFreq = 1001;

nyquistFreq = 0.5 * sampleFreq;

w = bandHz / nyquistFreq;

[z,p,k] = butter(2, w);

[sos,g] = zp2sos(z,p,k);



However, when Octave gets to zp2sos it gives this error:



error: cplxpair: could not pair all complex numbers

error: called from:

error:   /usr/local/share/octave/3.6.1/m/general/cplxpair.m at line 126,

column 9

error:   /home/steven/octave/signal-1.1.2/cplxreal.m at line 53, column 7

error:   /home/steven/octave/signal-1.1.2/zp2sos.m at line 70, column 10





I wondered if someone could help me go about fixing this problem or give

some hint about where to start?





Thank you in advance for your help





Steven


Confirmed, I get the same error message. 
The problem is that you are asking for a band pass filter and trying to do it 
with a second order filter.
Try a 4th order filter.
[z,p,k] = butter(4, w);
Doug
-- 
DAS
https://linuxcounter.net/user/206392.html



-----Inline Attachment Follows-----

_______________________________________________
Help-octave mailing list
address@hidden
https://mailman.cae.wisc.edu/listinfo/help-octave

First of all, the error message is not clear.

Secondly, cascaded 1-st order HPF and LPF can form a BPF, though a low Q one. 
And the resulting BPF will be 2-nd order one.

Regards,
  Sergei.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]