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: Doug Stewart
Subject: Re: Signal: zp2sos and cplxpair problem
Date: Mon, 30 Apr 2012 09:32:42 -0400



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

reply via email to

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