Hi All,

The function zp2sos in Signals always returns 1.0 for the gain of the second 
order sections. This isn't very useful. I believe it should return the gain 
factor to make the cascade of second order sections equal to the input filter 
which is in the form [zeros poles gain]. Indeed, this is the behavior described 
for the Matlab version at
http://www.mathworks.com/help/toolbox/signal/ref/zp2sos.html.

An example that shows the problem is simply to convert a second order filter in 
z-p-g form to a single second order section:


octave-3.4.0:1> [b,a] = butter(2, 0.2) 
b =

   0.067455   0.134911   0.067455

a =

   1.00000  -1.14298   0.41280

octave-3.4.0:2> [z, p, g] = butter(2, 0.2)
z =

  -1  -1

p =

   0.57149 + 0.29360i   0.57149 - 0.29360i

g =  0.067455
octave-3.4.0:3> [sos, sos_g] = zp2sos(z', p')
sos =
e
   1.00000   2.00000   1.00000   1.00000  -1.14298   0.41280

sos_g =  1 >>>>> Should be 0.067455 <<<<<<


The filter from the first input line should be the same as from the last input 
line but it differs in the gain factor. This is easy to fix but as it is the 
user has to do it.

On two related matters, the Octave documentation for zp2sos, 
http://octave.sourceforge.net/signal/function/zp2sos.html, states that the 
arguments to zp2sos should be column vectors but using either column or row 
vectors results in the same answer.

Also, on the same doc page, a quantity called Bscale is mentioned, but only 
once; it does not reference anything on the page. This should also be fixed. It 
probably refers to g but g is incorrect as noted above.

I suppose the functions mentioned in the "See also" should be checked for 
similar problems.

Jerry
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
Octave-dev mailing list
Octave-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to