[SciPy-user] problems with signal-functions impulse and step ...

Stef Mientki s.mientki at ru.nl
Sun Apr 15 16:35:12 EDT 2007


I wonder if I'm doing something wrong,
or if the signal library might have has some small bugs.
Do others have the same experience ?

#I create a highpass filter,
#which amplitude and phase characteristic looks good
filt_1 = signal.iirdesign( 0.06, 0.002, 1, 50, 0, 'butter')

# Now when I want to calculate the impuls response,
aa,bb = signal.impulse( filt_1[0], filt_1[1] )

# depending on the IDE I'm using, one of the following happens
#    - I get an error message (which is (yet) above my knowledge of 
Python), see below
#    - the IDE crashes totally
#    - the script stops, without an error message
Traceback (most recent call last):
  File "<string>", line 114, in ?
  File "P:\PROGRA~1\PYTHON\lib\site-packages\scipy\signal\ltisys.py", 
line 470, in impulse
    h[k] = squeeze(dot(dot(C,eA),B))
TypeError: only length-1 arrays can be converted to Python scalars

# creating an LTI-object before calculating impuls or step response
# mostly will return nor error, but just stops execution of the script
LTI_1 = signal.lti( filt_1[0], filt_1[1])
aa,bb = LTI_1.impulse()
aa,bb = LTI_1.step()

thanks for any clarification,
Stef Mientki





More information about the SciPy-User mailing list