@@ -124,13 +124,22 @@ def __init__(self, *args, **kwargs):
124124 To construct frequency response data for an existing LTI
125125 object, other than an FRD, call FRD(sys, omega).
126126
127+ The timebase for the frequency response can be provided using an
128+ optional third argument or the 'dt' keyword.
129+
127130 """
128- # TODO: discrete-time FRD systems?
129131 smooth = kwargs .pop ('smooth' , False )
130132
131133 #
132134 # Process positional arguments
133135 #
136+ if len (args ) == 3 :
137+ # Discrete time transfer function
138+ if 'dt' in kwargs :
139+ raise TypeError (
140+ "timebase specified as positional argument and keyword" )
141+ kwargs ['dt' ] = args .pop ()
142+
134143 if len (args ) == 2 :
135144 if not isinstance (args [0 ], FRD ) and isinstance (args [0 ], LTI ):
136145 # not an FRD, but still a system, second argument should be
@@ -200,11 +209,11 @@ def __init__(self, *args, **kwargs):
200209
201210 # Process iosys keywords
202211 defaults = {
203- 'inputs' : self .fresp .shape [1 ], 'outputs' : self .fresp .shape [0 ],
204- 'dt' : None }
212+ 'inputs' : self .fresp .shape [1 ], 'outputs' : self .fresp .shape [0 ]}
213+ if arg_dt is not None :
214+ defaults ['dt' ] = arg_dt # choose compatible timebase
205215 name , inputs , outputs , states , dt = _process_iosys_keywords (
206216 kwargs , defaults , end = True )
207- dt = common_timebase (dt , arg_dt ) # choose compatible timebase
208217
209218 # Process signal names
210219 InputOutputSystem .__init__ (
0 commit comments