158 Chapter 4
Downloading and Using Files
Downloading ARB Waveform Data
The following Matlab M-file programming example generates and downloads a pulse pattern waveform file
through the PSG vector signal generator’s GPIB interface. A copy is also available on the
PSG Documentation CD-ROM as pulsepat.m.
% Script file: pulsepat.m
%
% Purpose:
%To calculate and download an arbitrary waveform file that simulates a
%simple antenna scan pulse pattern to the PSG vector signal generator.
%
% Define Variables:
% n -- counting variable (no units)
% t -- time (seconds)
% rise -- raised cosine pulse rise-time definition (samples)
% on -- pulse on-time definition (samples)
% fall -- raised cosine pulse fall-time definition (samples)
% i -- in-phase modulation signal
% q -- quadrature modulation signal
n=4; % defines the number of points in the rise-time and fall-time
t=-1:2/n:1-2/n; % number of points translated to time
rise=(1+sin(t*pi/2))/2; % defines the pulse rise-time shape
on=ones(1,120); % defines the pulse on-time characteristics
fall=(1+sin(-t*pi/2))/2; % defines the pulse fall-time shape
off=zeros(1,896); % defines the pulse off-time characteristics
% arrange the i-samples and scale the amplitude to simulate an antenna scan
% pattern comprised of 10 pulses
i = .707*[rise on fall off...
[.9*[rise on fall off]]...