Chapter 17 Programming Examples
Application examples
9102 Handheld Spectrum Analyzer Software version 5.31
349
Signal search Task: Search for transmitters within a frequency band. If a signal is
present and higher than a level of -80 dBm, the frequency is printed.
OutAck9100 ("SENS:FREQ:SPAN 2000000")' set span to 2 MHz
OutAck9100 ("SENS:FREQ:CENT 936000000")' start with channel 0
OutAck9100 ("SENS:REFL -40") ' set a sensitive ref-level
OutAck9100 ("INP:ATT 0") ' remove any attenuation !!
OutAck9100 ("SENS:TRAC:A MAXH") ' activate a max hold trace
OutAck9100 ("SENS:DET:FUNC POS") ' use only positive samples
OutAck9100 ("CALC:MARK:AOFF") ' switch all markers off
channel = 1
For I = 9360 To 9594 Step 18 ' scan the gsm band in small por-
tions
Msg$ = "SENS:FREQ:CENT" & Str$(I) & "00000"
OutAck9100 (Msg$) ' set frequeny
For J = 0 To 4
OutAck9100 ("SENS:SWE:STAT SING")' do the measurements 5
times
Next J
Output9100 ("SENS:TRAC:A:FETC? MAX")
MXdata$ = Input9100() ' read trace data
For J = 0 To 499 ' isolate the data into an
array
P = InStr(MXdata$, ",") ' search for the COMMA between two
values
Yfeld(J) = Val(Mid$(MXdata$, 1, P))
MXdata$ = Right$(MXdata$, Len(MXdata$) - P)
' remove the actual value
Next J
For J = 45 To 445 Step 50
P = -120
For K = 0 To 8 ' do a maximum search
If Yfeld(J + K) > P Then
P = Yfeld(J + K) ' store the new maximum
End If
Next K
If P > -80 And channel < 125 Then ' blocked channel found
Print "Channel " & Str$(channel) & " = " & Str$(P) & " dBm."
End If
channel = channel + 1