You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
control.matlab.freqresp is inconsistent with MATLAB #573
As pointed out in issue #550, the freqresp function returns magnitude, phase, and frequency instead of the complex frequency response. This is OK for the main package (since you can just evaluate the system itself to get the complex frequency response), but it is inconsistent with MATLAB's freqresp function. At the least, control.matlab.freqresp should be consistent with MATLAB.
Looking through the code, it looks like the freqrespfunction, which is in the lti module, gets imported correctly in the matlab module. (Am not at my computer so haven’t tested this yet). The sys.freqrespmethod, on the other hand, is deprecated in favor ofsys.frequency_response. So I think the problem might only be that it returns the results in the wrong form (mag and phase rather than complex).
Agh. I must have been looking at some different version. I think the problem is not that the function is missing, but that it is inconsistent with MATLAB. Re-editing title and description. Sorry for the confusion.
Hi, I update the control to version 0.9.0. LTI system can be callable. But I want to caculate the freqresp of a FRD system to get the complex frequency response. If there any solution?
Use H(omega*1j) or H.eval(omega) where H is an FRD function. If you want to evaluate at frequencies other than those that define the frequency response, you need to create a smooth FRD object (use frd(d, w, smooth=True)).
Activity
[-]control.matlab.freqresp is inconsistent with MATLAB[/-][+]control.matlab.freqresp is missing in 0.9.0[/+]sawyerbfuller commentedon Mar 16, 2021
Looking through the code, it looks like the
freqrespfunction, which is in theltimodule, gets imported correctly in the matlab module. (Am not at my computer so haven’t tested this yet). Thesys.freqrespmethod, on the other hand, is deprecated in favor ofsys.frequency_response. So I think the problem might only be that it returns the results in the wrong form (mag and phase rather than complex).murrayrm commentedon Mar 16, 2021
Agh. I must have been looking at some different version. I think the problem is not that the function is missing, but that it is inconsistent with MATLAB. Re-editing title and description. Sorry for the confusion.
[-]control.matlab.freqresp is missing in 0.9.0[/-][+]control.matlab.freqresp is inconsistent with MATLAB[/+]JinmingChe commentedon Mar 24, 2021
Hi, I update the control to version 0.9.0. LTI system can be callable. But I want to caculate the freqresp of a FRD system to get the complex frequency response. If there any solution?
murrayrm commentedon Mar 24, 2021
Use
H(omega*1j)orH.eval(omega)whereHis an FRD function. If you want to evaluate at frequencies other than those that define the frequency response, you need to create a smooth FRD object (usefrd(d, w, smooth=True)).