Harmonic Analyzer
Analyze and plot harmonic spectrum of Simscape logging nodes
Description
The Harmonic Analyzer app calculates the harmonic orders, magnitudes,
and fundamental frequency of a simscape.logging.Node
of an AC or periodic
variable and plots a bar chart of the percentage of fundamental magnitude versus harmonic
order.
The Harmonic Analyzer app allows you to:
Import the simulation data of a model stored in a
simscape.logging.Node
variable.Analyze and plot the harmonic spectrum of the selected
simscape.logging.Node
object.Export the data in MATLAB® as a script or a function.
The app finds the points in the selected leaf node, or a node at the very end of the tree navigation, where the Simscape™ log crosses a threshold specified by the DC offset parameter. It then uses the crossing points to find the required number of periods, specified by the Number of periods parameter, preceding the value specified by the Simulation time (s) parameter. Finally it inputs the selected data to the Goertzel algorithm, which calculates the harmonic magnitudes up to the value in the Harmonic order parameter.
Open the Harmonic Analyzer App
To open the app, at the MATLAB Command Window, enter: ee_HarmonicAnalyzer
.
Parameters
Number of periods
— Number of periods
10
(default) | positive scalar
Number of periods of fundamental frequency in the harmonic analysis. The value of this parameter also affects the size of the panner box in the Signal Plot tab.
DC offset
— Input DC offset
0
(default) | positive scalar
DC offset in the input signal. The app uses this value to find the periods of interest.
Harmonic order
— Number of harmonics
20
(default) | positive scalar
Number of harmonics to include in the analysis.
Simulation time (s)
— Simulation time of interest
positive double
Time of the last period panned to compute the harmonic spectrum. The final permissible simulation time is equal to the simulation time specified in the model.
Limitations
The Harmonic Analyzer app does not support simscape.logging.Node
objects generated by variable step size models.
Version History
Introduced in R2022a