Main Content

CursorMeasurementsConfiguration

Measure signal values using vertical waveform cursors that track along the signal

Since R2023a

    Description

    Use the CursorMeasurementsConfiguration object to enable waveform cursors. You can control the cursor settings from the toolstrip of the scope or from the command line.

    To display the vertical cursors on each signal and to modify the cursor settings in the scope UI, click the Measurements tab and enable Data Cursors. Each cursor tracks a vertical line along the signal. The scope displays the difference between x- and y-values of the signal at the two cursors in the box between the cursors. The cursors appear only when the Spectrum Analyzer has at least one signal in its display. You can use the mouse to move the vertical cursors left and right.

    The SpectrumAnalyzerBlockConfiguration object supports the CursorMeasurementsConfiguration object in the command line.

    Spectrum Analyzer Toolstrip

    Snapshot showing cursor measurements in Spectrum Analyzer toolstrip.

    Creation

    Description

    example

    cursormeas = CursorMeasurementsConfiguration() creates a cursor measurements configuration object.

    Properties

    expand all

    All properties are tunable.

    x-coordinates of the cursors, specified as a two-element vector of real numbers.

    Scope Window Use

    On the Measurements tab, select Data Cursors and then click Data Cursors to specify the two elements in X location properties.

    Data Types: double

    Position cursors on the signal data points, specified as true or false.

    Scope Window Use

    On the Measurements tab, select Data Cursors and then click Data Cursors to select Snap to data.

    Data Types: logical

    Lock spacing between cursors, specified as true or false. Set this property to true to lock the frequency difference between the cursors.

    Scope Window Use

    On the Measurements tab, select Data Cursors and then click Data Cursors to select Lock cursor spacing.

    Data Types: logical

    Enable cursor measurements, specified as true or false. Set this property to true to enable cursor measurements.

    Scope Window Use

    On the Measurements tab, select Data Cursors.

    Data Types: logical

    Examples

    collapse all

    Open and run the signal amplifier model.

    open_system('amplifySigNoise.slx')
    sim('amplifySigNoise.slx')
    

    The Spectrum Analyzer blocks in the model show the amplified noise and the signal power plots, respectively. For more details on this model, see the Analysis of Frequency Response of RF System example.

    You can obtain or modify the peak, cursor, and distortion measurements in the spectra programmatically by enabling these properties in the SpectrumAnalyzerConfiguration object:

    • PeakFinder

    • CursorMeasurements

    • DistortionMeasurements

    Access the configuration properties of the Spectrum Analyzer block using the get_param function.

    sablockNoise = 'amplifySigNoise/Noise';
    cfgNoise = get_param(sablockNoise,'ScopeConfiguration');
    sablockPwr = 'amplifySigNoise/Power';
    cfgPwr = get_param(sablockPwr,'ScopeConfiguration');
    

    To enable these measurements, set the Enabled property to true.

    cfgNoise.CursorMeasurements.Enabled = true;
    cfgNoise.PeakFinder.Enabled = true;
    cfgNoise.DistortionMeasurements.Enabled = true;
    cfgPwr.CursorMeasurements.Enabled = true;
    cfgPwr.PeakFinder.Enabled = true;
    cfgPwr.DistortionMeasurements.Enabled = true;
    

    You can now modify these measurements programmatically. As an example, display the first two peaks on the spectrum display. By default, the spectrum shows three peaks. To modify the number of peaks it shows, change NumPeaks to 2. You can even label the peaks using the LabelPeaks property and control the minimum distance between adjacent peaks using the MinDistance property. The changes you make to these properties update the spectra accordingly.

    cfgNoise.PeakFinder.NumPeaks = 2;
    cfgPwr.PeakFinder.NumPeaks = 2;
    

    Version History

    Introduced in R2023a