Main Content

readPowerSpectrum

Perform RF spectrum analyzer spectral data measurement

Since R2025a

    Description

    SpecData = readPowerSpectrum(rfsa) initiates a swept-span measurement on the specified RF spectrum analyzer, and returns acquired spectral data. The units of amplitude are specified using the AmplitudeUnits property of the RFSpecAn object. The function errors if the instrument is configured for a zero-span measurement.

    SpecData = readPowerSpectrum(rfsa,Trace=traceID) measures power spectrum data for the specified instrument trace. The value of traceID can be numeric or its corresponding string, for example, Trace=1 or Trace="Trace1". The default value is 1.

    example

    Examples

    collapse all

    Connect to an RF spectrum analyzer and take a power spectrum measurement.

    rfsa = rfspecan;
    rfsa.Resource = "TCPIP0::K-N9040B-91124.dhcp.mathworks.com::inst0::INSTR";
    rfsa.Driver = "AgXSAn";
    connect(rfsa)
        ⋮
    SpecData = readPowerSpectrum(rfsa)

    Input Arguments

    collapse all

    RF spectrum analyzer, specified as an RFSpecAn object.

    Example: rfsa = rfspecan

    Data Types: object

    Output Arguments

    collapse all

    Spectral data from the instrument measurement, returned as an N-by-1 column array of doubles. The size of N is determined by the instrument, and indicated by the TraceSize property of the RFSpecAn object. The measurement units are specified by the AmplitudeUnits property; the default is dBm.

    Version History

    Introduced in R2025a