% Example: Generating a waveform within MATLAB and
% exporting to a .CSV file for use by the Agilent 33120A
% Arbitrary Waveform Generator.

% Define the sampling frequency
fs = 4000

% Create a time vector
tt = 0:1/fs:2-1/fs;

% Create the signal
sig = chirp(tt,100,2,400)';

% Listen to the signal
sound(sig,fs)

% Save to .CSV file
save matlab_csv.csv -ascii sig

% Calculate the 33120A frequency setting
fs/length(sig)


