Generating A Sine Wave With Spikes - HP E1340A User Manual

Arbitrary function generator
Hide thumbs Also See for E1340A:
Table of Contents

Advertisement

C and QuickBASIC
Program Versions
Generating a Sine
Wave with Spikes
HP IBASIC Program Example (SPIKES)
79
Generating Arbitrary Waveforms with the HP E1340A
The C example program, CHARGE.C, is in directory "CPROG" and the
QuickBASIC example program, CHARGE.BAS, is in directory
" QBPROG" on the C and QuickBASIC example disk (part number
E1340-10036).
This program generates a Sine Wave with Spikes using 4096 segments or
points.
This program is similar to the " SIN_D" BASIC program on page 76, with
the following differences:
1
!RE-SAVE"SPIKES"
2
!This program generates a sine wave with a spike.
150
!Set AFG parameters
160
OUTPUT @Afg;"SOUR:FREQ:FIX 1E3;";!frequency
170
OUTPUT @Afg;":SOUR:FUNC:SHAP USER;"; !function
180
OUTPUT @Afg;":SOUR:VOLT:LEV:IMM:AMPL 1.5V"
190
!
200
!Call subprogram which defines waveform segment.
210
CALL Sine_spike
310
SUB Sine_spike
320 Sine_spike: !Subprogram which defines a sine wave with a spike
330
COM @Afg,Waveform(*)
340
FOR I=1 TO 4096
350
Waveform(I)=.5*SIN(2*PI*(I/4096))
360
NEXT I
370
Width=50
Continued on next page
!scale
amplitude
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents