[SciPy-user] scipy.signal.chebwin

Kumar Appaiah akumar@iitm.ac...
Sat Feb 9 00:46:04 CST 2008


On Fri, Feb 08, 2008 at 10:32:33PM -0600, Ryan May wrote:
> chebwin(34,40)
> 
> I get:
> 
> array([ 0.15091791,  0.12635953,  0.17403453,  0.22943129,  0.29196621,
>         0.36068193,  0.43425971,  0.51105165,  0.58912968,  0.66634529,
>         0.74039742,  0.80892035,  0.86961657,  0.92043888,  0.95976796,
>         0.98649886,  1.        ,  1.        ,  0.98649886,  0.95976796,
>         0.92043888,  0.86961657,  0.80892035,  0.74039742,  0.66634529,
>         0.58912968,  0.51105165,  0.43425971,  0.36068193,  0.29196621,
>         0.22943129,  0.17403453,  0.12635953,  0.15091791])
> 
> But with matlab I get:
> 
> ans =
>     0.1494    0.1249    0.1724    0.2276    0.2899
>     0.3584    0.4316    0.5081    0.5859    0.6629
>     0.7368    0.8053    0.8664    0.9180    0.9583
>     0.9859    1.0000    1.0000    0.9859    0.9583
>     0.9180    0.8664    0.8053    0.7368    0.6629
>     0.5859    0.5081    0.4316    0.3584    0.2899
>     0.2276    0.1724    0.1249    0.1494

I get this:
[kumar@debian ~] python chebwin.py
[ 0.14490233  0.12074828  0.16763814  0.22212255  0.28362753 0.35121151
  0.42357774  0.49910747  0.5759161   0.65194005  0.72506923 0.7933214
  0.85497322  0.90847191  0.95205773  0.98342321  1.          1.
  0.98342321  0.95205773  0.90847191  0.85497322  0.7933214  0.72506923
  0.65194005  0.5759161   0.49910747  0.42357774  0.35121151 0.28362753
  0.22212255  0.16763814  0.12074828  0.14490233]

There is something wrong.

> But more problematic, here's what I get for chebwin(53,40) (trying to
> replicate a book figure):
> 
> array([-0.16010146, -0.16010146, -0.16010146, -0.16010146, -0.16010146,
>        -0.16010147, -0.16010148, -0.16010149, -0.1601015 , -0.1601015 ,
>        -0.16010145, -0.16010096, -0.16009716, -0.16007336, -0.15994973,
>        -0.15941238, -0.15743963, -0.15127378, -0.13476733, -0.09676449,
>        -0.02138783,  0.10725105,  0.29505955,  0.52638443,  0.7591664 ,
>         0.93452305,  1.        ,  0.93452305,  0.7591664 ,  0.52638443,
>         0.29505955,  0.10725105, -0.02138783, -0.09676449, -0.13476733,
>        -0.15127378, -0.15743963, -0.15941238, -0.15994973, -0.16007336,
>        -0.16009716, -0.16010096, -0.16010145, -0.1601015 , -0.1601015 ,
>        -0.16010149, -0.16010148, -0.16010147, -0.16010146, -0.16010146,
>        -0.16010146, -0.16010146, -0.16010146])
> 
> Clearly, all of those negative values are *not* correct.  (And the
> problems are not limited to the numbers above.)  Any ideas?

Let me try to figure it out. Then I'll let you know.

Thanks.

Kumar
-- 
Kumar Appaiah,
458, Jamuna Hostel,
Indian Institute of Technology Madras,
Chennai - 600 036


More information about the SciPy-user mailing list