PulsePalWavGen square pulse with ramp down

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PulsePalWavGen square pulse with ramp down
Hi Scott

The waveform generator actually requires different firmware from v2.0.1: look in /PulsePal/Waveform Generator/Arduino/
v2.0.1 is firmware that supports a proper object oriented interface for Pulse Pal's parametric pulse train functions, in /MATLAB_GEN2/.

Your need sounds like a perfect case for WaveGen's customWaveform function. The example code below (untested) should do the job:

Wave = [ones(1,2000)*5 4.98:-0.025:0]; % Generate waveform (sampled at 1kHz)
P = PulsePalWaveGen('COM3'); % Create WaveGen object (replace COM3 with your actual serial port)
P.customWaveform = Wave; % Upload the waveform
P.customWaveformSF = 1000; % Set sampling rate to 1kHz
P.waveform = 'custom'; % Tell WaveGen to use a custom waveform (instead of the default parametric function generator)

% By default, output Ch1 will respond to a TTL on trigger Ch1.
% You can also soft-trigger to test the playback with:

Depending on how evenly you want the down-ramp to be, you can increase the sampling rate to 10kHz - the first line would then use [ones(1,20000)*5 4.998:-0.0025:0]


Messages In This Thread
RE: PulsePalWavGen square pulse with ramp down - by Josh - 04-27-2017, 03:55 PM

Forum Jump:

Users browsing this thread: 1 Guest(s)