[SciPy-user] scipy.signal.chebwin

Ryan May rmay@ou....
Fri Feb 8 22:32:33 CST 2008


Kumar Appaiah wrote:
> On 09/02/2008, Ryan May wrote:
>> Hi,
>>
>> Can anyone attest to the correctness of scipy.signal.chebwin?  I can't
>> get anything but a set of NaN's for any attenuation value greater than
>> 20dB.  Matlab's implementation default's to _100_, but even most
>> examples I'm looking at are in the 50 dB range.
> 
> I can. And the discussion is here:
> http://projects.scipy.org/scipy/scipy/ticket/581
> 

Well, it does help to an extent.  However, what numbers did you use in
your comparison with Matlab?  I'm currently having trouble replicating
my results from matlab. Using:

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

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?

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma


More information about the SciPy-user mailing list