journal of neuroscience methods an improved method for the

17
Journal of Neuroscience Methods 173 (2008) 165–181 Contents lists available at ScienceDirect Journal of Neuroscience Methods journal homepage: www.elsevier.com/locate/jneumeth An improved method for the estimation of firing rate dynamics using an optimal digital filter Sofiane Cherif a , Kathleen E. Cullen b,1 , Henrietta L. Galiana a,,1 a Department of Biomedical Engineering, McGill University, Montreal, PQ, Canada H3A 2B4 b Aerospace Medical Research Unit, Department of Physiology, McGill University, Montreal, PQ, Canada H3G 1Y6 article info Article history: Received 26 November 2007 Received in revised form 22 May 2008 Accepted 25 May 2008 Keywords: Kaiser window Spike density ISI Rate histogram Vestibular afferents abstract In most neural systems, neurons communicate by means of sequences of action potentials or ‘spikes’. Information encoded by spike trains is often quantified in terms of the firing rate which emphasizes the frequency of occurrence of action potentials rather than their exact timing. Common methods for esti- mating firing rates include the rate histogram, the reciprocal interspike interval, and the spike density function. In this study, we demonstrate the limitations of these aforementioned techniques and propose a simple yet more robust alternative. By convolving the spike train with an optimally designed Kaiser window, we show that more robust estimates of firing rate are obtained for both low and high-frequency inputs. We illustrate our approach by considering spike trains generated by simulated as well as experi- mental data obtained from single-unit recordings of first-order sensory neurons in the vestibular system. Improvements were seen in the prevention of aliasing, phase and amplitude distortion, as well as in the noise reduction for sinusoidal and more complex input profiles. We review the generality of the approach, and show that it can be adapted to describe neurons with sensory or motor responses that are charac- terized by marked nonlinearities. We conclude that our method permits more robust estimates of neural dynamics than conventional techniques across all stimulus conditions. © 2008 Elsevier B.V. All rights reserved. 1. Introduction Neurons can transmit information using a variety of neural codes (see: Bialek et al., 1991; Rieke et al., 1997). One such exam- ple is rate coding which emphasizes the frequency of occurrence of action potentials (or firing rate) rather than the exact timing of spikes. The firing rate concept was introduced nearly a century ago (Adrian and Zotterman, 1926) and remains the most frequently used approach for describing neuronal responses. The estimation of a given neuron’s firing rates requires the conversion of its dis- crete binary spike train into a continuous signal. To date, numerous approaches have been developed to estimate firing rates from neu- ronal spike trains, of which the most widely used include the rate histogram, the reciprocal interspike interval, and the spike density function (or Gaussian window) methods. The goal of the present study was to develop a method to obtain an accurate estimate of the firing rate signal. Commonly used meth- Corresponding author at: Lyman Duff Building, 3775 University Street, Room 308, Montreal, PQ, Canada H3A 2B4. Tel.: +1 514 398 6738; fax: +1 514 398 7461. E-mail address: [email protected] (H.L. Galiana). 1 Equal author contributions. ods are characterized by several inherent limitations. For example, while the (peristimulus) rate histogram method which averages responses over many trials is still widely used (e.g., Dickman and Correia, 1989; Hullar et al., 2005; Hullar and Minor, 1999), its util- ity is limited by the implicit assumption that variations in firing rate pattern over the duration of a bin do not encode informa- tion, and it is prone to ‘localization error’ near bin edges (Bayly, 1968; French and Holden, 1971; Paulin, 1992; Richmond et al., 1990; Sanderson and Kobler, 1976). Likewise, the reciprocal interspike interval method, which is frequently used to obtain a measure of “instantaneous” firing (e.g., Dickman and Correia, 1989; Shaikh et al., 2004), is characterized by nonlinear behaviour and sensitivity to noise at high frequencies (Richmond et al., 1990). To overcome the limitations of the above methods, many investigators have begun to employ a third approach which is termed the ‘spike den- sity function’ and is based on a nonparametric kernel estimation (Parzen, 1962). This method consists of convolving the spike train with a Gaussian probability density function (PDF), thereby intro- ducing neither localization errors nor nonlinearities (Paulin, 1992; Richmond et al., 1990). However, as we will show, the choice of the window length of the PDF is critical (Cullen et al., 1996; Richmond et al., 1990) and typically results in signal attenuation causing dis- tortion in the relevant frequency band. 0165-0270/$ – see front matter © 2008 Elsevier B.V. All rights reserved. doi:10.1016/j.jneumeth.2008.05.021

Upload: marina761

Post on 30-Jul-2015

126 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Journal of Neuroscience Methods An improved method for the

Aa

Sa

b

1

cpooauocarhf

a

3

0d

Journal of Neuroscience Methods 173 (2008) 165–181

Contents lists available at ScienceDirect

Journal of Neuroscience Methods

journa l homepage: www.e lsev ier .com/ locate / jneumeth

n improved method for the estimation of firing rate dynamics usingn optimal digital filter

ofiane Cherif a, Kathleen E. Cullenb,1, Henrietta L. Galianaa,∗,1

Department of Biomedical Engineering, McGill University, Montreal, PQ, Canada H3A 2B4Aerospace Medical Research Unit, Department of Physiology, McGill University, Montreal, PQ, Canada H3G 1Y6

europike tf acte thedemalterre ropprosing

in thidal adaptearitieal te

a r t i c l e i n f o

Article history:Received 26 November 2007Received in revised form 22 May 2008Accepted 25 May 2008

Keywords:Kaiser windowSpike densityISIRate histogramVestibular afferents

a b s t r a c t

In most neural systems, nInformation encoded by sfrequency of occurrence omating firing rates includfunction. In this study, wea simple yet more robustwindow, we show that moinputs. We illustrate our amental data obtained fromImprovements were seennoise reduction for sinusoand show that it can be aterized by marked nonlinedynamics than convention

. Introduction

Neurons can transmit information using a variety of neuralodes (see: Bialek et al., 1991; Rieke et al., 1997). One such exam-le is rate coding which emphasizes the frequency of occurrencef action potentials (or firing rate) rather than the exact timingf spikes. The firing rate concept was introduced nearly a centurygo (Adrian and Zotterman, 1926) and remains the most frequentlysed approach for describing neuronal responses. The estimationf a given neuron’s firing rates requires the conversion of its dis-rete binary spike train into a continuous signal. To date, numerouspproaches have been developed to estimate firing rates from neu-onal spike trains, of which the most widely used include the rateistogram, the reciprocal interspike interval, and the spike density

unction (or Gaussian window) methods.The goal of the present study was to develop a method to obtain

n accurate estimate of the firing rate signal. Commonly used meth-

∗ Corresponding author at: Lyman Duff Building, 3775 University Street, Room08, Montreal, PQ, Canada H3A 2B4. Tel.: +1 514 398 6738; fax: +1 514 398 7461.

E-mail address: [email protected] (H.L. Galiana).1 Equal author contributions.

165-0270/$ – see front matter © 2008 Elsevier B.V. All rights reserved.oi:10.1016/j.jneumeth.2008.05.021

ns communicate by means of sequences of action potentials or ‘spikes’.rains is often quantified in terms of the firing rate which emphasizes the

ion potentials rather than their exact timing. Common methods for esti-rate histogram, the reciprocal interspike interval, and the spike density

onstrate the limitations of these aforementioned techniques and proposenative. By convolving the spike train with an optimally designed Kaiserbust estimates of firing rate are obtained for both low and high-frequencyach by considering spike trains generated by simulated as well as experi-le-unit recordings of first-order sensory neurons in the vestibular system.e prevention of aliasing, phase and amplitude distortion, as well as in thend more complex input profiles. We review the generality of the approach,d to describe neurons with sensory or motor responses that are charac-s. We conclude that our method permits more robust estimates of neural

chniques across all stimulus conditions.© 2008 Elsevier B.V. All rights reserved.

ods are characterized by several inherent limitations. For example,while the (peristimulus) rate histogram method which averages

responses over many trials is still widely used (e.g., Dickman andCorreia, 1989; Hullar et al., 2005; Hullar and Minor, 1999), its util-ity is limited by the implicit assumption that variations in firingrate pattern over the duration of a bin do not encode informa-tion, and it is prone to ‘localization error’ near bin edges (Bayly,1968; French and Holden, 1971; Paulin, 1992; Richmond et al., 1990;Sanderson and Kobler, 1976). Likewise, the reciprocal interspikeinterval method, which is frequently used to obtain a measure of“instantaneous” firing (e.g., Dickman and Correia, 1989; Shaikh etal., 2004), is characterized by nonlinear behaviour and sensitivityto noise at high frequencies (Richmond et al., 1990). To overcomethe limitations of the above methods, many investigators havebegun to employ a third approach which is termed the ‘spike den-sity function’ and is based on a nonparametric kernel estimation(Parzen, 1962). This method consists of convolving the spike trainwith a Gaussian probability density function (PDF), thereby intro-ducing neither localization errors nor nonlinearities (Paulin, 1992;Richmond et al., 1990). However, as we will show, the choice of thewindow length of the PDF is critical (Cullen et al., 1996; Richmondet al., 1990) and typically results in signal attenuation causing dis-tortion in the relevant frequency band.
Page 2: Journal of Neuroscience Methods An improved method for the

166 S. Cherif et al. / Journal of Neuroscienc

Nomenclature

A stopband attenuation in dBˇ Kaiser window shape parameterCV* normalized coefficient of variationdB decibels�f transition bandf frequency (Hz)f0 carrier frequencyFFT fast Fourier transformFIR finite impulse responseFM frequency modulatedfm frequency of the modulating inputfmax highest expected input frequencyFp passband frequencyFs stopband frequencyfs sampling frequencyfilter one-sided Matlab filtering functionFiltfilt two-sided Matlab filtering functionHc(s) transfer function of canal afferent dynamicsI0 0th order modified bessel function of first kindIPFM Integral Pulse Frequency Modulationj imaginary number (j)2 = −1M filter window lengthm0 DC offset of the IPFM model

m1 amplitude of the sinewavem1(t) sinewave input functionms millisecondsMSE mean square errorn discrete-time samplePDF probability density functions j*2�ft time (s)T threshold of the IPFM modelTs sampling periodWG(t) Gaussian window functionWK(t) Kaiser window functionWR(t) rectangular window functionx(t) input stimulus function

Symbols� phase of the sinewave* convolution operator

ı maximum ripple tolerated in the passband

In the present study, we first demonstrate the limitations ofthese commonly used methods and then propose a simple yetmore robust alternative. Firing rate estimates were computedfrom computer-generated spike trains as well as spike train dataobtained from first-order sensory (i.e., afferent) neurons in thevestibular system. Vestibular afferents reliably encode head move-ment over the physiologically relevant frequency range (0–20 Hz)(Ramachandran and Lisberger, 2006; Sadeghi et al., 2007a,b) andin turn supply information required for the control of posture, andperception of self-motion and spatial orientation to central neu-rons. Notably, vestibular processing is particularly well suited forthe analysis here since the sensory input can be simply describedin terms of head velocity. Our results show that compared toestimates obtained using conventional techniques, a kernel esti-mation (Parzen) technique – based on convolving (i.e., low-passfiltering) the spike train with an optimally designed Kaiser filter– yielded more robust estimates of firing rate across a wide fre-quency range. The method allowed for optimal signal preservation.

e Methods 173 (2008) 165–181

Notably, estimates obtained from both simulated and real spiketrains demonstrated neither aliasing nor phase distortion and werecharacterized by improved noise reduction.

2. Methods

In comparing alternatives for the estimation of neural firing rate,two types of data were considered. First, filtering approaches wereapplied to simulated data, obtained from an ‘Integral Pulse Fre-quency Modulation’ (IPFM) model of spike train generation (Bayly,1968). Second, the results of rate estimation on experimental datawere assessed. Stimuli profiles in both simulation and experimen-tal data, included low- and high-frequency harmonics (0.5 and10 Hz) and limited bandwidth noise (<20 Hz). Details of the spiketrain simulation and firing rate estimation approaches are pro-vided in Appendix A to facilitate implementation in any desiredprogramming environment. Here, the implementation in the Mat-lab environment (Mathworks, MA) will be described for the Kaiserfilter only (see Appendix A for other methods).

2.1. The Kaiser method

The first step in implementing the Kaiser method requiresdesigning the filter coefficients. In Matlab, the function ‘kaiserord’uses the formulae provided by Kaiser (1974) to design the order (N)and shape parameter (ˇ) of the Kaiser window that best approx-imate the desired passband and stopband frequencies (Fp and Fs,respectively) as well as the passband ripple and stopband attenua-tion (ı and A, respectively). The solution found by Kaiser imposes:

ˇ ={

0.1102(A − 8.7) A > 500.5842(A − 21)0.4 + 0.07886 21 ≤ A ≤ 500.0 A < 21

(1)

M = A − 814.357�f

(2)

where M = N + 1, A = −20 log10(ı) and �f = Fs − Fp.(Note: In this solution, the attenuation A, expressed in decibels

(dB), is completely dependent on the passband ripple ı, a linear-scale unitless fraction, and vice versa.)

The optimal ˇ and N values which are returned by ‘kaiserord’ arethen used by the function ‘kaiser’ to compute the impulse response(coefficients) of the window. This impulse response is passed to theMatlab function ‘fir1’ which designs a windowed linear-phase FIR

digital filter h[n] with the Kaiser properties (see Eqs. (A.1)–(A.4)).A linear-phase response means that the filter equally shifts all thefrequencies of the filtered signal by a pure delay (i.e., there is nophase distortion). The second step is to implement the convolutionof the filter h[n] with the binary spike train x[n] (1 at time of spikeoccurrence and 0 elsewhere):

y[n] =M∑

k=0

h[k] x[n − k] (3)

where h[k], k = 0, 1, . . ., M, are the coefficients of the filter, deemedof order M.

In Matlab, this can be accomplished with the function ‘filter’which performs a one-sided filtering, with a resulting delay of halfthe window length (M/2) in the estimated firing rate, and a tran-sient region of length M at the beginning of the filtered data (wherethe delay can be corrected via appropriate shifting). The alternativeis to use the function ‘filtfilt’ which filters forward and backward toeliminate the delay automatically. In this case, transient regionsat the beginning and end of the filtered signal are equal to half thelength of the filter (M/2) and care must be taken to ignore or remove

Page 3: Journal of Neuroscience Methods An improved method for the

scienc

S. Cherif et al. / Journal of Neuro

these data segments. Similarly, other methods available for spikerate estimation (e.g., rate histogram and spike density function)can be described as impulse responses of finite width, and appliedwith the same filtering steps to the spike train (see Appendix A). Inthis study, we used the second approach (i.e., ‘filtfilt’).

2.2. Simulation data

We generated simulated spike trains to match experimentaldata from single-unit recordings under different stimulation con-ditions (single-harmonic and richer bandwidth/nonlinear inputs)using the IPFM model previously described by Bayly (1968). Thismodel transforms a continuous input modulating signal into adiscrete event series. The IPFM model integrates the stimulus sig-nal m1(t) after adding a DC bias m0. Once the threshold value Tis reached, the model fires a spike and resets the integrator (seeAppendix A for more details). Noise on the input stimulus and/oron the threshold value can reproduce noisy spike timing.

2.3. Experimental data

Extracellular single-unit recordings were made from vestibu-lar afferents (i.e., fibers within vestibular component of the VIIIthnerve) in an alert macaque monkey (see Methods in Sadeghi et al.,2007a,b). We focused on the subset of afferents that project fromthe horizontal semicircular canals of the vestibular labyrinth to thebrain and carry information about rotational velocity around theyaw axis. Canal afferents can be classified in terms of a ‘normal-ized’ coefficient of variation (CV*), as described by (Goldberg et al.,1984). Afferent neurons with a CV* ≤ 0.15 were classified as regularand afferents with a CV* ≥ 0.15 as irregular (Haque et al., 2004).

For the analysis of spike trains evoked by single-harmonicstimulation, two typical examples: regular afferent (hor a74 4,CV* = 0.05) and irregular afferent (aff a31 5, CV* = 0.44) were cho-sen for the present study. To extend our approach to more complexstimulation protocols, we also analyzed an additional regular affer-ent (HC w20 3, CV* = 0.08) which was stimulated using a broadbandvelocity profile, as well as a burst neuron (BN control 10) recordedduring spontaneous eye saccades.

Neuronal recordings were made from vestibular afferents in thehead-restrained condition at rest and during stimulation using aservomotor that rotated the entire animal relative to space in theyaw axis. At higher frequencies (>10 Hz), head-on-body rotations

were applied via a torque motor (see Methods in Sadeghi et al.,2007a,b).

2.4. Parameter selection for the spike density function and therate histogram

To make a fair comparison between the performance of com-monly used techniques (i.e., spike density and rate histogrammethods) and the Kaiser filtering method, we searched for opti-mal parameter values for these filters, besides those currentlyused in the literature. First, spike trains were simulated using theIPFM model to obtain a theoretically approximated firing rate sig-nal (see Eq. (A.10) in Appendix A). Second, firing rate estimatesfrom IPFM spike train data were obtained over a large range offilter parameters, i.e., starting very low (e.g., �/bin = 1) and incre-menting the parameter by 1 at every iteration up to a very highvalue (e.g., until �/bin = 100). Finally, the parameter set in eachmethod providing minimal attenuation of amplitude, i.e., minimalmean square error (MSE) with respect to the theoretical estima-tion, was selected as the optimal filter definition for the given spikesequence.

e Methods 173 (2008) 165–181 167

2.5. Statistical analysis

In simulations, an ensemble of 20 runs was provided to all themethods for spike rate estimation. The robustness of each approachwas then assessed by computing the mean and 95% confidenceinterval curves. Further, for both simulated and experimental data,a least-square regression analysis for single-harmonic tests wasperformed to compute input/output gains, mean firing rates (bias,along with standard deviations) as well as input/output phaseshifts. The transient regions (at the start and end of the signal) werealways removed before comparison. Since inputs were identical forall the methods, the mean square error (MSE) was used as a mea-sure of the quality of fit between the theoretically approximated (orexpected) firing rate and the estimated firing rates in validationswith simulated data:

MSE = E{(Ytheoretical − Yestimated)2} (4)

3. Results

In this section we first explore the frequency content of realspike trains to motivate our general approach. We then validate ourapproach using controlled simulations by comparing the estimateproduced by the Kaiser method to that of a theoretical approxima-tion. Next, we contrast the performance of the Kaiser method to thatof commonly used methods in the literature using both simulatedand experimental data. We explore the validity of the method fordifferent stimulation conditions and cell response characteristics.

3.1. Frequency content of spike trains

To explore the frequency content of real spike trains, we per-formed a fast Fourier transform (FFT) on the spike train recordedfrom the example regular afferent at rest and during sinusoidalrotations. Fig. 1 shows the head velocity trajectories (Fig. 1a),evoked spike trains (Fig. 1b), and their corresponding FFTs (Fig. 1c).Notably, as shown in Fig. 1c, the frequency content of the spike trainnot only includes power at the frequency of stimulation (fm = 2 Hz,see inset in Fig. 1c) but also at harmonics around multiples ofits carrier frequency f0. The carrier frequency refers to the offsetaround which modulations in spike rate are executed when the cellis active. In Fig. 1, f0 = 100 spike/s, resulting in power at ∼100, 200and 300 Hz. The patterning in the frequency domain is most evident

at rest, and becomes less distinct as the amplitude of modulationincreases or as a cell becomes more irregular.

These findings can be well modeled using a modified version ofthe IPFM model. First, as shown in (Bayly, 1968), spike trains gen-erated by the IPFM model have power at the frequency of the input(fm = 2 Hz) as well as at the carrier frequency f0 and its harmonics. Inaddition, by adding noise to the threshold of the IPFM model (rep-resenting the natural irregularity of the action potential patterningof real neurons (CV* = ∼0.05) – see Section 2) we obtained resultsthat were remarkably similar to those of the real data of Fig. 1c. Theresulting FFTs, shown in Fig. 1d, provide support for the choice ofthe IPFM model to generate realistic spike train simulations.

An important implication of Fig. 1 is that one should be able toestimate the example neuron’s firing rate by low-pass filtering (orconvolving) the spike train of panel b with an appropriate filter.The key is to design a filter that passes the modulating frequencycomponent (fm = 2 Hz) while eliminating the carrier frequency har-monics and sidebands. In the next section, we present a systematiccomparison of two methods which use this general approach: theGaussian window (used to compute the spike density function) andthe proposed Kaiser window-based filtering method.

Page 4: Journal of Neuroscience Methods An improved method for the

168 S. Cherif et al. / Journal of Neuroscience Methods 173 (2008) 165–181

Fig. 1. Frequency content of experimental and simulated spike trains. (a) Head velocity stipotential recordings converted into spike trains. (c) The discrete fast Fourier transform oof the modulating signal fm (2 Hz), as well as harmonics around multiples of 100 Hz (thfrequency fs to correct for the mapping from continuous to discrete sampling. (d) FFT ofdata of panel (c). For more realistic spike trains, the IPFM block diagram (see Fig. A.1a) wCV* = ∼0.05. The resulting simulations were strikingly similar to the real data of panel c.

3.2. Kaiser vs. Gaussian window comparison

As shown in Fig. 2a and b, the proposed Kaiser window methodprovides an optimal approximation for the desired combinationof the passband frequency (Fp), the passband ripple (ı), the stop-band frequency (Fs), and related stopband attenuation (A); seeAppendices A.1 and A.2. In addition, the passband can be selectedindependently of the filter length (complexity), as shown in Fig. 2b.On the other hand the Gaussian window (Fig. A.1c) is controlledby a single parameter; the standard deviation �, which is directlyproportional to the window length (M = 10*�). As a result, increas-

muli applied to the animal: 0, 20 and 80 deg/s sinusoidal rotations at 2 Hz. (b) Actionf the spike trains. The frequency content of the spike trains includes the frequencye carrier rate). Note that the magnitude response was multiplied by the samplingspike trains simulated using the IPFM model such that they closely match the realas slightly modified by adding a white noise source to the threshold T to obtain a

ing � (and therefore, M) results in a steeper transition band, butthis occurs at the expense of the passband. In fact, as can beseen from the inset of Fig. 2c, the gain of the filter starts to dropalmost immediately at zero. Thus the Gaussian window approachrapidly attenuates the magnitude of the filtered signal as its size(or standard deviation) is increased; the effect of this attenuation isexpected to be more severe the higher the input bandwidth. Alter-natively, a smaller Gaussian window will have a wide transitionband which is likely to cause aliasing and leak through signifi-cant amounts of noise by intersecting with the carrier frequencycomponents and sidebands.

Page 5: Journal of Neuroscience Methods An improved method for the

S. Cherif et al. / Journal of Neuroscience Methods 173 (2008) 165–181 169

Fig. 2. Window comparisons. Impulse responses are shown in the left column and frequency responses in the right: horizontal red lines denote the −20 dB (1/10) attenuationlevel (a) Kaiser windows of different lengths (M = 50, 100 and 200 ms) but identical passband frequency (−3 dB at Fp = 10 Hz) (b) Kaiser windows of widths matched to (a)now with different passband frequencies (Fp = 26, 13 and 6 Hz). (c) Gaussian windows of different lengths (� = 5, 10 and 20 ms, M = 10�) matched to Kaiser window widths in(a and b). The passbands of the Kaiser filters in (b) were chosen to match the −3 dB points of the Gaussian filters (26.3, 13.2 and 6.58 Hz). We clearly see the inverse relationbetween time precision and frequency selectivity for both windows. The insets show the Kaiser window with a flat passband up to the specified Fp while the Gaussian windowhas virtually no passband. In addition, the Kaiser has a sharper transition band for the same time precision which cannot be done with Gaussian windows and only one freeparameter (�).

Page 6: Journal of Neuroscience Methods An improved method for the

170 S. Cherif et al. / Journal of Neuroscience Methods 173 (2008) 165–181

Fig. 3. Simulation results—regular responses to single sinusoids. Simulations with a sinusoidal head velocity (deg/s) input m1(t) = 40 cos(2�fmt) using the IPFM model(m0 = 100 spikes/s, T = 1). The left column shows the low-frequency simulations (fm = 0.5 Hz) and the right column the high frequency (fm = 10 Hz). 20 identical simulationswere run and the average estimated firing rate (dark curve) and its 95% confidence interval (dashed curve) were plotted for each method overlaid on the theoreticallyapproximated firing rate: (a) The head velocity profiles; The firing rate was estimated using (b). The Kaiser window: Fp = fm, Fs = Fp + 5, ı = 0.001, A = 60 dB. (c) The spike densityfunction using literature values (� = 10 ms at 0.5 Hz and 5 ms at 10 Hz, grey-shaded area) and optimal values (� = 65 ms at 0.5 Hz and 7 ms at 10 Hz). (d) The rate histogram usingliterature values (bin = 50 ms at 0.5 Hz and 2 ms at 10 Hz) and optimal values (bin = 29 ms at 0.5 Hz and 12 ms at 10 Hz). (e) The reciprocal interspike interval (no parameterrequired).

Page 7: Journal of Neuroscience Methods An improved method for the

scienc

ase de

S. Cherif et al. / Journal of Neuro

Table 1Simulation results at 0.5 and 10 Hz (regular)

Estimation method 0.5 Hz

MSE Gain(spikes/s/deg/s)

Mean firingrate (spikes/s)

Ph

Theoretical 0 1 100 0Kaiser window 31.69 0.90 (±0.0003) 95.20 (±0.009) 0Spike density 34.81 0.88 (±0.0003) 95.19 (±0.01) 0Rate histogram 34.43 0.90 (±0.002) 95.38 (±0.07) 0Reciprocal ISI 32.28 0.90 (±0.002) 95.461 (±0.052) 0

95% confidence intervals are shown in brackets.

3.3. Simulation results

Before looking at real data, it is important to study the perfor-mance of each method with controlled simulated data. A majoradvantage of simulations is the ability to objectively comparethe estimated firing rate against an expected value. Indeed, theexpected firing rate of the IPFM spike train in response to a single-harmonic is (Gu et al., 2003):

frtheoretical = 1T

[m0 + m1 × cos(2�fmt + �)] (5)

Fig. 3 shows firing rate estimates from the different methodsobtained using simulated spike trains in response to sinusoidalrotations at low and high frequencies (fm = 0.5 and 10 Hz) and aspike carrier frequency (f0 = m0/T) of 100 spikes/s. The grey-shadedarea in panel c and d correspond to the estimates using literaturevalues while the white area corresponds to the optimal estimateswith parameters designed to minimize the MSE with respect tothe response expected in theory (see Section 2.2 in Methods). Thefirst observation is that estimates with optimal values outperformthose found in the literature. This may be explained by the lack ofan objective reference against which to validate rate estimates inexperimental studies, which forces parameters to be selected sub-jectively by trial and error or based on past experience. In orderto represent the full potential of each approach, we focus belowprimarily on results obtained with optimal parameter values (seeSupplemental Table 1).

The implications of the simulation results, detailed in Table 1and Fig. 3, show unequivocally that the performance of the Kaiserwindow method is superior when compared with the other meth-ods at both low and high frequencies. This approach yielded thebest quality of fit (lowest MSE), the closest gain, the most consis-

tent mean firing rate estimate, as well as no phase distortion (seeTable 1). In addition, the approach produced relatively narrow 95%confidence intervals on the firing rate estimates (dotted curves inFig. 3) which encompass most of the theoretical firing rate exceptat the maximal peaks. The small attenuation at the peaks is anexpected result of the relatively low sampling rate of the origi-nal spike train (see Supplemental Fig. 2). Note that the choice ofa 1 KHz sampling rate in the present paper is motivated by theapproach used by the target community; sampling rates at this fre-quency (or lower) are most commonly used in the laboratory forthe acquisition of real experimental data.

The improved performance of the Kaiser window is moremarked at the higher (10 Hz) than lower (0.5 Hz) test frequen-cies. Estimates obtained using the spike density function, were onlyslightly attenuated from the theoretical value at 0.5 Hz, but at 10 Hzgain attenuation becomes significant (see Table 1) due to the filter’slack of passband, as well as to its wide transition band which resultsin carrier frequency harmonic corruption (or aliasing). Moreover,the decrement in performance would have been even greater hadwe used the parameter values which are commonly employed inthe literature (see shaded areas of panel c). Finally, it is important to

e Methods 173 (2008) 165–181 171

10 Hz

lay (◦) MSE Gain(spikes/s/deg/s)

Mean firing rate(spikes/s)

Phase delay (◦)

0 1 100 030.39 0.90 (±0.008) 95.52 (±0.23) 048.21 0.82 (±0.008) 95.51 (±0.22) 0

112.65 1.00 (±0.048) 95.50 (±1.37) 0415.10 0.63 (±0.087) 97.80 (±2.47) 39.6

note that if the resting and test frequencies had been closer in thesimulated spike train, the observed aliasing would have been evenmore significant. An alias-free filtering method which maximizesnoise reduction and preserves the signal is, therefore, essential, ascharacterized by the Kaiser method.

Compared to the other methods, the estimate provided by therate histogram had the largest 95% confidence interval particularlyat the higher frequency (Fig. 3d). This method is particularly sensi-tive to small trial-to-trial variations especially near bin edges. Whileit performs reasonably well at the lower frequency, the quality offit drops sharply at 10 Hz (significantly higher MSE) even thoughthe signal estimate was averaged over 20 realizations of simula-tion. The extremely poor performance using the literature values isthe result of the choice of the bin size (2 ms at 10 Hz) which is nar-row compared with the sampling precision (1 ms). However, evenwith the optimal bin size (12 ms at 10 Hz), the method still performspoorly (high MSE, and an overestimated gain, see Table 1).

Finally, the use of simulated spike trains clearly shows thelimitations of the performance of the reciprocal interspike inter-val relative to the Kaiser window; this method’s nonlinear noisesensitivity is evident at lower frequencies (noisier peaks, smoothervalleys), and its nonlinear-phase delay is most marked at higherfrequencies (see Fig. 3e). Notably at 10 Hz, the overall phase shiftis considerable (39.6◦, see Table 1), and the resulting curve is adistorted sine wave with a significantly underestimated gain andoverestimated bias (compared to the Kaiser estimate).

In order to better appreciate the improvement brought by theKaiser window method, it is useful to consider these results in thefrequency domain. While all methods behave as more or less ideallow-pass filters, there are some notable differences which becomemore obvious with increasing frequency (see Supplemental Fig. 3).At 10 Hz, the spike density function not only produces an attenuated

estimate (compared with the theoretical value), but also introducesa considerable amount of noise. The frequency domain representa-tion further shows that the estimate yielded by the rate histogramincludes large harmonic components that result from its sharpcorners (i.e., nonlinearities arising from its ‘staircase’ structure).Finally, the reciprocal interspike interval estimate also introducessignificant noise and is characterized by large harmonics (due to itsnonlinear nature), as well as an attenuated estimate of the actualmodulation frequency (as computed in Table 1). In contrast, theproposed Kaiser window almost exclusively passes the modulatingfrequency fm, consistent with its improved time-domain perfor-mance as shown in Fig. 3.

3.4. Experimental results

Using all the aforementioned methods, the firing rates of twoexample vestibular afferent neurons were next estimated; one ‘reg-ular’ afferent whose discharge at rest had a variability similar to thatof the simulated spike train analyzed above (Fig. 3) and one ‘irreg-ular’ afferent which had a greater interspike interval variability at

Page 8: Journal of Neuroscience Methods An improved method for the

172 S. Cherif et al. / Journal of Neuroscience Methods 173 (2008) 165–181

Fig. 4. Experimental results—regular afferents. Firing rate estimates for a regular horizontal canal afferent cell (CV* = 0.05) responding to low-frequency (fm = 0.5 Hz, leftcolumn) and high-frequency (fm = 10 Hz, right column) head rotation. In each plot, the dark curve shows the estimated firing rate, and the grey curve shows the Kaiserestimate used as a reference for the other methods. Grey-shaded areas show estimates from a single trial while the right half of each plot shows estimates obtained byaveraging across (8) trials. (a) Head velocity stimuli: 0.5 Hz 80 deg/s, right and 10 Hz 100 deg/s, left. Firing rate estimates were produced (with optimal values only) using (b).The Kaiser window: Fp = fm, Fs = Fp + 5, ı = 0.001, A = 60 dB. (c) The spike density function: � = 65 ms at 0.5 Hz and 7 ms at 10 Hz. (d) The rate histogram: bin = 29 ms at 0.5 Hzand 12 ms at 10 Hz and (e) the reciprocal interspike interval.

Page 9: Journal of Neuroscience Methods An improved method for the

scienc

hase

.76

.76

.12

.14

S. Cherif et al. / Journal of Neuro

Table 2Experimental results for a regular afferent at 0.5 Hz

Estimation method Single trial

MSE Gain(spikes/s/deg/s)

Mean firing rate(spikes/s)

P

Kaiser window 0 0.48 (±0.002) 102.92 (±0.090) 5Spike density 1.01 0.46 (±0.0017) 102.92 (±0.086) 5Rate histogram 144.3 0.48 (±0.0105) 102.94 (±0.545) 6Reciprocal ISI 33.91 0.48 (±0.006) 103.26 (±0.285) 4

95% confidence intervals are shown in brackets.

rest. Given that experimental data inherently lack a theoretical (orexpected) value to assess the performance of the various methods,an alternate ‘gold-standard’ was required to compare the firing rateestimates provided by each approach. For this purpose, we electedto use the Kaiser method, because as was shown in the simula-tions above, this method provides the best alias- and distortion-freefiring rate estimates.

3.4.1. Regular afferentSome previously used methods estimate the “instantaneous”

firing rate over a single realization, while others rely on averag-ing across trials to obtain a “mean” firing rate. Below we considerthe four methods under both scenarios. Results of these anal-yses are shown in Fig. 4, and described in Tables 2 and 3 forthe low-frequency (0.5 Hz) and higher-frequency (10 Hz) stimuli,respectively.

Consistent with our simulations results, the Kaiser method pro-vided estimates with the highest gains and the most consistentmeans (low s.d.) when applied to experimental data from either0.5 Hz or 10 Hz rotations. This latter finding is consistent with previ-ous work concluding that regular neurons are linear over this range

of stimulation (e.g., Sadeghi et al., 2007a). Averaging had little effecton these estimates (in Tables 2 and 3), indicating that analysis of asingle trial was sufficient to recover the stimulus-driven neuronalmodulation (compare the gray and unfilled intervals in Fig. 4). Incontrast, while the spike density function performed relatively wellat 0.5 Hz, at higher frequencies (10 Hz) it suffers both from increas-ing noise (due to its wide transition band, higher MSE and widerconfidence intervals in Table 3) as well as amplitude attenuation(lower gain) due to its lack of passband. Averaging reduced the noisebut did not recover the loss in gain. In fact, averaging revealed theextent of the attenuation produced by this method (0.3 comparedto 0.5), which otherwise would be masked or overestimated in thepresence of noise.

The rate histogram and the reciprocal interspike interval meth-ods performed even worse for a single realization relative to theproposed Kaiser method. Averaging across trials was required par-ticularly at higher frequencies, where the resulting quality of fit wasparticularly poor (very high MSE): this implies that the associatedparameters (in Table 3) for the estimated firing rate are unreliable.In the case of the rate histogram, averaging significantly improvedthe quality of fit at low frequencies, but continued to provide poor

Table 3Experimental results for a regular afferent at 10 Hz

Estimation method Single trial

MSE Gain(spikes/s/deg/s)

Mean firing rate(spikes/s)

Phase l

Kaiser window 0 0.55 (±0.028) 103.25 (±2.028) 14.4Spike density 57.11 0.52 (±0.033) 103.08 (±2.464) 14.4Rate histogram 890.7 0.58 (±0.092) 103.87 (±6.791) 21.6Reciprocal ISI 933.5 0.53 (±0.066) 107.50 (±4.787) −21.6

95% confidence intervals are shown in brackets.

e Methods 173 (2008) 165–181 173

Average over multiple trials

lead (◦) MSE Gain(spikes/s/deg/s)

Mean firing rate(spikes/s)

Phase lead (◦)

0 0.413 (±0.011) 102.60 (±0.589) 4.681.06 0.398 (±0.011) 102.603 (±0.568) 4.68

15.28 0.413 (±0.012) 102.542 (±0.619) 4.686.28 0.409 (±0.012) 102.90 (±0.636) 2.88

fits at 10 Hz (MSE = 500). Estimates provided by the reciprocal inter-spike interval were particularly noisy at the peaks of each sinusoidand estimated a longer phase lag in the valleys (36◦ relative to theKaiser estimate at 10 Hz). While averaging slightly improved thequality of fit (MSE = 789 vs. 933), the method continued to providebiased gain, mean, and phase estimates for the neuronal modula-tion (see Table 3).

3.4.2. Irregular afferentIt is not uncommon that estimates produced by the current

methods require either averaging and/or least-square regressionfit to obtain a robust (less noisy) representation of firing rate, butthere are penalties. First, the approach of averaging considers anyvariation in firing rate across trials to be noise. In addition, perform-ing a least-square regression to fit the ‘noisy’ data effectively forcesthe firing rate signal to be a (linearly) scaled version of the input(plus a bias). While the assumption of linearity is appropriate forIPFM simulations and appears to be valid for the regular afferentsin Fig. 4, it does not necessarily hold in all cases. This can be appre-ciated by considering the discharge properties of a second class ofvestibular afferent, whose baseline (or resting) firing rate is less reg-

ular. Fig. 5 shows experimental results obtained with an exampleirregular afferent cell (CV* = 0.44) that was stimulated with a singlesinusoid at 0.5 Hz. Detailed results are summarized in Table 4. Forthis neuron, relatively noisy estimates are provided by the recip-rocal interspike interval and the rate histogram (MSE = 1249 and968.3, respectively) and to a lesser extent by the spike density func-tion (MSE = 12.37). With the two former techniques, we are forced toaverage across trials and/or fit a regression curve to obtain a robustestimate of the firing rate (i.e., smaller confidence intervals). This isin sharp contrast with the Kaiser window-based method which waspreviously shown not to require averaging (see Fig. 4b). Therefore,the discrepancy observed in the Kaiser estimate of Fig. 5b (withand without averaging) is more likely to indicate the presence ofgenuine temporal information rather than noise. Averaging a time-varying signal would explain the change in bias and gain found withthe Kaiser window method in Table 4 before and after averaging.

3.5. More complex inputs and nonlinear responses

Thus far, we have focused on the performance of the Kaiserwindow when the stimulation profile was a single-harmonic. This

Average over multiple trials

ead (◦) MSE Gain(spikes/s/deg/s)

Mean firing rate(spikes/s)

Phase lead (◦)

0 0.52 (±0.040) 104.13 (±2.922) 14.427.62 0.29 (±0.089) 104.17 (±6.531) 14.4

500.10 0.27 (±0.125) 108.50 (±9.211) 7.2789.20 0.53 (±0.049) 109.64 (±3.579) −21.6

Page 10: Journal of Neuroscience Methods An improved method for the

174 S. Cherif et al. / Journal of Neuroscience Methods 173 (2008) 165–181

Fig. 5. Experimental results—irregular afferents. Firing rate estimates for an irregular horizontal canal afferent cell (CV* = 0.44) during rotation at low frequency (fm = 0.5 Hz).Left column: Similar conventions as in Fig. 4, except average estimates were obtained over (5) trials. Right panels: show the actual (5) cycles used in the averaging. Estimatedfiring rates (dark curves) are shown superimposed on the Kaiser estimates (grey curves), used as reference for all methods. (a) The head velocity stimulus (50 deg/s, fm = 0.5 Hz).The firing rate estimates by (b). The Kaiser window: Fp = fm, Fs = Fp + 5, ı = 0.001, A = 60 dB. (c) The spike density function: � = 65 ms (d). The rate histogram: bin = 29 ms. (e) Thereciprocal interspike interval.

Page 11: Journal of Neuroscience Methods An improved method for the

S. Cherif et al. / Journal of Neuroscience Methods 173 (2008) 165–181 175

Table 4Experimental results for an irregular afferent at 0.5 Hz

Estimation method Single trial Average over multiple trials

MSE Gain(spikes/s/deg/s)

Mean firing rate(spikes/s)

Phase lead (◦) MSE Gain(spikes/s/deg/s)

Mean firing rate(spikes/s)

Phase lead (◦)

Kaiser window 0 0.48 (±0.008) 77.59 (±0.28) 17.28 0 0.49 (±0.005) 78.22 (±0.159) 29.34Spike density 12.37 0.47 (±0.009) 77.63 (±0.324) 17.46 4.23 0.48 (±0.006) 78.22 (±0.202) 29.34Rate histogram 968.3 0.48 (±0.041) 77.99 (±1.42) 18.54 35.30 0.49 (±0.010) 78.28 (±0.335) 29.16Reciprocal ISI 1249 0.43 (±0.044) 87.68 (±1.54) 21.96 333.69 0.485 (±0.020) 88.99 (±0.688) 29.16

95% confidence intervals are shown in brackets.

Fig. 6. More complex inputs and nonlinear responses. For simulated data, performance is compared to theoretically approximated firing rates; for experimental data, theKaiser estimate is used as the reference. (a) Simulated and experimental spike trains generated in response to a broadband rotational stimulus (20 deg/s zero-mean whitenoise digitally filtered at 20 Hz). For this case only, the IPFM model was modified to account for the dynamics of vestibular afferents as characterized in the literature (seeAppendix A). Results are shown for: the Kaiser (Fp = fmax = 20 Hz, Fs = Fp + 5, ı = 0.001, A = 60 dB), Gaussian (� = 6 ms) and the reciprocal interspike interval. (b) An exampleof time-varying irregular neural activity, driven by a 4 Hz 50 deg/s sinusoidal head rotation. The firing rate profile of the real neuron was fed as input to the IFPM model(m0 = 100 spikes/s, T = 1) to generate the simulated spike trains. Results are shown for: the Kaiser (Fp = 4 Hz, Fs = Fp + 5, ı = 0.001, A = 60 dB), Gaussian (� = 30 ms), rate histogram(bin = 25 ms) and reciprocal interspike interval. (c) An example burst neuron (whose baseline firing rate is zero during inhibition and 300 spikes/s when it is active) wasrecorded during spontaneous eye saccades. The firing rate profile of the real neuron was fed as an input to the IPFM model (m0 = 300 spikes/s, T = 1) to generate the simulatedspike trains. Results are shown for: the Kaiser (Fp = 30 Hz, Fs = Fp + 30, ı = 0.01, A = 40 dB) and the Gaussian (� = 30 ms) methods.

Page 12: Journal of Neuroscience Methods An improved method for the

scienc

176 S. Cherif et al. / Journal of Neuro

then raises the question: how does this method perform with morecomplex inputs and nonlinear cell responses? In this section wewill consider the cases of a broad bandwidth input profile, a time-varying cell response and a bursting cell response. These scenarioswill be illustrated with different methods of firing rate estimationwhen appropriate in Fig. 6. The right column shows experimentalresults from real spike train recordings at the sampling frequencyfs = 1000 Hz, and the left column shows results from simulated spiketrains at a more optimal sampling frequency (fs = 5000 Hz). The sim-ulations were designed to be as faithful to the real data as possible.Here the predicted theoretical estimations were derived from Eq.(5) such that:

frpredicted = 1T

[m0 + x(t)] (6)

where x(t) is the vestibular input to the vestibular cell; assumingthat the equation for the IPFM model holds for non-harmonic inputsseems to be a reasonable approximation.

3.5.1. Broadband stimulationFig. 6a shows the simulation of a vestibular canal afferent cell

response to a broadband head velocity stimulus (a 20 deg/s stan-dard deviation, zero-mean white noise signal filtered at 20 Hz).For this simulation test a high-pass representation of the sensorycanal with a 5.7 s time constant was used to account for the affer-ent cell dynamics; see (Fernandez and Goldberg, 1971) and Eq.(A.11). The simulation shows that the Kaiser window estimate accu-rately matches the predicted value while the Gaussian windowestimate is much noisier and more attenuated. The experimen-tal data corroborate the simulations, and highlight the particularlypoor performance of the reciprocal interspike interval for stimuliwith high-frequency content.

3.5.2. Time-varying responsesFig. 6b explores the case of a time-varying cell response obtained

from an irregular vestibular canal afferent. The simulation clearlydemonstrates that the Kaiser window perfectly tracks the time vari-ation (as long as this latter is within its passband). On the otherhand, the rate histogram which is an average measure fails to trackany time variability, as expected. The experimental data show thatin order for the spike density function to track the time variability itmust pass a significant amount of noise which makes the estimateless robust then the Kaiser estimate. Finally, the reciprocal inter-spike interval provides a very distorted estimate due to its high and

nonlinear sensitivity to noise.

3.5.3. Bursting cellsFig. 6c considers the case of bursting behaviour, an extreme

case of time variation where a cell is only released to generatespikes intermittently: these simulations mimic the response of aspecific class of central cell (a Burst Neuron), which fires duringan eye saccade and is inhibited otherwise. Its baseline firing rateis zero during inhibition and averages ∼250 spikes/s when it isactive (Cullen and Guitton, 1997; Sylvestre and Cullen, 2006). Twomain observations can be made. First, the simulation demonstratesthat the Kaiser window is the best estimator even in the case of aburst neuron while the Gaussian window smooths and attenuatesthe expected value. Second, this figure is a good illustration of theGibbs phenomenon (rippling effect around sharp transitions) lim-itation suffered by the proposed method. While the ripples resultin a zero crossing, it is important to note that this edge effect ispart of a transient region at the beginning and end of active peri-ods. Transient regions with or without oscillations are present in allfiltering methods, including the Gaussian window. Such transientintervals should be discarded regardless of the window function

e Methods 173 (2008) 165–181

used, and their length will depend on the filter’s window size (seeSection 2). Thus, when used appropriately the Kaiser approach cantrack and preserve genuine information encoded by the burst cellwhich would be inaccessible or more heavily smoothed in estimatesobtained using present methods.

4. Discussion

In this study, we show that the Kaiser filter is an ideal choicefor the estimation of neuronal firing rate, overcoming many lim-itations inherent to prior methods including: the rate histogram,the reciprocal interspike interval and the spike density function.Kaiser filter windows are used extensively in signal processing byengineers and they have been applied to study some biomedi-cal signals, such as heart rate variability (Seydnejad and Kitney,1997). However, they have never to our knowledge been explic-itly used to estimate neural firing rates. Firing rate estimates forboth simulated and real spike trains were computed to comparefiltering methods. For both data sets, our Kaiser window-basedmethod consistently outperformed currently used methods par-ticularly at higher frequencies. Robust estimates of firing rate wereobtained which were characterized by minimal aliasing, phase andamplitude distortion when compared to the conventionally usedapproaches.

An important advantage of the Kaiser-based approach is the abil-ity to directly tune the filter characteristics in the frequency domain.This allows the user to design the Kaiser window to account forthe specific characteristics of the sensory stimulus and/or motorbehaviour and ensure optimal signal preservation. In contrast, theoptimal parameter values for the spike density and/or rate his-togram methods will not only vary with the frequency of the inputsignal used, but also with its peak-to-peak amplitude. Thus, whileit is theoretically possible to compute an optimal value, it is by nomeans practical, especially for general non-harmonic signals. Thislimitation of prior methods is evident in previous literature wherethe window properties can vary greatly as a function of experi-mental protocol. While the reciprocal interspike interval methodcircumvents this problem – since no parameters are required – aninherent limitation of this method is its high sensitivity to noiseand a significant phase distortion. Taken together, our results showthat the Kaiser-based approach permits more robust estimates ofneural dynamics than conventional techniques across all stimulusconditions. Below we further discuss the implementation of our

method in practice, and its use in fitting responses evoked by morecomplex non-periodic stimulation profiles.

4.1. Guidelines for the Kaiser window design

The design of an optimal Kaiser window for a given spike traindepends not only on the nature of the stimulus but also on theresting rate of the cell. For a fixed transition bandwidth �f, thepassband can be set independently without affecting the order ofthe filter (i.e., the length of its impulse response). If a neuron has amean firing rate f0, the stopband frequency Fs of the filter shouldbe set such that it is smaller than the leftmost sideband harmonic(refer to Fig. A.1c); and the passband frequency Fp should includethe input bandwidth and potential harmonics due to cell nonlinear-ities. Fp will depend on the stimulus (complex vs. single-harmonic),and expected response (linear vs. nonlinear).

More specifically, optimizing the Kaiser window performancerequires:

(1) A priori information about the resting rate of the cell f0 andpotential nonlinearities.

Page 13: Journal of Neuroscience Methods An improved method for the

scienc

S. Cherif et al. / Journal of Neuro

(2) Knowledge of the maximum frequency (fmax) present in thestimulus bandwidth.

(3) Selection of the passband frequency Fp such that it includes fmax

and any potential higher harmonics (in the case of responsenonlinearities) when activated.

(4) Selection of the stopband frequency Fs such that it excludesthe lowest sideband harmonic. A minimum requirement is thatFs < f0 − fmax.

In addition, the computation of firing rate estimates should belimited to responses larger than ∼3 spikes/s since below this levelspikes are spaced too far apart for useful (robust) estimates duringconvolution with either spike density or Kaiser windows (see alsoSection 4.4 below).

4.2. Accounting for nonlinear cell dynamics

While the simulations performed in our analysis implicitlyassumed linear neuronal behaviour, it is important to emphasizethat the Kaiser window-based method is also valid for the anal-ysis of nonlinear cell dynamics. In this case, however, knowledgeabout the nature of the nonlinearity is critical. For example, con-sider a case in which the nonlinearity can be described using a purequadratic. The neuron’s stimulus-driven firing rate would includesignificant modulation both at the frequency of the input (fm), aswell as a harmonic at twice that frequency (2fm). Thus, in thiscase the passband frequency of the filter should be extended suchthat Fp ≥ fm. As a result of the quadratic nonlinearity, the avail-able stimulus bandwidth would then be reduced to half of what itsvalue would have been for a purely linear neuron (see Fig. A.1c).Thus, in the case of neurons with nonlinear responses, aliasingof the rate estimate will more easily occur when the stimulationfrequency is increased unless the transition band is appropriatelyadjusted.

4.3. Tracking time-varying modulations

An advantage of the Kaiser window is its ability to track onlinetime-varying modulations or drifts in the firing rate baseline (car-rier). This can be achieved with a relatively short window sizeand yet result in a minimal amount of noise in the estimate (e.g.,Fig. 6c). Time-dependent modulation in firing rate will be faith-

fully tracked by the Kaiser window-based representation, since thismethod offers direct control over its frequency domain parame-ters. Thus, as long as the highest expected frequency present inthe signal lies within the passband (Fp ≥ fmax) it will be preserved.In contrast, many conventional techniques rely on averaging toprovide robust estimates. Thus any time-dependent modulationis considered as noise resulting in the loss of genuine informa-tion encoded by the cell. Firing rate estimates can be producedby the commonly used techniques that do not require averaging,but these can be very noisy (see, for example, Fig. 5) such thatthey severely limit the user’s ability to discriminate any varia-tion in the signal from the noise. Thus, an additional advantageof the Kaiser window approach is that a single pass allows trackingof time-varying signals. The experimenter in subsequent analysisdecides what component of the estimated firing rate is related tothe stimulus, vs. what can be considered as ‘noise’ (with respect tostimulus) based on regression with alternative models. Accordingly,the Kaiser-based approach does not require excluding variationsup-front as would more biased methods that force de-facto linearand time-invariant characteristics to achieve robust estimates withaveraging.

e Methods 173 (2008) 165–181 177

4.4. Carrier frequency and bandwidth

Having designed an optimal Kaiser window based on the con-siderations detailed above (Section 4.1), there are several pointsto consider regarding its actual implementation. First, it is neces-sary that the frequency of the stimulus be well separated from thecarrier frequency of the cell, or some of its information will be irre-versibly lost. It is important to note that this is true for all methodsof firing rate estimation, not just Kaiser-based analysis. Second, anyfiring rate estimate below a minimum level will be meaninglesswhether it is obtained with a Kaiser, Gaussian or any other kernel-based approach. For example, if a Kaiser window is convolved witha train of sparse (or isolated) spikes, the firing rate estimate can rip-ple around zero and even return negative values due to the shapeof its impulse response function (Fig. 2). Similarly, the Gaussianestimate has the undesired property of rounding fast transitions(e.g., sparse spikes) into broad bell-shapes. In general, density esti-mates should not be computed from a small (or isolated) numberof samples (see also Silverman, 1986), regardless of the choice ofkernel.

An additional point is that the average discharge of a givenneuron will often not be equivalent to its carrier frequency onceactivated. For example, during saccadic eye movements, oculo-motor burst neurons in the midbrain superior colliculus and/orbrainstem have firing rates reaching levels of 700–800 spikes/s(Cullen and Guitton, 1997; Sylvestre and Cullen, 2006). In contrast,the average or ‘resting’ discharge (i.e., between saccades) of thesesame neurons can be close to zero. The analysis of these and other‘switching’ cells indicates the existence of a bias term (or carrierfrequency) around which discharges are modulated when the neu-ronal response is released (e.g., ∼200–250 spikes/s for brainstemsaccadic neurons (Cullen et al., 1996; Cullen and Guitton, 1997).This bias firing rate (as opposed to the mean firing rate) is the crit-ical factor in determining the available response bandwidth of thecell, and so is commonly included in models of the burst generator(Scudder, 1988; Van Gisbergen et al., 1981). Thus, for such neuronsthe bias or resting activity level f0, used in filter design, is effec-tively a set point which can be masked by a balanced inhibitorydrive during inactive periods.

A similar approach can be applied to the analysis of neurons inother sensory and/or motor pathways. For example, in the process-ing of auditory information, it is well known that the mammalianinner ear decomposes sound into spectral information. However,more recent recordings in central auditory pathways of alert ani-

mals have shown that this rate-place code (which conveys spectralinformation) is complemented by a temporal code. Notably, neu-rons in the auditory cortex produce sustained responses, but onlywhen driven by stimuli with preferred patterns of temporal mod-ulation (Lu et al., 2001; Wang et al., 2005). While such resultssuggest that neuronal responses provide a representation of time-varying acoustic signals, further work is required to understandhow temporal variations in firing rate are used to represent time-varying sound stimuli. Robust spike rate estimation is essential forthis.

Finally, it may be tempting to design a Kaiser window with aclose-to-ideal (rectangular) frequency selectivity, at the cost of awider window. It is important to note that a high filter order (width)is only acceptable in cases where it is possible to discard long seg-ments of data, since longer transient intervals will be introduced atthe beginning and end of active periods. Also, a higher filter orderwill produce more ringing near fast transitions or corners (i.e., theGibbs Phenomenon). Thus, the choice of a higher filter order is notappropriate for the analysis of bursting neurons, with short inter-vals of activity. For the analysis of sustained neural activity over longperiods (relative to filter width), a potential solution to the ringing

Page 14: Journal of Neuroscience Methods An improved method for the

scienc

178 S. Cherif et al. / Journal of Neuro

problem is to smooth the estimated firing rate using a boxcar filterwhose width is equal to the period of the ringing. This is known asLanczos smoothing (Hamming, 1989).

4.5. Future work

In this study, we applied a novel method to estimate firing ratesof neurons that were characterized by continuously discharging(or single-mode) or bursting responses. First, we considered thespike train data obtained from first-order sensory neurons in thevestibular system. For these neurons, neither ringing nor transientregions were a concern. In addition, we applied our method to esti-mate firing rates of the central neurons that drive saccadic eyemovements by producing bursts of action potentials. Here, tran-sient regions were a concern, and minimized to avoid discardingtoo much data in subsequent analysis. It is important to note thatmany central neurons exhibit even more complex firing patternsand can show switching (or multi-mode) behaviour. For example,some central neurons to which the vestibular afferents project tog-gle between independent modes with sharp and sudden transitionsin cell activity (e.g., ‘Position-Vestibular-Pause’ cells of the vestibu-lar nuclei reviewed in (Cullen and Roy, 2004). These central neuronsare modulated during the slow phase mode (slow eye movements)and can pause (or cease) their activity during the fast phase mode(rapid eye saccades). In order to obtain firing rate estimates for suchneurons, the filter order must be carefully selected to preserve neu-ronal responses in a desired bandwidth, with minimal transientregions. Further work is needed to explore optimal approaches forthe analysis of such multi-mode neurons, and then evaluate therepercussions on predicted dynamics.

Acknowledgments

We thank S. Sadeghi for providing the vestibular afferent dataand for his helpful discussions and J.I. Boutin for his initial workon this topic. This work was supported by the Canadian Institutesof Health Research (K.E.C., H.L.G.) and the Canadian Space Agency(K.E.C).

Appendix A. Appendix

A.1. The Kaiser window method

The Kaiser window time-domain function is defined as follows

(Kaiser, 1974; Oppenheim et al., 1999):

wK[n] =

⎧⎨⎩

I0

(ˇ√

1 − ((2n/M) − 1)2)

I0(ˇ)0 ≤ n ≤ M

0 otherwise

(A.1)

where I0 denotes the zero-order modified Bessel function of thefirst kind, M is window length, ˇ is the shape parameter and n isthe time sample. The main advantage of the Kaiser window is thatit has two independent parameters M and ˇ, which makes it moreflexible than the conventional windows. This translates, in the fre-quency domain, into the ability to set the filter’s cut-off frequencyindependently of the window size (width in sample numbers).

Kaiser (1974) produced a set of formulae to fine-tune the fil-ter response directly in the frequency domain and deduce thecorresponding values of M and ˇ that best meet the desired fre-quency specifications. These latter are defined in terms of (refer toFig. A.1c):

(a) The passband ripple ı: the maximum ripple tolerated in thepassband.

e Methods 173 (2008) 165–181

(b) The stopband attenuation A: the minimum attenuation desiredin the stopband in dB.

(c) The passband frequency Fp: the highest frequency such that|H(f)| ≤ 1 + ı in the passband, and |H(f)| is the gain of the filteras a function of frequency.

(d) The stopband frequency Fs: the lowest frequency such that20 log10{|H(f)|}≤ −A.

Fp and Fs delimit the transition band (�f = Fs − Fp) where the gainof the filter gradually decays from 0 to A decibels. Given the abovespecifications, M and ˇ can be obtained directly using Eqs. (1) and(2) in the Section 2. Kaiser based his solution on an energy crite-rion, that maximizes the energy in the main lobe (passband) withrespect to the total energy in the side lobes (rejection), and usedthe simplifying condition A = −20 log10ı.

A.2. The Kaiser filter design

For off-line analysis, the simplest way to design a practicallyfeasible digital filter h[n] is by means of the Windowing Method(Oppenheim et al., 1999). This consists of truncating the infinitelylong ideal sinc function hd[n] with a window function in time toobtain a finite impulse response (FIR) approximation of the idealfilter:

h[n] = hd[n]w[n] (A.2)

h[n] = sin[2�(fc/fs)(n − (M/2))]2�(fc/fs)(n − (M/2))

w[n] (A.3)

where M is the window length, fc is the cut-off frequency of the sincfunction and fs is the sampling frequency. When w[n] is a Kaiserwindow Eq. (A.2) becomes:

h[n] =

⎧⎨⎩ sin(2�(fc/fs)(n − (M/2)))

2�(fc/fs)(n − (M/2)).

I0

(ˇ√

1 − ((2n/M) − 1)2)

I0(ˇ)0 ≤ n ≤ M

0 otherwise(A.4)

where fc = (Fp + Fs)/2 and I0(n) = 1 +∑∞

k=1

[((n/2)k)/k !

]2

(Oppenheim et al., 1999).

A.3. Firing rate estimation from spike trains

One way to estimate the firing rate is to convolve or (low-passfilter) the spike train with the appropriate filter (kernel) function.More specifically, the spike train function can be described in termsof a Dirac ı function:

x[n] =K∑

i=1

ı[n − ni] (A.5)

where ni is the time of occurrence of the ith spike; i = 1, 2, . . ., K fora total of K spikes. The operation of FIR filtering using Eq. (A.5) andEq. (3) (from Section 2) yields:

y[n] =M∑

i=1

h[n − ni] (A.6)

where y[n] is the estimated continuous firing rate, at the currentsampling frequency. This filtering process is equivalent to replacingeach spike with the impulse response function h[n]. If the windowis symmetric then it introduces a linear group delay equal to M/2,which can be nulled by simple time shift or by forward–backwardfiltering (see Section 2).

Page 15: Journal of Neuroscience Methods An improved method for the

S. Cherif et al. / Journal of Neuroscience Methods 173 (2008) 165–181 179

Fig. A.1. Firing rate estimation by low-pass filtering. (a) Block diagram of the IPFM model describing the model function. The IPFM integrates the incoming signal m1(t)after adding a DC bias m0. Once the threshold value T is reached, the model fires a spike and resets the integrator. (b) The theoretical frequency content of the pulse traingenerated by the IPFM model: it contains a spike at the modulating frequency fm and high-frequency harmonics with sidebands around the carrier frequency f0 (or meanfiring rate) of the cell. I is the area under the pulse and J0 is the zero-order Bessel function of the first kind (Bayly, 1968). (c) For optimal firing rate estimation, a filter musthave a flat passband all the way up to at least the input frequency fm, and a sharp transition band excluding the higher frequency components and sidebands. (d) Illustratesthe improved frequency characteristics of the Kaiser method over the Gaussian (or spike density function), when the stimulus has a rich bandwidth (0–20 Hz). The Kaiserwindow: Fp = fmax = 20 Hz, Fs = Fp + 5, ı = 0.001, A = 60 dB. The spike density function: � = 6 ms. (see text in Appendix A). In (c) and (d) the y-axis units are different (power vs.gain) and so the scales are normalized for comparison purposes only.

Page 16: Journal of Neuroscience Methods An improved method for the

scienc

180 S. Cherif et al. / Journal of Neuro

A.4. Other methods: spike density function, rate histogram, andreciprocal interspike interval

The spike density function f[n] estimates the firing rate by con-volving the spike train x[n] with a Gaussian kernel function wG[n].After shifting for the time delay, the kernel function is a zero-meannormally distributed probability density function (PDF) with a stan-dard deviation �:

wG[n] ={

1√2��2

e−1/2((n−(M/2))/�)20 ≤ n ≤ M

0 otherwise(A.7)

where the window length M is equal to 5 times the standard devi-ation on each side of the window center (i.e., the length parameterM = 10*�). The resulting window is normalized for unit area. A con-volution with this symmetric causal filter will introduce a groupdelay of M/2 which can be dealt with by appropriate shifting ordouble-sided filtering (see Section 2).

In the rate histogram method, similar MSE methods havebeen proposed to minimize the estimation error (Shimazaki andShinomoto, 2007), however, for the purposes of this study we chosethe approach most commonly used by the neuroscience commu-nity: each cycle is divided into a sequence of equally spaced timebins, and the average number of spikes within each bin is com-puted, over 1 or multiple trials. This average value is then assignedto all the samples within the bin which results in a quantized (orhistogram) curve for a given stimulus.

The rate histogram function is equivalent to convolving the spiketrain with a rectangular window, with large time steps:

wR[n] ={

1 1 ≤ n ≤ M0 otherwise

(A.8)

The window is applied to the spike train in time steps equalto the window width, and the results are scaled by fs/M to obtainspikes/s. Holding each result for M/fs sec until the next estimateproduces the characteristic staircase profile of binned spike rates.

The reciprocal interspike interval method is implemented bycomputing the inverse of the time interval between consecu-tive spikes and assigning this value to the middle of the interval(Dickman and Correia, 1989; Shaikh et al., 2004). A piecewise cubicfunction is used to interpolate the data and connect the points. Thismodel is very straightforward to implement, since no parameteroptimization is required.

A.5. Spike train simulation model

The IPFM model function is described in the block diagram ofFig. A.1a: the modulating signal m1(t) is integrated after adding aDC bias m0. After the threshold value T is reached, the model fires aspike and resets the integrator. Bayly (1968) studied the output ofthis model in response to a sine wave input:

m1(t) = m1 cos(2�fmt + �) (A.9)

He showed that the spectral content of the resulting spiketrain has a component at the frequency of the input fm as wellas high-frequency components and sidebands around multiples ofthe carrier frequency (or mean firing rate) f0; refer to Fig. A.1b. Thissuggests that if the resting rate of the cell f0 is high enough and ifthe stimulus frequency fm is relatively low, then a scaled value ofthe original signal (assumed to be the firing rate) can be recoveredusing a low-pass filter. The expected firing rate of the IPFM spiketrain in response to a single-harmonic is (Gu et al., 2003):

frtheoretical = 1T

[m0 + m1 × cos(2�fmt + �)] (A.10)

e Methods 173 (2008) 165–181

To obtain a realistic broadband response in the test of Fig. 6A,the IPFM spike train simulator was preceded by a transfer functionmodule to account for the dynamics of the vestibular afferents asdescribed by Fernandez and Goldberg (1971):

Hc(s) = frhhv

= s(1 + 0.015s)(1 + 5.7s)(1 + 0.003s)

(A.11)

where Hc(s) is the frequency response of the horizontal canal affer-ents when the input is the horizontal head velocity (hhv) and theoutput is the firing rate (fr). {s = jω is the continuous Fourier domainfrequency.}

The gain of the transfer function was scaled such that thesimulated firing rate output would be comparable to that of theexperimental data. (Note that the transfer function module is notnecessary with the single sinewave inputs, since the effect of theneuron dynamics on a single-harmonic is merely scaling and timeshifting).

Appendix B. Supplementary data

Supplementary data associated with this article can be found,in the online version, at doi:10.1016/j.jneumeth.2008.05.021.

References

Adrian ED, Zotterman Y. The impulses produced by sensory nerve endings: Part 3.Impulses set up by touch and pressure. J Physiol 1926;61:465–83.

Bayly EJ. Spectral analysis of pulse frequency modulation in the nervous systems.IEEE Trans Biomed Eng 1968;15:257–65.

Bialek W, Rieke F, de Ruyter van Steveninck RR, Warland D. Reading a neural code.Science 1991;252:1854–7.

Cullen KE, Guitton D. Analysis of primate IBN spike trains using system identifica-tion techniques. I. Relationship to eye movement dynamics during head-fixedsaccades. J Neurophysiol 1997;78:3259–82.

Cullen KE, Rey CG, Guitton D, Galiana HL. The use of system identification tech-niques in the analysis of oculomotor burst neuron spike train dynamics. J ComputNeurosci 1996;3:347–68.

Cullen KE, Roy JE. Signal processing in the vestibular system during active versuspassive head movements. J Neurophysiol 2004;91:1919–33.

Dickman JD, Correia MJ. Responses of pigeon horizontal semicircular canal afferentfibers. I. Step, trapezoid, and low-frequency sinusoid mechanical and rotationalstimulation. J Neurophysiol 1989;62:1090–101.

Fernandez C, Goldberg JM. Physiology of peripheral neurons innervating semicir-cular canals of the squirrel monkey. II. Response to sinusoidal stimulation anddynamics of peripheral vestibular system. J Neurophysiol 1971;34:661–75.

French AS, Holden AV. Alias-free sampling of neuronal spike trains. Kybernetik1971;8:165–71.

Goldberg JM, Smith CE, Fernandez C. Relation between discharge regularity andresponses to externally applied galvanic currents in vestibular nerve afferents

of the squirrel monkey. J Neurophysiol 1984;51:1236–56.

Gu YY, Zhang YT, Ma T. 2003. A theoretical analysis of neural firing rate functionbased on an integral pulse frequency modulation model. IEEE EMBS Asian-PacificConference on:144-145.

Hamming RW. Digital filters. Englewood Cliffs, NJ: Prentice-Hall; 1989.Haque A, Angelaki DE, Dickman JD. Spatial tuning and dynamics of vestibular semi-

circular canal afferents in rhesus monkeys. Exp Brain Res 2004;155:81–90.Hullar TE, la Santina CC, Hirvonen T, Lasker DM, Carey JP, Minor LB. Responses of

irregularly discharging chinchilla semicircular canal vestibular-nerve afferentsduring high-frequency head rotations. J Neurophysiol 2005;93:2777–86.

Hullar TE, Minor LB. High-frequency dynamics of regularly discharging canal affer-ents provide a linear signal for angular vestibuloocular reflexes. J Neurophysiol1999;82:2000–5.

Kaiser JF. Nonrecursive digital filter design using the Io-sinh window function. In:Proc. 1974 IEEE int. symp. circuit theory; 1974. p. 20–3.

Lu T, Liang L, Wang X. Temporal and rate representations of time-varying signals inthe auditory cortex of awake primates. Nat Neurosci 2001;4:1131–8.

Oppenheim AV, Schafer RW, Buck JR. Discrete-time signal processing. Prentice Hall;1999.

Parzen E. On estimation of a probability density function and mode. Ann Math Statist1962;33:1065–76.

Paulin MG. Digital filters for firing rate estimation. Biol Cybern 1992;66:525–31.Ramachandran R, Lisberger SG. Transformation of vestibular signals into motor

commands in the vestibuloocular reflex pathways of monkeys. J Neurophysiol2006;96:1061–74.

Richmond BJ, Optican LM, Spitzer H. Temporal encoding of two-dimensional pat-terns by single units in primate primary visual cortex. I. Stimulus-responserelations. J Neurophysiol 1990;64:351–69.

Page 17: Journal of Neuroscience Methods An improved method for the

S. Cherif et al. / Journal of Neuroscienc

Rieke F, Warland D, de Ruyter van Steveninck R, Bialek W. Spikes: exploring theneural code. MIT Press; 1997.

Sadeghi SG, Chacron MJ, Taylor MC, Cullen KE. Neural variability, detectionthresholds, and information transmission in the vestibular system. J Neurosci2007a;27:771–81.

Sadeghi SG, Minor LB, Cullen KE. Response of vestibular-nerve afferents to active andpassive rotations under normal conditions and after unilateral labyrinthectomy.J Neurophysiol 2007b;97:1503–14.

Sanderson AC, Kobler B. Sequential interval histogram analysis of non-stationaryneuronal spike trains. Biol Cybern 1976;22:61–71.

Scudder CA. A new local feedback model of the saccadic burst generator. J Neuro-physiol 1988;59:1455–75.

Seydnejad SR, Kitney RI. Real-time heart rate variability extraction using the Kaiserwindow. IEEE Trans Biomed Eng 1997;44:990–1005.

e Methods 173 (2008) 165–181 181

Shaikh AG, Meng H, Angelaki DE. Multiple reference frames for motion in the primatecerebellum. J Neurosci 2004;24:4491–7.

Shimazaki H, Shinomoto S. A method for selecting the bin size of a time histogram.Neural Comp 2007;19:1503–27.

Silverman BW. Density estimation for statistics and data analysis. Chapman & Hall;1986.

Sylvestre PA, Cullen KE. Premotor correlates of integrated feedback control for eye-head gaze shifts. J Neurosci 2006;26:4922–9.

Van Gisbergen JA, Robinson DA, Gielen S. A quantitative analysis of generation ofsaccadic eye movements by burst neurons. J Neurophysiol 1981;45:417–42.

Wang X, Lu T, Snider RK, Liang L. Sustained firing in auditory cortex evoked bypreferred stimuli. Nature 2005;435:341–6.