sendCustomWaveform()

Description


Syntax

confirmed = sendCustomWaveform(trainID, samplingPeriod, voltages)

Parameters

Returns

Examples

% 1. This code generates a 0.2s duration, 100Hz sine wave on output channel 3.

%    Peak to peak amplitude is 20V, spanning Pulse Pal's entire -10V - +10V output range.

samplingPeriod = 0.0001; % Seconds

sineFrequency = 100; % Hz

waveform = 10*sin(2*pi*sineFrequency*(samplingPeriod:samplingPeriod:0.2));

P.sendCustomWaveform(1, samplingPeriod, waveform); % Program custom pulse train 1

P.customTrainID(3) = 1; % Set output channel 3 to use custom pulse train 1

P.phase1Duration(3) = samplingPeriod; % Set output channel 3 to use 100μs pulses

P.trigger(3); % Trigger output channel 3


% 2. This code generates a 3s duration, 10Hz sine wave on output channel 1. This would exceed Pulse Pal's memory

%    if every sample were specified, so we loop a zero-phase sine waveform with the customTrainLoop property.

samplingPeriod = 0.0001; % Seconds

sineFrequency = 10; % Hz

waveform = sin(pi:((2*pi)/((1/samplingPeriod)/sineFrequency)):3*pi)*10;

P.sendCustomWaveform(1, samplingPeriod, waveform); % Program custom pulse train 1

P.customTrainID(1) = 1; % Set output channel 1 to use custom pulse train 1

P.phase1Duration(1) = samplingPeriod; % Set output channel 1 to use 100μs pulses

P.customTrainLoop(1) = true; % Loop the custom train until pulseTrainDuration

P.pulseTrainDuration(1) = 3; % Seconds

P.trigger(1); % Trigger output channel 1