 Review
 Open Access
 Published:
Wavelet analysis of circadian and ultradian behavioral rhythms
Journal of Circadian Rhythmsvolume 11, Article number: 5 (2013)
Abstract
We review timefrequency methods that can be useful in quantifying circadian and ultradian patterns in behavioral records. These records typically exhibit details that may not be captured through commonly used measures such as activity onset and so may require alternative approaches. For instance, activity may involve multiple bouts that vary in duration and magnitude within a day, or may exhibit daytoday changes in period and in ultradian activity patterns. The discrete Fourier transform and other types of periodograms can estimate the period of a circadian rhythm, but we show that they can fail to correctly assess ultradian periods. In addition, such methods cannot detect changes in the period over time. Timefrequency methods that can localize frequency estimates in time are more appropriate for analysis of ultradian periods and of fluctuations in the period. The continuous wavelet transform offers a method for determining instantaneous frequency with good resolution in both time and frequency, capable of detecting changes in circadian period over the course of several days and in ultradian period within a given day. The discrete wavelet transform decomposes a time series into components associated with distinct frequency bands, thereby facilitating the removal of noise and trend or the isolation of a particular frequency band of interest. To demonstrate the waveletbased analysis, we apply the transforms to a numericallygenerated example and also to a variety of hamster behavioral records. When used appropriately, wavelet transforms can reveal patterns that are not easily extracted using other methods of analysis in common use, but they must be applied and interpreted with care.
Introduction
Behavioral rhythms of animals span a wide range of cycle lengths, including circannual rhythms that vary with the seasons (period of 1 year), changes in activity due to the estrous cycle in rodents (cycle length of 45 days), circadian rhythms that track the daily lightdark cycle (period of 1 day), and ultradian rhythms of activity occurring within a single day (typically periods of 8 h or less).
The mammalian circadian pacemaker, the suprachiasmatic nucleus (SCN), governs circadian rhythms of tissues throughout the body as well as of outputs like activity, coordinating physiological processes internally and with the external environment by entraining to lightdark (LD) cycles [1]. Locomotor activity offers a convenient and nonintrusive way to measure the circadian rhythms of an animal, for example, by measuring wheelrunning or by using a motion sensor. Behavioral rhythms can exhibit a circadian period (reflecting the circadian clock in the SCN) as well as ultradian periods. The ultradian rhythms emerge as a consequence of multiple physiological processes, not currently well understood, and tend to have greater interindividual variability than circadian rhythms [2]. In addition, the waveform of activity is known to vary under different conditions. For example, the waveform of animals entrained to an LD cycle often depends on the photoperiod, while hamsters under constant light (LL) can “split” their behavior and under 24 h LDLD cycles can “bifurcate” their activity rhythms [3]. These changes in waveform and the presence of ultradian rhythms point to the fact that behavioral records display a rich variety of patterns that we would like to be able to characterize and quantify.
The variability and noisiness of behavioral records creates a challenge in reliably determining period and phase of activity rhythms, and even more so in finding ways to quantify other aspects of behavioral patterns. In particular, behavioral records are typically nonstationary; their frequency content is not constant over time. A variety of methods have been applied to detect circadian rhythmicity and to measure the period of circadian rhythms for different types of molecular and behavioral data, including autocorrelation, Fourier and other periodograms, sinefitting, cosinor analysis, maximum entropy spectral analysis (MESA), digital filtering, and waveletbased methods [4–11]. Assessing characteristics of ultradian rhythms is particularly challenging, with few methods available. For instance, one study applied a continuous wavelet transform to identify how cage size affected ultradian rhythms in mice [12]. Similarly, a wavelet scalogram can be used to detect circadian and ultradian patterns in arterial pressure [13]. More recently, digital filtering, autocorrelation, and MESA have been used to analyze ultradian rhythms in the sleepwake behavior of rats [14], and gender differences in circadian and ultradian behavioral rhythms have been explored with the use of cosinor analysis [15, 16]. Other types of methods have also been applied to examine patterns in activity, including detrended fluctuation analysis to reveal a scaleinvariance across the spectrum from seconds to 24 h [17].
In the following section, we briefly describe several methods of timefrequency analysis, specifically the Fourier periodogram and discrete and continuous wavelet transforms, and apply them to a numericallygenerated time series with known circadian and ultradian periods to illustrate their use. In the Examples and discussion section, we apply the wavelet transforms to activity records from hamsters to demonstrate their efficacy on real data. We conclude with some final remarks, emphasizing a few caveats regarding the effective application of wavelet transforms.
Fourier and wavelet timefrequency analysis methods
We expect that behavioral patterns will differ between the day and the night, at the very least in magnitude but also possibly in ultradian period. For instance, activity bouts may be briefer and occur more (or less) often during subjective day than during subjective night for a nocturnal rodent. How can we identify these sorts of patterns in an activity rhythm?
Periodograms
The natural place to start when carrying out a mathematical analysis of frequency is a Fourier periodogram. For a record with many cycles, a periodogram can yield good estimates of the dominant frequencies occurring in a stationary time series.
Let a time series be generated by sampling a process every Δ t hours, with x _{ k } the measurement taken after k Δ t hours have elapsed (e.g., if activity is binned every 6 minutes, then Δ t = 0.1 h). If N such samples are taken, this uniform sampling results in the finite sequence . The discrete Fourier transform (DFT) of this time series is defined by
where . The Fourier periodogram shown in Figure 1 for a numericallygenerated time series displays the power spectral density corresponding to period N Δ t/k hours.
To understand what ultradian frequencies the DFT is able to detect, let’s examine Equation (1) in the context of a circadian rhythm. Suppose the time series has a period of τ hours (with possibly some ultradian periods as well), so x _{ n }=x _{ n mod s } for all n, where there are s = τ/Δ t time points per day. Also assume that the times series covers D periods, so N = D s. Then we can break up the DFT sum into portions covering each of the D days, on each of which the time series repeats itself:
We can apply the geometric sum formula, for r≠1, with r = e ^{−2πik/D}, leading to
if k is not a multiple of D (noting e ^{−2πim}=1 for all integers m). Therefore the DFT coefficients are only nonzero when k = m D for some positive integer m, which correspond to periods hours. That is, only harmonics of τ (the period of the daily rhythm) can appear in the DFT, and so the true ultradian periods will not be revealed by the periodogram. This fact is reflected in Figure 1B, which shows DFT spikes at harmonics of 24 h, but no spikes at the actual ultradian period values. Also note that a square wave with period 24 h will have spikes at all harmonics of 24 h (12 h, 8 h, 6 h, etc), even though that signal involves no ultradian periods. Therefore the presence of spikes in the DFT at harmonics does not directly indicate whether or not ultradian periods are present.
Note that the periodogram applied to real data will display some frequencies other than the harmonics of τ because real activity records are noisy and vary from day to day, so they don’t perfectly repeat a pattern every cycle. However, if the interest lies in extracting patterns that do essentially repeat daily, this analysis implies that the Fourier periodogram will not be useful in measuring the true period(s) of ultradian activity patterns (even if an ultradian period coincides with a harmonic, we have no way of easily distinguishing whether or not a large spike at a harmonic indicates a true ultradian period). Other periodograms present a similar difficulty for measuring ultradian periods, as illustrated in Figure 1B. In general, methods like the DFT are not wellsuited for nonstationary time series.
The DFT has an advantage over other periodogram methods in that it can be inverted. If the circadian pattern of activity is sufficiently regular, like in the simulated time series in Figure 1, then we can keep the dominant harmonics (with periods τ/m) from the DFT and invert to see what this pattern is, as shown in Figure 1C. In practice, this approach works best for animals with very predictable timing of activity bouts; the discrete wavelet transform described below offers a more flexible tool for this purpose.
It is important to keep in mind that the purpose of periodograms like those shown in Figure 1B is to determine frequencies present globally in the signal, so they do not provide the proper tool for the problem of determining ultradian frequencies present during particular time intervals, particularly if the period can differ during, say, subjective day and night for an animal, or for detecting changes in the circadian period from day to day. A method that can localize in time is more appropriate for these tasks, which involve nonstationary time series. The classic example of such timefrequency analysis is the wavelet transform, which comes in two flavors, discrete and continuous. The continuous wavelet transform provides a replacement for the periodograms, by offering high resolution period information that is localized in time. The discrete wavelet transform provides an alternative method to inverting the DFT for identifying the daily pattern of activity bouts, with the flexibility that it does not require bouts be similarly timed each day.
We should note that, while wavelet transforms can provide excellent resolution of how the frequency or period changes over time, all timefrequency analysis must obey the limitations imposed by the Heisenberg uncertainty principle, which in essence says that increasing the time resolution will decrease the frequency resolution, and vice versa. Just as we cannot simultaneously know the exact position and momentum of a quantum particle, in the signal processing context we cannot simultaneously pinpoint time and frequency. The choice of wavelet determines how sensitive the corresponding wavelet transform can be to frequency as opposed to time specificity, but there is no way to obtain perfect resolution in both time and frequency.
The continuous wavelet transform
Continuous wavelet transforms convolve a time series x(t) with a wavelet function ψ(t), essentially finding the correlation between the time series at different points in time with scaled versions of the wavelet function to determine the frequency that best describes the times series at each point in time. See [18] for an introduction to wavelet analysis. Continuous wavelet transforms can use realvalued wavelet functions, like the Mexican Hat wavelet used in [11] to analyze body temperature rhythms, or they can be complexvalued, like the Morlet wavelet used in [13] to analyze bioluminescence rhythms for molecular data (e.g., PER2::LUC oscillations). Complexvalued wavelet transforms yield both amplitude and phase information over time, while realvalued wavelets can be better at isolating peaks and discontinuities [18]. Choice of which wavelet function to use also depends on the desired resolution in time versus frequency, and on the characteristics of the time series, e.g., smooth and sinusoidal or choppy and discontinuous. A wavelet function whose shape reflects the features of the data often works best. Experimentation with different choices can indicate which wavelet is best suited for a particular set of data.
Here we focus on a complexvalued wavelet function that is analytic (meaning the Fourier transform equals zero for negative frequencies) called the Morse wavelet function [19], so the resulting wavelet transform
is referred to as an analytic wavelet transform (AWT). (The asterisk indicates the complex conjugate, and we have used bandpass normalization to define the transform.) The time t refers to the current time point of interest in the time series x(t), and the scale s corresponds to the period 2π s/ω _{ ψ }, where ω _{ ψ } is the mean frequency of the Morse wavelet function ψ(t). The heat map of the magnitude W _{ ψ }(t,s) yields information about the frequencies present in the time series at each point in time and the amplitude associated with those frequencies. The wavelet ridges run along the local maxima s = s _{ m a x }(t) of W _{ ψ }(t,s), indicating the scale s _{ m a x }(t) that yields the greatest correlation with the time series at time t and thereby estimates the instantaneous period 2π s _{ m a x }(t)/ω _{ ψ }. The value of W _{ ψ }(t,s _{ m a x }(t)) equals the amplitude of the rhythm at time t associated with the instantaneous period, while the complex argument (polar angle) of W _{ ψ }(t,s _{ m a x }(t)) indicates the phase at time t. Consistent with normal usage in mathematics, we define the amplitude of an oscillation to equal the distance between the midpoint value and the maximum value. For example, A is the amplitude of the sinusoidal function A cos(ω t)+C. Doubling the amplitude gives the peaktotrough height of the oscillation.
As an illustrative example, examine the AWT in Figure 2 of the simulated time series from Figure 1A. For a finite length, discrete time series , we use a discretized version of (2), as explained in [18]. Observe that the period in the AWT heat map is not scaled linearly along the vertical axis, since the transform is calculated with respect to scale s, the reciprocal of period, but here we have converted to period for ease of interpretation. For this example, the AWT closely estimates the periods 5.3 h and 1.6 h of the alternating ultradian rhythms, and also correctly estimates their amplitude. The AWT can tell us both what periods are present in the times series and when they occur (within the constraints of the uncertainty principle).
The AWT must be interpreted with care. If the activity of an animal is too variable, the AWT may not yield anything usable. It suffers problems with harmonics, which appear as “echoes” in the heat map below the hot spots marking dominant frequencies. Wavelet transforms, like other filtering techniques applied to finite length time series, exhibit edge effects due to the wraparound nature of the filtering process. Edge effects can be minimized for activity data by starting and ending the time series to be transformed at midpoints of rest intervals. See [9, 18] for further discussion of edge effects.
The discrete wavelet transform
The discrete wavelet transform (DWT) is rather different in nature from the continuous version. In place of a wavelet function, a highpass wavelet filter and a lowpass scaling filter are repeatedly applied to yield a set of wavelet details (as well as wavelet smooths, which we won’t discuss). The sum of the wavelet details plus the final smooth equals the original time series, so the DWT decomposes the time series into components associated with certain period ranges. More specifically, each wavelet detail D _{ j } is associated with a frequency band corresponding to periods approximately 2^{j} Δ t through 2^{j+1} Δ t (as before, we sample every Δ t hours to generate the time series), assuming we use certain families of filters like the Daubechies filters. For instance, if the time series is an activity record with 6 minutes bins (Δ t = 0.1 h), then D _{5} covers roughly the period range 3.26.4 h. The value of Δ t controls the range of periods associated with each wavelet detail, so we can adjust that range through the bin size. If the circadian component is desired, then choosing Δ t = 0.25 h (15 minute bins) works well so that D _{6} corresponds to the period range 1632 h. If a particular ultradian rhythm is sought, then it can be helpful to choose a bin size so that the period range of one of the details is centered on the desired period.
For this application, we chose a translationinvariant DWT with the Daubechies least asymmetric filter of length 12, sometimes called symlet6. Shorter length filters result in more overlap between the frequency bands associated with each wavelet detail, so that the components are not as well separated with respect to the period ranges. Longer length filters can worsen edge effects. See [20] for an indepth explanation of the translationinvariant DWT (also known as a maximal overlap DWT), and see [9, 21] for practical overviews.
Again consider the simulated time series in Figure 1A to illustrate possible uses of the DWT for analysis of activity records. Figure 3 shows the wavelet details obtained from the DWT of the simulated time series, for which Δ t = 0.1 h. Wavelet detail D _{5} (period range 3.26.4 h) reflects the large activity bouts with ultradian period 5.3 h, while D _{3}−D _{4} (period ranges 0.81.6 h and 1.63.2 h, respectively) best reflect the ultradian rhythm with period 1.6 h. To capture the overall pattern occurring in the time series, we sum D _{3}−D _{7} together (roughly covering period range 126 h), shown underneath the time series in Figure 4A. This offers a more flexible version of the DFT method shown in Figure 1C, as DWT approach continues to yield good results even if the timing of the bouts varies from day to day. To measure the ultradian periods present during each part of the day, we can examine the time intervals between peaks of the summed wavelet details (which roughly correspond to midpoints of activity bouts). These intervals are plotted in Figure 4B, demonstrating that this approach can capture the ultradian periods present during different parts of the day.
The DWT is also effective at detecting sharp discontinuities in a time series (with an appropriate choice of filter), such as occur with activity onsets. See [11] for a description and examples of how the DWT can be used to detect onsets in activity records, which is not discussed in this review.
Computations
The freely available MATLAB wavelet toolbox jlab[22] was used to compute the AWT (using β = 3 and γ = 8 in the Morse wavelet function), and the freely available MATLAB wavelet toolbox wmtsa[23] (companion software for [20]) was used to compute the translationinvariant DWT (which refers to symlet6 as la12). All calculations for both the simulated time series in the Methods section and for the real data sets described in the Results section were run in MATLAB 8.0.0.783 (The MathWorks, Natick, MA).
Animal care
Regarding the activity records of Syrian hamsters from Eric Bittman’s lab: All procedures were approved by the animal care and use committee (IACUC) of the University of Massachusetts at Amherst, and conform to all USA federal animal welfare requirements.
Regarding the activity records of Syrian hamsters from Brian Prendergast’s lab: All procedures conformed to the USDA Guidelines for the Care and Use of Laboratory Animals and were approved by the Institutional Animal Care and Use Committee (IACUC) of the University of Chicago.
Examples and discussion
To demonstrate that the AWT and DWT can be effective in analyzing real behavioral data, we apply the methods described in the previous section to a variety of hamster activity records. We also discuss some of the difficulties that can be encountered when applying these transforms for real data.
Tracking changes in activity over the estrous cycle
The estrous cycle in hamsters typically results in an approximately 4day pattern in the amplitude and period of activity (“scalloping”), due in part to the effects of estradiol [24]. The AWT can be effective in tracking these changes in amplitude and period over time, if the record is sufficiently long. The difficulty is that edge effects can distort the AWT heat map, so that 12 days at the beginning and end are not reliable. If a 4day pattern is being sought, then the activity record should cover at least 2 uninterrupted weeks, preferably more, for the AWT to yield good results. A further disadvantage of the AWT is that missing data in the record can also distort the results. Nevertheless, on uninterrupted records of sufficient length, the AWT can provide a spectacular visualization of the effects of the estrous cycle on activity. See Figure 5 for an example. For other examples of using wavelet analysis to detect period and amplitude changes across the estrous cycle, see [9] (in mice) and [11] (in hamsters).
Ultradian periods during day and night
The waveletbased analysis can also be effective at detecting changes in ultradian period across the day. For example, we can apply the AWT to a hamster wheelrunning record to detect a roughly 5 h ultradian period during the night, as shown in Figure 6. Observe that the AWT heat map only shows hot spots during the night and not during the day, correctly reflecting that the activity is only occurring when the lights are off. Note that the ridge curves will not yield good estimates of the times of activity onset and offset, as the border between time intervals of different frequencies (e.g., activity patterns during subjective day versus subjective night) will appear smeared, due to the limitations of time versus frequency resolution. For waveletbased determination of the precise time of activity onset, use a method like that described in [11].
As another example, consider the three hamster records shown in Figure 7. We apply both the AWT and DWT methods to these records. To minimize the obscuring effects of daytoday variations, the AWT heat maps are averaged over the 11 days of the record. Comparison of the two methods is recommended, as agreement between them increases confidence that the results are meaningful. During the night when activity is much greater, the ultradian patterns revealed by the waveletbased techniques are clear, though with some random variation in the actual period. On the other hand, activity is sparse and sporadic when light is present, with the intervals varying from 0.53 h. Whether the lack of a clear ultradian period during daytime is due to masking suppressing the animal’s activity, is because the animal doesn’t express a coherent ultradian rhythm during its rest phase, or is caused by some other factor requires further investigation.
Final remarks
The AWT and DWT offer alternatives to try when other techniques prove insufficient to analyze a time series in the desired manner. We don’t suggest that wavelet transforms be the first techniques to apply when studying a new set of behavioral records, as wellestablished methods are in many cases sufficient to answer the questions of interest. Waveletbased methods must be applied and interpreted with care, keeping in mind issues with harmonics and edge effects. In particular, the record must be sufficiently long so that a day or so can be discarded on each end of the resulting wavelet transform since these portions may be distorted by edge effects. If a time series is excessively noisy, has too much missing data, or the rhythms are not focused on particular frequencies, the wavelet transforms may not yield anything useful. However, when used appropriately on relevant datasets, the AWT and DWT can reveal patterns that are not easily extracted using other methods of analysis in common use, thereby expanding the types of questions we can ask a set of behavioral records to answer. The methods presented here offer a means of identifying circadian and ultradian patterns and how they change over time, from daytoday as well as over the course of a day.
Abbreviations
 AWT:

Analytic wavelet transform
 DFT:

Discrete fourier transform
 DWT:

Discrete wavelet transform
 LD:

Lightdark
 MESA:

Maximum entropy spectral analysis
 SCN:

Suprachiasmatic nucleus.
References
 1.
Reppert S, Weaver D: Coordination of circadian timing in mammals. Nature 2002, 418:935–941.
 2.
Aschoff J: A survey on biological rhythms. In Handbook of Behavioral Neurobiology, Volume 4, Biological Rhythms. Edited by: Aschoff J. New York: Plenum Press; 1981:3–10.
 3.
Evans JA, Elliott JA, Gorman MR: Individual differences in circadian waveform of siberian hamsters under multiple lighting conditions. J Biol Rhythms 2012, 27:410–419.
 4.
Nelson W, Tong YL, Lee JK, Halberg F: Methods for cosinorrhythmometry. Chronobiologia 1979, 6:305–323.
 5.
Chan FHY, Wu BM, Lam FK, Poon PWF, Poon AMS: Multiscale characterization of chronobiological signals based on the discrete wavelet transform. IEEE Trans Biomed Eng 2000, 47:88–95.
 6.
Levine J, Funes P, Dowse H, Hall J: Signal analysis of behavioral and molecular cycles. BMC Neurosci 2002, 3:1.
 7.
Refinetti R, Cornélissen G, Halberg F: Procedures for numerical analysis of circadian rhythms. Biol Rhythm Res 2007, 38:275–325.
 8.
Dowse HB: Analyses for physiological and behavioral rhythmicity. In Methods in Enzymology, Volume 454. Edited by: Brand L, Johnson ML, Johnson ML , Brand L . Burlington: Academic Press; 2009:141–174.
 9.
Leise TL, Harrington ME: Waveletbased time series analysis of circadian rhythms. J Biol Rhythms 2011, 26:454–463.
 10.
Cohen AL, Leise TL, Welsh DK: Bayesian statistical analysis of circadian oscillations in fibroblasts. J Theor Biol 2012, 314:182–191.
 11.
Leise TL, Indic P, Paul MJ, Schwartz WJ: Wavelet meets actogram. J Biol Rhythms 2013, 28:62–68.
 12.
Poon AMS, Wu BM, Poon PWF, Cheung E, Chan FHY, Lam FK: Effect of cage size on ultradian locomotor rhythms of laboratory mice. Physiol Behav 1997, 62:1253–1258.
 13.
Price T, Baggs J, Curtis A, Fitzgerald G, Hogenesch J: WAVECLOCK wavelet analysis of circadian oscillations. Bioinformatics 2008, 24:2794–2795.
 14.
Stephenson R, Lim J, Famina S, Caron AM, Dowse HB: Sleepwake behavior in the rat: Ultradian rhythms in a lightdark cycle and continuous bright light. Biol Rhythm Res 2007, 38:275–325.
 15.
Prendergast BJ, Beery AK, Paul MJ, Zucker I: Enhancement and suppression of ultradian and circadian rhythms across the female hamster reproductive cycle. J Biol Rhythms 2012, 27:246–256.
 16.
Prendergast BJ, Cisse YM, Cable EJ, Zucker I: Dissociation of ultradian and circadian phenotypes in female and male Siberian hamsters. J Biol Rhythms 2012, 27:287–298.
 17.
Hu K, Scheer FAJL, Ivanov PC, Buijs RM, Shea SA: The suprachiasmatic nucleus functions beyond circadian rhythm generation. Neuroscience 2007, 149:508–517.
 18.
Torrence C, Compo GP: A practical guide to wavelet analysis. Bull Am Meteorol Soc 1998, 69:61–78.
 19.
Lilly J, Olhede S: On the analytic wavelet transform. IEEE Trans Inf Theory 2010, 56:4135–4156.
 20.
Percival D, Walden A: Wavelet Methods for Time Series Analysis. New York: Cambridge University Press; 2000.
 21.
Quotb A, Bornat Y, Renaud S: Wavelet transform for realtime detection of action potentials in neural signals. Front Neuroeng 2011.,4(7). doi:10.3389/fneng.2011.00007.
 22.
Lilly JM: JLAB: Matlab freeware for data analysis, Version 0.94. [http://www.jmlilly.net/jmlsoft.html]
 23.
Cornish C: WMTSA Wavelet Toolkit for MATLAB. [http://www.atmos.washington.edu/~wmtsa/]
 24.
Morin L, Fitzgerald K, Zucker I: Estradiol shortens the period of hamster circadian rhythms. Science 1977, 196:305–307.
Acknowledgements
I would like to thank the Dean of Faculty’s office at Amherst College for generous support, and Eric Bittman, Emily Manoogian, and Brian Prendergast for stimulating discussions and for providing hamster records for developing and demonstrating the wavelet analysis methods.
Author information
Additional information
Competing interests
The author declares that she has no competing interests.
Rights and permissions
About this article
Received
Accepted
Published
DOI
Keywords
 Time series analysis
 Fourier transform
 Wavelet transform
 Circadian rhythms
 Ultradian rhythms
 Rodent locomotor activity
 Estrous cycle