To set the frequency for custom stimulation protocols in LabChart, you will use the Stimulator's arithmetic expression function.
First, open the Stimulator window (Setup > Stimulator), select Customize…, and then click the + button to add custom parameters. These parameters can then be referenced when adding an arithmetic expression parameter (fn). Note that the arithmetic expression option is not available for isolated stimulation.
Before creating your expression, it's essential to understand the relationships between the core timing parameters:
- Frequency (Hz): The rate at which pulses are delivered. This will be a custom-added parameter.
- End delay (seconds): The time between the end of one pulse and the start of the next.
- Pulse width (seconds): The duration of a single pulse.
The fundamental relationship governing these is:
1 / Frequency = End delay + Pulse width
This means that the total time for one complete pulse cycle (1/Frequency) is the sum of the pulse's duration and the delay following it.
From this, you can derive the following formulas to calculate any of these parameters if the other two are known:
- Frequency = 1 / (End delay + Pulse width)
- End delay = (1 / Frequency) − Pulse width
- Pulse width = (1 / Frequency) − End delay
Using Arithmetic Expressions for Custom Protocols
A common application of these relationships is creating a square pulse expression that allows you to dynamically alter the frequency of pulses within a set duration. The general format for the Square Pulse expression in LabChart is:
Pulse( amplitude, width, startDelay, endDelay, repeats )
Here's what each parameter controls:
- amplitude (constant between 0 and the output range; default = 1): Sets the pulse height from the baseline.
- width (constant 0 or greater; default = 0.1): The pulse duration in seconds.
- startDelay (constant 0 or greater; default = 0): The delay in seconds before the first pulse begins.
- endDelay (constant 0 or greater; default = 1): The delay in seconds after each pulse.
- repeats (constant 1 or greater; default = Unlimited): The total number of pulses in the segment.
Example:
To generate pulses with a 5 V amplitude, a 0.1 s width, and a 0.5 s gap after each of four pulses, you would use:
= Pulse( 5, 0.1, 0, 0.5, 4 )
Integrating Custom Parameters
Because pulse width, end delay, and frequency are interrelated, you can create custom parameters within the Stimulator's Customize... section and insert them into your arithmetic expression segment.
For example, if you want 5V amplitude pulses to occur within a total duration of 5 seconds, at a specific frequency, you would create an arithmetic expression segment using:
pulse(5, Width, 0, ((1/Frequency) - Width), Repeats)
Here, Width (for pulse width), Frequency, and Repeats are the custom parameters you would have added in the Stimulator's Customize... window.
Calculating Burst Length and Number of Pulses
To determine the overall length of your stimulation burst or the required number of pulses:
- Length of stimulation burst = Number of pulses / Frequency
- Repeats (Number of pulses) = Length of stimulation burst * Frequency
For more information, please refer to this webinar on using the Stimulator.
For further technical assistance with this or any other issue, please contact ADInstruments Technical Support by clicking HERE.