Quick viewing(Text Mode)

Basics of Signal Proces^Stng

Basics of Signal Proces^Stng

Cha?ter 2

BASICS OF SIGNAL PROCES^STNG

2.1. INTRODUCTION The data arising from an electroPhysiological experiment on the nervous system initially consist of records in continuous ana- log form of stimuLus events and the responses that they give rise to. If these data are to be analyzed in more than a qualitative way, digital computation techniques are usually called for' This means that the analog data have first to be converted to digital ' sampled form. Then the full range of analysis techniques that have been developed to study dynamic processes can be br:ought to bear' These include filtering, averaging, spectral analysis, and covari- ance analysis. In this chapter we discuss first the properties of the analog-to-digital conversion processes with particular re- gard to their effect on the experimental data, and the subsequent of tests the data are subJectecl to. I'lten we move to a discussion filtering operations, analog and digital, with emphasis on the latter and how it fits into computer data analysis procedures'

From time to time we consider some of the hardware aspects of

filtering since familiarity \"rith them is quite useful for a fuller

comprehension of filtering procedures.'

ANA],OG-TO-DIGITAL CONVERS ION

An analog-to-digital converter (ADC) converts a continuous

signal into a sequence of ?- and l'l-dj-screte measurements' The

two steps of time sarnpling and amplitude quantizing are usual-ly performed in a combined procedure. The ADC is first given the of command to sample by the computer and then holds the ampl'itude

this sample briefly while quantlzing it. We illustrate the

ADC in Fiq. 2.I as performing its operations in the sequence PRINCIPLESOF NEUROBIOLOGICALSIGNAL ANALYSIS BASICSOF SIGNALPROCESSING

(o) sequence of maintained vol-tage Ievefs lasting the duration between The amplitude of each level- is the SAMPLE sanpling times, Fig. 2.1(b). COMMAND REAO OUT COMMANO signal amplitude at the sampling j-nstant t'A. In \4rhat follows, we

assume A to be unity so that toA can be replaced by the integer

valued time variable to. Sampling devices are often referred to as

sample-and-hold circuits because of their ability to hold the san-

pled value without significant decay until quantization has been

completed--a time duration that is often considerably shorter than

the interval between samples.

In a nunber of experimental situations in which a response to

a stimulus is being analyzed, the instrumentation is organized so

that Lhe stimulator is triggered by the same pulse that initiates

A-D conversion of the data. This insures that there will be no (random variation in tirne) or asynchrony between the onset

of the stimu.Lus and the data sampling instants. That is, sampling

always occurs at fixed delays from stimul-us onset. If' on the other hand, the stimulator is driven independently of the ADc and notj--

fLes that device when to initiate sampling, jitter of the sampling

instants can occur and tend to result in some temporal smearing of

the digitized data. The jitter effect will be small when the cycle

time of the computer is small compared with the sampling interval.

Here we j-gnore the effects of iitter in A-D conversion-

Fig. 2.7. The sampled signal xa(t) is then quantized to yield an output (a) Block diagram st-ructure of an A_D conyerEer. sampLing is initiated periodicalTg. euantization of the sampJe is x (t") which can take on only a fimited ntunber of, usuallyr urli- foLLowed o' bg coding it into digitar format. when this is compr-ete quan- a read-out conunand causes formly spaced values. The input-output relationship for the deliverg of the converted signaT to the data processor. (b) fne signal s(t) before sampling una it" tizer is shown in rig. 1(c). The quantization step is g volts in sanpl-e.d version su(t). (c) The input-output relation for the the input is greater than O quantJ-zer. ?he step size is q. amplitude. The output is O as long as and no larger than g; it is g as long as the input is greater than indicated there. The organization of the converter is not i.ntended g and no larger than 29 and so on. In equation form, the input- to describe a particular type of ADc, but to ilfustrate the function = output relationship is, at integral values of t = to (with A t) of such a device. In addition, the data analysis problems we are concerned with do not depend upon the detailed circuitry linking the computer x (t") mq< x_ (to) < (m + I)9, (2.r) to the ADC or upon the structuraL features of the con- l'l :, verter itsel_f. The sampled version of the signal i,s x.(t) t a xu(t") <-Mq=-Q

56 57 BASICSOF SIGNALPROCESSING PRINCIPLESOF NEUROBIOLOGICALSIGNAL ANALYSIS

produce peak value limiting at The ing step but small enough not to maximum and minimurn voltage levels that can be handled hrithout these reasonable assumptions the saturation are -e any time in the converter. Under e and and the totaf nrnnber of levels 2!t that the well: (l) the quanLizing error output signal following statements hold reasonably can take on is usua.j.l-y some integer power .L of 2: neighbors; of a sample is uncorrelated \{ith that of its sequential 2u=2L (2.2) ffi a sample (2) the probability density function for the err^orr zq of The degree of precisi.on of an A-D conversion is referred to in g' That is' it is #' is uniformly distributed over the interval 0 to terms of the nunber of bits in the output word of the converter. in this gF#, equally 1ike1y that the magnitude of the error be anywhere A fO-bit converter will quantize vortages between -r and +1 vort &I (2) quantization rule of Eq' (2'l) ' i6I range. From assumption and the into one of IO24 1evels each of whose magnitude *;.r. is 1.952 mV_ tu1 is a bias term' fiK the nean value of the quantizing is q/2' This The final step in the conversion is to code {g xn(t") (on1y the +tr' 2 rq/2 2 values of x- at the sampling times are important) *8. = (2.4) q into a form varrzn)= "i a" f; acceptabfe for use by J _-nr, the digital computer. Most often this means ffi implies that EhaE xq(t"), whether J* The lack of correlation between sample errors positive or negative, is represented in binary {4}, given by form, .L binary the autocovariance function for the noise is digits being adequate for this. Tlpically, one coded :8*: = output line q21L2, for ro o is assigned to each binary digit and the value of the ffi (2.5) c (to) = voltage on this line at the read-out time indicates 2Z other\^tise whether that H 9Iq o, binary digit is a 1 or a O. The time for excluding the dc bias term' is both sampling and read_ Sr'b The power spectnrm of the noise, out are determined by a clock contained within the computer. s, flattoF=I/2.Toseethis,supposethedataconsistoflv "rnterrupt" features of signal of the computer assure that the incoming data samples of the signal and that we assume the combination are accepted ffi = = after each quantization has been performed. 49.' be periodic with period ? IVA N' The substitution &i and noise to ffi' of Eq. (2.5) into Eq. (I.23) results in spectral terms Crn"n(ilt 2.3. QUANTTZATTONNOrSE #; which are all equal and independent of n' This is because = (to) is different from 0 only when to 0' Thus the quantiz- Each conversion has associated with it a discrepancy between # c-'q'q - the N/2 frequency components the quantized and the true val-ue ing noj.se is equally divided among all of the signal. It is useful to :€*W O and N/2: consider this error as a form of noise, catled quantizing noise, i$i between zn(t"L). we can ,'{..d:' (2.6' then write cz (n, = q2 1r2w, O

this can be taken of the waveform during each period at the same time relative response detection being secondary. To find how well the peaks in to the beginning of a period wilJ- always produce the same quantiz- done, it is necessary to kno$/ how fine, relative to must be' when ing error and this would not be removable by the process of averag- the amplitude distribution, the quantization steps signal are avai]- ing over successive waveform repetitions. Ho\^rever, as soon as some a large nurnber of quantized sampfes of the input arrived at by background noise is added to the fixed waveform, the situation able, the answerr as Tou (1959) has shown, can be itsel-f a waveform changes. The quantizing noj,se then takes on many of the character- considering the signal amplitude distribution as samples istics of random noise. In a sense, the uncorrelated quantizing which is to be represented by a set of uniformly spaced axis is noise is induced into the quantized signal whenever the incoming along the amplitude axis. In this approach, the ampfitude signal has a fLuctuating random component. Thus, if the input noise analgoustothetimeaxisofconventionalwaveformsampling.one for perfect bandwidth were very low relatj-ve to I/2, the quantizing noise would can then aPply the sampling theorem that states that frequency is still exhibit the flat power spectrun indicated by Eq. (2.6). This reconstruction of a band Iimited wave whose highest 2F/sec' induced noise can only be removed by numerical or digital filtering F, sampling shoufd be performed at a rate no lower than version of the digital data subsequent to the A*D conversion operation, a In practice, when the experimenter examines the sampled rate is usually topic covered later in this chapter. Since there are many situa- of the waveform on an oscilloscoPer the Nyquist of the tlons ln which one is interested in signal peaks which may be small inadequate to permit satisfactory visual reconstruction be no lower than compared to the largest one present, the existence of quantizing waveform. Sampling rates for this purpose should of amplitude noise must not be ignored, for it tends to make the small peaks 31/sec to SF/sec. Although probability distributions transforms Iess detectable. It can, for example, become an important factor are not truly band Limited in terms of their Fourier to arrive at a when the biological noise contains a significant amount of low- (cal-Ied characteristic functions), it is possible adequate quantiza- frequency components giving rj.se to what is referred to as baseline convenient rule-of-thumb in determining what an suppose the drift in the received data. When this occuls, it is common practice tion step or sampling interval should be' Thus' distributlon of the to redUce the arnplification of the signal so as to prevent too narrowest peak in the amplitude probability Fourier transform frequent saturation of the signal amplifiers or peak limiting in data is normal in shape, with varian"" a" ' The more than 99* of its the ADC. It is then quite possibl-e that lesser peaks in the signal of this distribution is also Gaussian and has will be no larger than a few quantizing intervals, making the quan- areaconfinedto.'frequencies''lessthanl/3o.Consideringthis "bandwidth" of the distribu- tizing noise a factor of importance. to be an adequate approximation to the of the quantizing step The fineness of A-D quantization is of importance in stil1 tion, simple computations indicate the size quantizing noise another way. It affects the ability to reconstruct from the quan- should then be very nearly O. Note that though to the variance tized output data, the amplitude probability distribution of the is present, 1ts variance, oz/l'2, is small compared our rufe can now input data. This issue is somewhat different from,that of detect- of the smallest peak in the input distribution' points three standard ing by response averaging a weak but constant response,in a back- be stated in terms of the distance D between width D/6 volts ground of noise (Chapter 4). There, one is not interested in deter- deviations away from the narrowest peak: a sampling distribution which mining the nature of the amplitude distribution of the data. Here' is adequate to represent peaks in the amplitude holds for overlapping detection of such subtleties in the data is the desideratutn, htith are D volts or more in width. The result

60 61 PRINCIPLESOF NEUROBIOLOGICALSIGNAL ANALYSIS BASTCSOF SIGNAL PROCESSING peaks as long as no component peak is narrower than D. If the peaks signal can have without introducing spectral aliasing is L/2ML are sharper, the rule stated here will produce sone of where It is the nunber of equally multiplexed sources and l,/MA is their shapes which will be further contaminated by quantization the effective sampling rate. In addition to belng certain that noise. Sharp peaks therefore require some decrease in the quanti- the effective sampling rate is adequate to preserve signal struc- zation step. ture, one must also consider the effects of noise in the input data

and quantization noise. Ideally, prior to A-D conversion, fi-ltering 2.4. MULTTPLEXING: MONITORING DATA should be performed to remove from the input data a1l frequency com- SOURCES SIMULTANEOUSLY ponents higher Lt.arl L/2ML. If this is not done, the higher frequen- Multiplexing process is the whereby several data sources have cy nolse comPonents in the data will, after digitizing, be aliased their informatj-on transmitted to the data processor over the same with the lower frequency ones. Aliasing means that signal compon- channel. Here the channel is the ADC and the multiplexing is per- ents at frequencies greater than I/2 of the sampling rate will be formed by a process of switching the input of the ADC from one sig- misinterpreted as components at frequencies less than half the nal source to another. The rate at which the switching is performed sampling rate. This falsifies the interpretation of signal struc- and the choice of the source to be selected are determined by the ture made frorn the sampled data. Aliasing is discussed more thor- data processor which accepts the data from the converter output. oughly l-n Chapter 3. The net result is a decrease in the signal-- Both are constrained, of course, by the data handling capabil"ities to-noise ratio of the digitized data. suPpose' for example, that built into the converter. When multiplexing is performed, an addi- the sampling rate of the ADC were IOOO samples/sec and that five tional amount of time is perform required to a data conversJ.on. data channel.s were being rnultiplexed. Suppose also that the pre- The additionaL process time arises because the of switching the filter had a high frequency cutoff at 50O Hz corresponding to the d.rta converter from one source to another introduces a brl-ef elec- resolvable bandwidth if only one channel were being digitized. trical transient into signal the and it is necessary to wait for Now, five data sources are being multiplexed. The effective this transient to subside performing before a conversion. The sampling rate of each source is 2oo/sec and the corresponding multiplexing time can increase the total conversion time by about resolvable bandwidth is 1O0 Hz. Even if the response components 10r. of the input data have bandwidths less than I00 llz, aI1 the instru- Multiplexing of different data sources is performed most ment noise between 100 Hz and the fil-ter cutoff at 5OO Hz will be commonly at a uniform rate proceeding from source l, to sosrce 2, aliased into the spectral region below 100 Hz, producing a degra- to source 3, etc., and back to source 1 in a recurrent, cyclic dation of the quantized data from the ADC. This degradation can fashion. This is the mode of operation when the data from the be eliminated only by reducing the input data bandwidth to 100 Hz. different sources are signals of comparabte bandbrl-dths and whose For thls reason it is highly desirable when background noise is an temporal fluctuations are judged to be of eqrml interest and im- important factor to use a prefilter whose cutoff frequency is portance. When equal sharing of the ADC by the different sources I/2 t}l,e effective samPling rate. occurs, the minimum period between samples of any one source is The total quantizing noise remains unchanged during multi- increased by a factor equal- to the total nunber of multiplexed plexing since the quantizing error in each conversion is the same. channels. As a consequence, the maximum bandwidth which each However' the bandwidth of the digitized output has been reduced so

62 63 -

PRINCIPLESOF NEUROBIOLOGICALSIGNAL ANALYSIS

that the spectral intensity of the quantizing noise is increased

by the factor M. Filtering prior to A-D conversion cannot reduce

this. As basic communications theory shows, this means that when

sampling is done at the Nyquist rate, narrow bandwidth data are

more affected by quantization noise than are broad bandwidth data. In some situations, the monitored data sources have widely

different bandwidths making it possible to sample the narrow band-

width signals less frequently than the broad. This often results in a nonuniform rate of sampling of the broader bandwidth signals,

there being occasional intervals in which they are not sampl_ed.

Usually no serious deterioration in the data analysis results. In-

frequent interruptions in sampling can be further minimized by

post A-D conversion digital- fil"tering, discussed later in this chapter, which has the effect of interpolating the missed data points in addition to smoothing the data.

If one considers only the spectral properties of the data

sources and the sampling rate of the ADC, the problems associated with multiplexing are straightforward. However. another factor,

the size of the computer storage area, needs also to be consj_dered

when real time data analysis is being performed. As discussed pre-

vj-ously, in single channe.L A-D conversion all real-time data pro-

cessors have a limited memory capacity in terms of the nunber of

registers available to store data. When multiplexing is employed,

these registers are parceled out to the different data sources

so that over a given observation epoch, it is never possible to

attain the same temporal resolution in each of the several multi-

plexed channels as it is with just one. The decision to resort to multiplexing must take this into account.

2.5. DATA FILTERING

The operation of data filtering is one in which certain attributes of the data are selected for preservation in preference

to others t^rhich are lfiltered out- " To design a satisfactory

il