Tutorial Contents

Phase, Latency, Duty cycle

Latency constant

Phase constant

Close synchrony

Circular phase plot

Duty cycle

Contents

Phase, Latency and Duty Cycle

Rhythmic activities such as heartbeat, walking, or respiration are characterised by features that repeat at more-or-less regular intervals. Each repetition is a cycle of the rhythm, and the time interval between the occurrence of a particular feature and the nextYou could define cycle period as the time between a feature and the previous occurrence of that feature, but analysis of things like duty cycle is easier if we associate a cycle period with the feature occurrence that defines the start of it, rather than the end of it. occurrence of the same feature is the instantaneous cycle periodInterval is the general term, period is the term used when the activity is rhythmic. of the first of the pair. The reciprocal of the interval time is its instantaneous frequency. There is thus one fewer period/frequency values than there are feature occurrences, and the last occurrence has no defined period or frequency.

Cycle period is rarely absolutely constant - in respiration, you breathe rapidly when you exercise, but slowly when you are at rest. Furthermore, many rhythms contain more than one component feature - inspiration and expiration are separate features within the overall rhythm of respiration. However, once you have finished breathing in, you have to breathe out before you can breathe in again, so their overall cycle period is the same.

In Dataview, features in recorded data waveforms can be represented by events, with different event channels usually representing different features. Events have a start and end time, but a fixed amplitude - they are digital on-off signals. Thus, to take respiration as the example again, events in one channel might represent inspiration, while events in another channel might represent expiration. In this case there could be no overlap between events in the two channels, but with other features/rhythms, overlap is entirely possible.

The timing relationship of features within a rhythm may be of critical importance in understanding the rhythm, and is often characterized in terms of phase, latency and duty cycle. The phase of a feature is the fractionPhase can be enumerated as a decimal fraction in the range 0 - 1, or as a percentage in the range 0 - 100, or as an angle in the range 0 - 360. Dataview uses the decimal fraction option. of the cycle period at which the feature occurs, the latency is the time delay between the start of the cycle and the time of the feature. Of course, these terms only makes sense if the rhythm has at least two features, one of which is used as a reference to define the start time of each cycle. You can then speak about the phase or latency of the other feature with respect to the cycle defined by the first. Duty cycle is the fraction of the cycle period that a feature occupies, so it only requires one feature for measurement since the same feature can both define the cycle period, and have a measurable duty cycle.

It may be of particular interest to decide whether a feature is constant with respect to cycle period, because this can give clues about the mechanism generating the rhythm..

phase and latency constancy

Phase, latency and duty cycle. Two cycles of a rhythm defined by Fref are shown; the first is short, the second long. Note that the third Fref does not have a measurable cycle period (interval) associated with it because there is no following feature.
Sub-feature F1 occurs at a fixed time after the start of the cycle so it is latency constant but phase variable. Sub-feature F2 occurs at a fixed fraction of the cycle period (about 0.5) so it is phase constant but latency variable.
The features all have constant duration, so the first Fref has a longer duty cycle than the second, because it occupies a greater fraction of its associated interval.

The timing relationships of features within a rhythm is often explored by plotting the phase, latency or duty cycle of a feature against the cycle period of the rhythm. Dataview has facilities for these types of analyses, but before using them on real data it may be instructive to try them out on data with known characteristics. This will help you become familiar with the interpretation of the results, and also make you aware of some potential traps and pitfalls that you may encounter.

This is an event-only file with known properties constructed for demonstration purposes. Channel a contains events which are reference features defining a rhythm with a mean cycle period of 50 ms and a standard deviation of 10 ms (you could plot a histogram if you wanted to confirm this). Channel b contains events that occur 15 ms after each event in channel a (i.e. are latency constant with respect to a). Channel c contains events that occur one-fifth of the way through each cycle defined by channel a (i.e. are phase constant with respect to a). The other channels have features that will be described later.

Latency constant

The graph is completely flat with a Y-axis value of 15 ms (remember that this is constructed data), which is pretty convincing evidence that features (events) in channel b follow events in channel a (the reference features) with fixed latency. However, at the moment the X axis is the time of occurrence of the events whose latency we are measuring, which is not quite what we want for our analysis.

This makes the X axis display the interval between those events in channel 2 which bracket the events in channel 1 whose latency we are measuring. The events in channel 2 define the cycle period, so we are now plotting latency against cycle period, which is what we want. If we just selected the normal Interval parameter for the X axis, we would plot latecy against the interval between the events whose latency we are measuring, which is not what we want (although in fact the graphs would be identical with these artificial data).

This should centre channel b event 77 in the main display, and you can see that the interval between events 77 and 78 in channel a is indeed quite long - in fact, the longest cycle period in the data.

Channel b event 198 is now centred in the main display, and the interval between events 198 and 199 in channel a is quite short - in fact, the shortest cycle period in the data.

The overall conclusion backs up the original claim - the latency with which channel b follows channel a is constant, irrespective of cycle period.

The graph now shows a very strong diagonal trend. This is because the data were constructed such that an event in channel b is "tied" to the immediately preceding event in channel a at fixed latency, but the reverse is not true - an event in channel a is not in any way tied to the preceding event in channel b. In fact, quite the opposite - there will be a long time delay between them if the cycle period is long, and a short time delay if the cycle period is short. This emphasises the crucial importance of selecting the correct event channels for the desired analysis - getting them the wrong way round can lead to a completely erroneous conclusions.

The plot now shows a curving drop in phase as cycle period increases. This is exactly what we would expect for latency constancy. At short cycle periods (on the left) the fixed latency of the channel b event from that in channel a causes the b event to occur late within the cycle defined by events in a and hence with a long phase, but at longer cycle periods (on the right) the same latency causes channel b events to occur early within the cycle and hence with a short phase.

a
fixed latency vs cycle period
b
fixed latency vs cycle period error
c
fixed latency phase vs cycle period
Data in which F2 shows rhythmic activity with varying cycle period, and F1 follows F2 at a constant latency. a. Latency as F1-F2 plotted against F2 cycle period shows latency constancy. b. Latency as F2-F1 plotted against F1 cycle period shows non-constant latency (latency scales with cycle period). c. Phase of F1 within cycles defined by F2 plotted against F2 cycle period shows non-constant phase.

Phase

We now again have a more or less flat line, centred on a phase value of 0.2, which confirms that events in channel c are occurring one-fifth of the way through each cycle as defined by events in channel a, irrespective of the cycle period. This is as it should be, since the data were constructed that way.

Why is the line not completely flat, as it was for the latency constant data? The data were indeed constructed to have a phase of exactly 0.2, but, due to digitization, events cannot occur at any arbitrary time on a continuous scale, but only at the nearest time values that are multiples of the sample bin duration. This leads to greater variability at short cycle periods (on the left of the graph), where the number of available time bins is lower. However, note that the variability has exaggerated visual emphasis in this display due to autoscaling the Y axis - the data are actually all very close to 0.2. (There was no variability in the latency plot because the latency was an exact multiple of the sample interval.)

The three graphs are shown below, for comparison with the constant latency data.

a
constant phase vs cycle period
b
non-constant phase vs cycle period
c
constant phase latency vs cycle period
Data in which F2 shows rhythmic activity with varying cycle period, and F1 occurs at a fixed phase (0.2) within each F2 cycle. a. Phase of F1 within each F2 cycle, plotted against F2 cycle period shows phase constancy. b.Phase of F2 within each F1 cycle, plotted against F1 cycle period shows non-constant phase. c. Latency as F1-F2 plotted against F2 cycle period shows non-constant latency.

Close synchrony

Event channel d contains events that occur at the same time as those in channel a, except that their time of occurrence has been offset in either direction by a random Gaussian variable with a standard deviation of 3 ms. Events in the two channels (a and d) are thus nearly, but not absolutely, synchronous . What do the plots look like now?

It would appear from the plot (a below) that the latency falls into clear two groups, but this is entirely an artefact caused by the parameter choice of latency from the previous event. For those channel d events that come after their channel a partner, the plot shows a short positive latency (the lower group in the plot). However, for those channel d events that come before their channel a partner, the plot measures the latency from the previous channel a event, and that latency depends on the cycle period, leading to the diagonal group in the plot. The analysis is technically correct, but it is misleading.

The plot now shows the latency of channel d events from the nearest channel a event, whether it comes before or after it. This is the partner event to which it is almost synchronized, and so the latencies vary within a fairly narrow range of about +/- 8 ms, and have no particular relationship to cycle period. This is more informative.

How do we decide which analysis to choose? Sometimes we suspect (or actually know) that there is a causal relationship between the two channels (e.g. if one marks a stimulus and the other the response). In this case the latency from the previous partner event is obviously the correct choice. In other cases close inspection of the data and comparison of the results is the only way to decide.

What happens to near synchrous data in a phase plot?

Again we have two clear groups in the plot, but this results from the linear definition of phase. Those events which just precede their partner will be occurring late in the preceding cycle of the rhythm, and hence have a phase close to 1. Those events which just follow their partner will occur early in the following cycle of the rhythm, and thus have a phase close to 0. It is like a 24-hour clock: 23:00 and 01:00 are actually only two hours apart, but their numerical values superficially suggest a separation of 22 hours.

This simply subtracts 1 from all phase values greater than 0.5, so that phase now varies in the range -0.5 to +0.5 (e.g. phase 0.9 becomes phase -0.1). This resolves the visual ambiguity of near synchrony being either close to 0 or close to 1 - it is now always close to 0, but it can have a positive or negative value.

a
close synchrony latency previous
b
close synchrony latency
c

close synchrony phase

d
close syncrhony adjusted phase
Near synchrony of F1 and F2. a. The latency of F1 from the preceding F2 is plotted against F2 cycle period. This gives a misleading display with two apparent groups. b. The latency of F1 from the nearest F2 is plotted against F2 cycle period. This shows the random distribution of latencies centred around 0. c. The phase of F1 within each F2 cycle plotted against F2 cycle period shows groups with phase close to 0 and close to 1. This is correct, but visually misleading. c.Phase has been adjusted so that it ranges from -0.5 to +0.5, with 0 indicating synchrony. The close synchrony of F1 and F2 is now apparent.

The adjusted phase plot is fine if near synchrony is the only phase relationship that occurs. However, what happens if there are two phase relationships in a data set, one near synchronous (in-phase) the other near the mid cycle (anti-phase)? With the adjusted phase plot the anti-phasic group would again be split, this time between +0.5 and -0.5 phase.

Circular phase plots

Half of this record contains data identical to channel d (i.e. with a phase of 0/1, but some variability), the other half contains data with a phase of 0.45, but again with some variability. There are 3 apparent phase groups in the Phase 1 near 2 plot - the central group is produced by events in channel e which are nearly synchronous to those in channel a, while the upper and lower groups are the events in channel e with a phase of 0.45 relative to those in channel a.

There are still 3 groups, so this does not help.

There is nothing that can be done about this in the scatter graph display. However, if we look at a histogram, there is an alternative solution.

You should now see a tri-modal display, for the same reason that we saw 3 groups in the scatter plot.

A new dialog opens showing a circular phase plot rather like a clock. There are two clear groups in this display, not the three seen in the standard histogram. The group pointing vertically (towards the 1 / 0 label are the near synchronous events, the group pointing down and slightly to the right are the phase 0.45 events.

a
histogram showing phase 0/1 and 0.45
b
circular phase plot 0/1, 0.45
Histogram of data in which half have a phase of 0/1 and the other half have a phase of 0.45. a. The standard histogram is tri-modal, despite there being only 2 phase groups. b. A circular histogram shows the true bi-phasic nature of the data.

Now close the histogram dialog.

Duty Cycle

Return to viewing the scatter graph.

The events in channel f have a duration that varies in direct proportion to the cycle period in which they occur. In other words, their duty cycle is constant, which is why the graph plot is flatDigitization has the same effect in broading the plot as it does for the phase plot seen earlier.. (In fact, the data were constructed so that the duration of each event is 0.2 times the interval between the start time of that event and the start time of the following event, which is the cycle period.) Note that since the same event channel defines both the duty cycle and the cycle period, we do not need to specify a second event channel, and we use the standard Interval parameter for the X axis, rather than the Interval 2 pair 1 parameter that we used previously.

The diagonal line confirms that the duration of each event is proportional to the cycle period.

The events in this channel have constant duration, so the plot becomes flat.

The plot now follows a declining curve. This makes sense because a fixed duration will occupy a larger fraction of a short cycle period than it will of a long cycle period.

The 4 plots are shown below for comparison. There are obvious similarities to the latency and phase plots seen earlier,

a
constant duty cycle vs cycle period
b
duration vs cycle period with constant duty cycle
c
duration vs cycle period, constant duration
d
duty cycle vs cycle period, constant duration
Duty cycle, duration and cycle period. a. Events with constant duty cycle produce a flat line when their duty cycle is plotted against cycle period. b. Events with constant duty cycle produce a diagonal line when their duration is plotted against cycle period. c. Events with constant duration produce a flat line when their duration is plotted against cycle period. d. Events with constant duration produce a declining curve when their duty cycle is plotted against cycle period.