User`s manual

Generating a
Damped Sine Wave
The SIN_D program generates a Damped sine wave using 4096 segments or
points.
BASIC Program Example (SIN_D)
This program is similar to the “SIN_X” BASIC program on page 105, with
the following differences:
1 !RE-STORE “SIN_D”
2 !This program outputs a damped sine wave arbitrary waveform.
180 !Call the subprogram which defines a damped sine wave and
190 !the output sequence.
200 CALL Sind_def
210 !Select the output sequence and start the waveform.
220 OUTPUT @Afg;"SOUR:FUNC:USER SIN_D_OUT"
230 OUTPUT @Afg;"INIT:IMM"
290 SUB Sind_def
300 Sind_def: !Compute waveform (damped sine wave) and define segment.
310 COM @Afg
320 DIM Waveform(1:4096)
330 A=4/4096
340 W=(2*PI)/50
350 FOR T=1 TO 4096
360 Waveform(T)=EXP(-A*T)*SIN(W*T)
370 NEXT T
380 OUTPUT @Afg;"SOUR:LIST1:SEGM:SEL SIN_D" !select segment to be defined
390 OUTPUT @Afg;"SOUR:LIST1:SEGM:DEF 4096" !set segment size
400 OUTPUT @Afg;"SOUR:LIST1:SEGM:VOLT";Waveform(*) !load waveform points
410 !
420 OUTPUT @Afg;"SOUR:LIST1:SSEQ:SEL SIN_D_OUT" !Define sequence name
430 OUTPUT @Afg;"SOUR:LIST1:SSEQ:DEF 1" !Define sequence size
440 OUTPUT @Afg;"SOUR:LIST1:SSEQ:SEQ SIN_D" !Set segment execution order
450 SUBEND
Chapter 3 Generating Arbitrary Waveforms 107