Programming the Spectrum Monitor
Last updated: December 3, 2008
This section provides an example of how to use the Spectrum Monitor via the GPIB.
The following procedure assumes that the mobile station's antenna output is connected to the RF IN/OUT connector, and that the mobile station is transmitting an uplink signal.
-
Configure the Spectrum Monitor parameters using the SETup subsystem.
-
Start the Spectrum Monitor using the INITiate subsystem.
-
Use the INITiate:DONE? command to determine if Spectrum Monitor results are available.
-
Use the FETCh? commands to obtain Spectrum Monitor results.
-
Use the CALCulate commands to set and query the Spectrum Monitor markers.
Programming Example
10 REAL Amplitudes(400)
20 ! Set up array to hold 401 amplitude results (trace data)
30 OUTPUT 714;"SETUP:SMONITOR:CONTINUOUS OFF"!Configures the Spectrum Monitor to
40 !single trigger mode.
50 OUTPUT 714;"SETUP:SMONITOR:COUNT:NUMBER 20"!Configures a multi-measurement
60 !of 20.
70 OUTPUT 714;"SETUP:SMONITOR:TRIGGER:SOURCE IMMEDIATE"!Configure trigger source
80 !to immediate.
90 OUTPUT 714;"SETUP:SMONITOR:FREQUENCY:SPAN 20 MHz"!Set frequency span
100 OUTPUT 714;"SETUP:SMONITOR:BWIDth:MANUAL 300 KHZ"!Decouples the frequency span
110 ! and the resolution bandwidth, and sets the resolution bandwidth.
120 OUTPUT 714;"INITIATE:SMONITOR"!Start the Spectrum Monitor
130 !
140 OUTPUT 714;"FETCH:SMONITOR:INTEGRITY?"!Fetch SMON Integrity
150 ENTER 714;Integrity
160 PRINT "Spectrum Monitor Integrity: ";Integrity
170 IF Integrity=0 THEN !Fetch results if SMON
180 OUTPUT 714;"FETCH:SMONITOR:TRACE?"!has valid integrity.
190 ENTER 714;Integrity,Amplitudes(*)!Load valid results into array
200 PRINT "Trace Data Amplitude Results (dB):"
210 PRINT "--------------------------------------------------"
220 PRINT Amplitudes(*) !Prints the 401 stored data points.
230 PRINT "--------------------------------------------------"
240 ELSE
250 PRINT "Bad Integrity value =";Integrity
260 STOP
270 END IF
280 ! Move the marker to the signal peak and query the frequency and level
290 OUTPUT 714;"CALCULATE:SMONITOR:MARKER1:PEAK:MAXIMUM"
300 OUTPUT 714;"CALCULATE:SMONITOR:MARKER1:FREQUENCY?"
310 ENTER 714;Peak_frequency
320 PRINT "Maximum Peak Frequency (MHz): ";Peak_frequency
330 OUTPUT 714;"CALCULATE:SMONITOR:MARKER1:AMPLITUDE?"
340 ENTER 714;Peak_amplitude
350 PRINT "Maximum Peak Amplitude (dBm): ";Peak_amplitude
360 END
Returned Values
The results returned by this program are:
-
Integrity
returns the Spectrum Monitor
Integrity Indicator
(0 means that the Spectrum Monitor completed with no errors).
-
Amplitudes()
returns 401 points representing the amplitude results (in dBm) of the trace data.
-
Peak_frequency
returns the frequency in MHz at marker 1. In this case, marker 1 is positioned at the highest peak value.
-
Peak_amplitude
returns the amplitude in dBm at marker 1. In this case, marker 1 is positioned at the highest peak value.
|