Skip to content

tfAAA error when F_Hz is from high -> low

Created by: jeffwack111

The following short script creates a simple SISO system, calculates a frequency response, then asks tfAAA to do its thing.

from wield.control import SISO, AAA
P = SISO.zpk([],[-10*2*np.pi],1) 
f_Hz = np.geomspace(1000,1,500)        # high->low 
response = P.fresponse(f = f_Hz)
bary = AAA.tfAAA(F_Hz=f_Hz,xfer=response.mag)

this throws the error:

TypeError: len() of unsized object

Given that frequency response data coming from instruments could be in either orientation (low->high or high->low) it would be nice to have tfAAA support both. If not, there could be a helpful error message instructing the user to flip their stuff before calling tfAAA