FetchSpectrum(string, double, int, ref Spectrum< float >)
- Updated2025-10-13
- 2 minute(s) read
Fetches the spectrum trace in IM measurement corresponding to the specified spectrumIndex.
Syntax
Namespace: NationalInstruments.RFmx.SpecAnMX
public int FetchSpectrum(string selectorString, double timeout, int spectrumIndex, ref Spectrum< float > spectrum)
Parameters
| Name | Type | Description |
|---|---|---|
| selectorString | string | Specifies a selector string comprising of the result name. If you do not specify the result name, the default result instance is used. Example: |
| timeout | double | Specifies the timeout, in seconds, for fetching the specified measurement. Set this value to an appropriate time, longer than expected for fetching the measurement. A value of -1 specifies that the method waits until the measurement is complete. |
| spectrumIndex | int | Specifies the index of the spectrum to fetch. When you set the SetMeasurementMethod(string, RFmxSpecAnMXIMMeasurementMethod) method to DynamicRange or Segmented, each of the tone and intermod has a separate spectrum. You can fetch these spectrums one at a time by using a spectrumIndex. The following list shows the spectrumIndex to use while fetching tones and intermods:
Hence, the segment index can range from 0 to 2*(Number of Intermods) + 1. When you set the SetMeasurementMethod(string, RFmxSpecAnMXIMMeasurementMethod) method to Normal, the IM measurement returns only one spectrum and a spectrumIndex equal to 0 is used to fetch the spectrum. |
| spectrum | ref Spectrum< float > | Upon return, contains the averaged power measured at each frequency bin. This value is expressed in dBm or dBm/Hz. |
Returns
Returns the status code of this method. The status code either indicates success or describes a warning condition.