Skip to content

control.matlab.freqresp is inconsistent with MATLAB #573

Description

@murrayrm

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.

See discussion in PR #449 and issue #434.

Activity

  1. changed the title [-]control.matlab.freqresp is inconsistent with MATLAB[/-] [+]control.matlab.freqresp is missing in 0.9.0[/+] on Mar 16, 2021
  2. sawyerbfuller commented on Mar 16, 2021

    @sawyerbfuller
    Contributor

    Looking through the code, it looks like the freqresp function, 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.freqresp method, 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).

  3. murrayrm commented on Mar 16, 2021

    @murrayrm
    MemberAuthor

    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.

  4. changed the title [-]control.matlab.freqresp is missing in 0.9.0[/-] [+]control.matlab.freqresp is inconsistent with MATLAB[/+] on Mar 16, 2021
  5. JinmingChe commented on Mar 24, 2021

    @JinmingChe

    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?

  6. murrayrm commented on Mar 24, 2021

    @murrayrm
    MemberAuthor

    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)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions