Selected Frequency Amplitude
R2026bSelected Frequency Amplitude block

To add a block to a model, double-click the canvas and start typing the block name. Then, select the block from the list.
Libraries:
Power Converter Control with Motor Control Blockset /
Measurement
Description
The Selected Frequency Amplitude block measures the amplitude or power of a time-domain signal at a specified harmonic order of the fundamental frequency. Use this block to extract the magnitude of individual harmonic components from a periodic signal, such as for total harmonic distortion analysis or selective harmonic filtering. You can configure the harmonic order, measurement mode, and whether the block outputs the amplitude or signal power at that frequency.
Ports
Input
Input signal to analyze, specified as a scalar. The block extracts the amplitude or power at the selected harmonic frequency from this signal.
Data Types: single | double
Reset trigger signal, specified as a scalar. A rising edge on this port resets the measurement window.
Dependencies
To enable this port, set Measurement mode to Moving window (default).
Data Types: single | double | Boolean
Fundamental frequency input signal, specified as a positive scalar in Hz. The block uses this frequency and the harmonic order to determine the target measurement frequency.
Dependencies
To enable this port, set Fundamental input frequency type to Input port.
Data Types: single | double
Measurement restart trigger signal, specified as a scalar. A rising edge on this port restarts the fixed-window measurement cycle.
Dependencies
To enable this port, set Measurement mode to Fixed window.
Data Types: single | double | Boolean
Output
Amplitude at the selected harmonic frequency, returned as a scalar.
Dependencies
To enable this port, set Block output to Amplitude (default).
Data Types: single | double
Power at the selected harmonic frequency, returned as a scalar.
Dependencies
To enable this port, set Block output to Power.
Data Types: single | double
Measurement window completion status, returned as a scalar. The signal indicates whether the fixed-window measurement cycle is complete.
Dependencies
To enable this port, set Measurement mode to Fixed window.
Data Types: single | double | Boolean
Parameters
To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.
Type of measurement output. Select Amplitude to output the signal amplitude at the selected harmonic frequency. Select Power to output the signal power at that frequency.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | BlkOutput |
| Values: | "Amplitude" (default) | "Power" |
Example: set_param(gcb,"BlkOutput","Power")
Simulation discrete sample time, specified in seconds. This value determines how often the block executes and updates the measurement output. Set this to match the fixed-step solver step size of your model. A smaller value increases measurement resolution but adds computational cost.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | BlkSampleTime |
| Values: | "50e-6" (default) | positive scalar in quotes |
| Data Types: | char | string |
Example: set_param(gcb,"BlkSampleTime","100e-6")
Source for the fundamental frequency value. Select Specify via dialog to use the Fundamental frequency value (Hz), f₁ parameter. Select Input port to supply the fundamental frequency from an input port.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | InputFrequencyType |
| Values: | "Specify via dialog" (default) | "Input port" |
Example: set_param(gcb,"InputFrequencyType","Input port")
Fundamental frequency of the input signal, specified in Hz. The block computes the measurement at the harmonic frequency k * f₁, where k is the harmonic order. For a 50 Hz grid, set this to 50; for a 60 Hz grid, set this to 60. The measurement window spans one complete cycle at this frequency.
Dependencies
This parameter is visible when Fundamental input frequency type is set to Specify via dialog.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | FundamentalFrequency |
| Values: | "50" (default) | positive scalar in quotes |
| Data Types: | char | string |
Example: set_param(gcb,"FundamentalFrequency","60")
Harmonic order at which to measure, specified as a positive integer. A value of 1 measures the fundamental component, 2 measures the second harmonic, and so on. The block extracts the amplitude at the frequency k * f₁, so increasing this value targets higher-frequency harmonics.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | OrderMeasure |
| Values: | "1" (default) | positive integer in quotes |
| Data Types: | char | string |
Example: set_param(gcb,"OrderMeasure","3")
Windowing method for amplitude computation. Select Moving window to continuously update the measurement over a sliding window. Select Fixed window to compute the measurement over a fixed number of cycles and hold the result until restarted.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | MeasurementMode |
| Values: | "Moving window" (default) | "Fixed window" |
Example: set_param(gcb,"MeasurementMode","Fixed window")
Lower bound for the input frequency range, specified in Hz. The block uses this value to allocate the internal buffer that stores samples for one measurement window. A lower frequency requires more buffer memory because the measurement window spans more samples. Set this to the lowest frequency your application needs to measure accurately.
Dependencies
This parameter is visible when Fundamental input frequency type is set to Input port.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | MinimumFrequency |
| Values: | "40" (default) | positive scalar in quotes |
| Data Types: | char | string |
Example: set_param(gcb,"MinimumFrequency","30")
Number of signal cycles in the fixed measurement window. The block computes the measurement over this many complete cycles before holding the output. Increasing this value improves measurement accuracy by averaging over more cycles, but increases the time before the first valid output is available.
Dependencies
This parameter is visible when Measurement mode is set to Fixed window.
Programmatic Use
To set the block parameter value programmatically, use
the set_param function.
| Parameter: | NumCycle |
| Values: | "1" (default) | positive integer in quotes |
| Data Types: | char | string |
Example: set_param(gcb,"NumCycle","2")
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version History
Introduced in R2026b
See Also
Power Measurement | RMS | Total Harmonic Distortion | Total Power Factor
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)