[SciPy-User] Incoherent results with signal.impulse

Warren Weckesser warren.weckesser@enthought....
Sun Nov 22 12:59:09 CST 2009


Cédrick FAURY wrote:
> Hello,
>
> I have scipy 0.7.1, python 2.6, and when I do :
>
> n = scipy.array([1])
> d = scipy.array([0.01, 0.2, 1.0])
> T, yout = scipy.signal.impulse((n,d))
>
> it gives incoherent results for yout.
>
> And that doesn't occurs with [1.0, 2.0, 1.0] denominator.
>
> Is it a bug ?
> I'm doing something wrong ?
> Is anybody knows a solution ?

Hi Cédrick,

scipy.signal.impulse assumes that the state matrix A is diagonalizable, 
so it does not give a correct result when A is defective.  I would call 
that a bug. :)

The attached file contains the function impulse_response() that uses a 
different method to compute the impulse response.  If run as a script, 
the code at the bottom of the file plots impulse responses computed by 
impulse_response() and by scipy.signal.impulse() for your example, and 
for two other values of the leading coefficient of your denominator.


Warren
 

> Thanks by advance
>
> Cédrick FAURY
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
>   

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: impulse_response.py
Url: http://mail.scipy.org/pipermail/scipy-user/attachments/20091122/95e58aeb/attachment.pl 


More information about the SciPy-User mailing list