[SciPy-User] Incoherent results with signal.impulse

Cédrick FAURY cedrick.faury at freesbee.fr
Sun Nov 22 14:31:00 EST 2009


>
> >/ 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 ?
> /
>
> 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.
>   
Thank you very much, it works fine now !
Actualy, if i'm right, the solution is to use lsim2 ?

Cédrick



More information about the SciPy-User mailing list