Estimate Frequency Response (MATLAB Code)


  1. Use linearization I/O points to specify input and output points for frequency response estimation.


    io(1) = linio('scdplane/Sum1',1)
    io(2) = linio('scdplane/Gain5',1,'output')

      Caution   Avoid placing I/O points on bus signals.

    For more information about linearization I/O points, see Specify Model Portion to Linearize and the linio reference page.

  2. Identify all source blocks that generate time-varying signals in the signal path of the linearization outputs. Such time-varying signals can interfere with the signal at the linearization output points and produce inaccurate estimation results.

    1. First, use frest.findSources to identify time-varying source blocks that can interfere with estimation. frest.findSources finds all time-varying source blocks in the signal path of the linearization output points.


      Identify the time-varying source blocks in the scdplane model:

      srcblks = frest.findSources('scdplane',io); 
    2. Next, to disable these blocks during estimation, use frestimateOptions.

      For example:

      opts = frestimateOptions;
      opts.BlocksToHoldConstant = srcblks;

    For more information, see the frest.findSources and frestimateOptions reference pages.

  3. Estimate the frequency response.


    [sysest,simout] = frestimate('scdplane',io,input,opts);

    sysest is the estimated frequency response. simout is the simulated output that is a Simulink.Timeseries object.

    For more information about syntax and argument descriptions, see the frestimate reference page.

  4. Open the Simulation Results Viewer to analyze the estimated frequency response. For example:


    You can compare the estimated frequency response (sysest) to a system you linearized using exact linearization (sys):


    For more information, see Analyzing Estimated Frequency Response.

Was this topic helpful?