Biosignal ProcessingPreparation Lab Outline Procedure Learning more Quiz |
GOALS
To understand one-dimensional data acquisition and processing, including the sampling theorem, quantization effects, the frequency domain, windowing and filtering.
Convolution is defined as: The integrand is the product of two functions with the latter flipped and shifted. See this java demonstration of convolution for a graphical explanation. Fourier Transform:
Any signal can be considered to be a sum of an
infinite number of sinusoidal waves of different frequencies. Think of a
musical audio signal being composed of high and low notes. The Fourier
transform is particularly important for linear (adding/scaling inputs
results in adding/scaling outputs), time-invariant (a shift in the input
gives a shift in the output) systems.
The response of such systems to a complex exponential (sinusoid) is just a
constant times the input. The Fourier transform is the weight or magnitude
of each component frequency and is computed by this integral:
We can recover the original signal from its frequency domain representation
using:
For discrete signals, such as we will deal with, the analogous transform
is the discrete Fourier transform: Note, we will get a negative and positive peak for any frequency component, i.e. for a 100Hz signal, we will get components at 100 and -100.
Signals which include frequencies outside the bandlimit determined by the sampling rate will be aliased when sampled. The replicated spectra will overlap and high frequencies will appear shifted or aliased as low frequencies. Each frequency is shifted down to below the maximum frequency (half the sampling frequency). See Appendix below for more on sampling. If the analog signal contains higher frequencies than half the sampling frequency, as in this example, the digitized signal will contain spurious oscillations not present in the original signal. Power spectrum of an EEG signal originally bandlimited to 40Hz. The presence of 50 Hz noise in the original signal (a) causes an aliasing error in the 30Hz component in the sampled signal (b) if the sampling frequency is 80Hz.
[
Quantization produces a discrete signal, whose samples can only take
certain values, using either rounding or truncation. The range of values
is typically divided evenly (uniform quantization). Signals are commonly
quantized to 8, 12 or 16 bits. The quantization interval = (high limit -
low limit)/(2
The frequency resolution of the frequency plot is determined by the total number of samples, n, used in the DFT and the sampling rate or frequency. The maximum frequency contained in the DFT is determined by the sampling rate where fmax = (sampling rate)/2. Thus, the frequency resolution is (sampling rate)/npts. The number of points in the time domain should be a power of 2 for computational efficiency.
Calculation of various functions requires the knowledge of the signal from minus infinity to plus infinity. The signal, of course, is not available for arbitrarily long durations. We must use a windowing signal instead. A window w(t) is defined as a real and even time limited function (w(t) = 0 for |t| > T/2). The FT of the window is therefore real, even and not band-limited. Multiplying the signal by the window function will zero the signal outside the window duration (observation period) resulting in a windowed, time-limited signal s_w(t) = s(t)w(t). In the frequency domain, we have S_w(f) = S(f) * W(f). Windowing convolves the true spectrum of the signal with the FT of the window. Thus, a window with very narrow spectrum will cause low distortions. Sidelobes cause distortions. The simplest window is rectangular. More useful are, for example, the Hamming window and the Hann window designed to minimize the effects of the sidelobes.
Digital filtering can be used to improve a signal by removing noise or other unwanted components from the signal after it has been acquired indigital form. Digital filters are more flexible and do not require the precision hardware of analog filters (performed with circuitry). The design of these filters is a whole field and outside of the scope of this course. In their simplest form, they are functions that are convolved with the signal. Filters are characterized by their behavior in the frequency domain. Low pass filters remove high frequencies (the stop band) and leave the low frequencies alone (the pass band). High pass filters remove low frequencies and leave the high frequencies alone. Band pass filters only pass frequencies in a given range. Band stop filters remove frequencies in a given range. None are ideal, however, and the degree to which they cut-off the designated frequencies (the steepness of the transition from stopband to passband; the size of undesired side lobes) characterizes their behavior.
Sampling a function can be expressed as a multiplication with a comb
function (a train of delta functions): Dirac delta function:The dirac delta function is a generalized function, or distribution representing an infinitely brief, infinitely strong, unit area impulse. It is represented graphically as an arrow of unit height. It can be considered as the limit of a function, such as a Gaussian or rectangle, which gets narrower and taller preserving the area under the curve. It can also be considered to be the derivative of the unit step function. Some properties: Comb Function:
A train of impulses or delta functions is called a comb function: From delta function properties, we can see: Then, a comb with spacing b is: Sampling with a Comb: In multiplying, the comb acts to sample x(t). The samples are spaced by b.
Convolution with a comb replicates the function at each delta function as
you slide x along. The Fourier transform of a sampled function is a replication of the transform of the unsampled version.
Aliasing: When undersampled, the replicated spectra overlap and this causes aliasing. |