WaveGen triggering

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
WaveGen triggering

I have a PulsePal2 and I am using the PulsePal_WaveGen firmware to send a custom waveform through output channel 1 when Trigger1 gets triggered from a Bpod. 

I now want to send a different custom waveform from channel 2 and I want this to be triggered also from Trigger1. In other words, I want to connect two output channels to Trigger1, but I want to send different custom waveforms from each channel at the same time. Is that possible?

Thank you,
Hi Matina,

Unfortunately, WaveGen firmware only supports 1 waveform at a time - though you can play it on all output channels simultaneously.
Using the Bpod Analog Output Module, you can play a different waveform on each of 4 output channels. With that device, playback must be triggered by MATLAB or the Bpod State Machine (instead of a TTL line), and waveforms can be arbitrary (but up to 1 million samples in length).

I hope this helps

Hi Josh, thanks for your reply.
What I want to do is to modulate a laser with a 50Hz sinusoid, so this is the waveform that I would like to output in addition to a stimulus waveform. Can I do this in another quicker way than buying an additional device for now? 

Maybe by triggering a second PulsePal from the same Bpod? Or by sending this 50Hz pulse from Bpod’s BNC output?

Hi Matina

If your goal is to play a pulse train from 1 channel while a 50Hz sine wave plays from a second channel, you don't need to use WaveGen.
The default firmware has memory reserved for custom waveforms. Here's how you'd use it:
  • Create a single cycle of the 50Hz waveform as a vector of voltages in MATLAB. The Pulse Pal repository includes a function for this.
  • Upload the waveform to Pulse Pal as custom waveform #1 with SendCustomWaveform().
  • Set channel 2 to use custom waveform #1 with ProgramPulsePalParam(2, 'CustomTrainID', 1);
  • Set channel 2 to loop the waveform for PulseTrainDuration seconds with ProgramPulsePalParam(2, 'CustomTrainLoop', 1);
  • Set PulseTrainDuration of channel 2 to equal channel 1 (if channel 2 is being used for modulation)
My goal is to play:
1. a custom waveform that is complex (it is a combination of white noise that is interrupted by sine wave bits) and 
2. a 50Hz sine wave
Those two at the same time. Does the default firmware allow me to do this?

Hi Matina

The default firmware's limitation is 5,000 samples each for 2 custom waveforms. If the first waveform is a long sequence that can't simply be looped like a single period of a sine function, you're up against a memory limitation. As a parametric pulse generator, Pulse Pal stores the onset time and voltage of each pulse. By automating the onset times, WaveGen firmware reallocates memory to provide up to 50,000 samples for a single waveform. I suspect that firmware can be modded to give you 2 waveforms of 25k samples, though the max sampling rate would have a lower limit. Unfortunately, we can't do this mod from our side at the moment - working full time to get Ethernet support for Bpod and preparing our system to run the IBL behavior.

Forum Jump:

Users browsing this thread: 1 Guest(s)