Biomedical Signal Processing Notes
Measurement of Physiological Systems
Measurement is crucial for:
- Understanding physiological systems.
- Diagnostics.
- Therapeutics.
Extracting relevant information often requires signal processing because measurement devices convert physiological signals into electrical, and often digital, signals, allowing for signal processing techniques to improve the utility of the data.
Basic Bioinstrumentation System
A basic bioinstrumentation system contains essential and optional components, but always includes a signal processing part.
What is a Signal?
A signal is a single-valued representation of information as a function of an independent variable (e.g., time).
- Information can be real or complex.
- A signal can be a function of variables other than time.
Biomedical Signals
Biomedical signals usually measure electrical potential over time.
- Independent variable: time.
- Dependent variable: biopotential.
Types of Biomedical Signals: Bioelectric Signals
Obtained by electrodes, recording variations in electrical potential generated by nerve and muscle cells.
- Single-cell measurements use implanted microelectrodes to measure action potential.
- 'Gross' measurements use surface electrodes to measure the activity of many cells.
- Examples:
- Electrocardiogram (ECG): electrical activity of the heart.
- Electroencephalogram (EEG): electrical activity of the brain.
- Electromyogram (EMG): electrical activity of muscle cells.
- Electrooculogram (EOG): electrical activity of eye muscles.
Observing these signals compared to known norms can help detect diseases/disorders.
Electrocardiogram (ECG)
- Records electrical activity of the heart.
- The most commonly used biomedical signal.
- Recorded with surface electrodes on limbs or chest.
Electroencephalogram (EEG)
- Noninvasive (scalp) recording of electrical activity from synchronously active neurons in the brain.
- Different rhythms in the EEG map to different mental states:
- 14-30 Hz
- 8-13 Hz
- 5-7 Hz
- 1-4 Hz
EEG Example - Epilepsy
Interictal epileptiform discharges can be detected by clinicians.
Electromyogram (EMG)
- Graphic representation of muscle electrical activity.
- Electrodes placed near the muscle of interest.
- Used to diagnose neuromuscular diseases (e.g., neuropathy and myopathy).
Surface EMG Characteristics
Surface EMG involves detection via electrodes, reflecting motor unit firing and recruitment.
Biosignal Processing and Interpretation Chain
The chain includes:
- Physiological system under study.
- Sensing and transducing.
- Amplification and filtering.
- Analog processing.
- Analog-to-digital conversion.
- Digital processing.
- Signal validation and pre-processing (increasing signal-to-noise ratio by filtering, removing artifacts, channel selection).
- Event analysis and feature extraction.
- Results interpretation.
- Results presentation.
- Pattern recognition, classification
Continuous & Discrete Signals
Continuous-Time Signals
- Most signals in the real world.
- Denoted by , where time interval may be bounded or infinite.
Discrete-Time Signals
- Some real-world and many digital signals are discrete-time (sampled in time).
- Denoted by , where is an integer value.
Sampled Continuous Signal
- = sampling time step.
Definitions for Signals
- Deterministic: Accurately described mathematically; usually predictable.
- Periodic: , where is the period of repetition.
- Transient: finite duration.
- Stochastic (random): Defined by statistical properties.
- Stationary: statistical properties do not change over time.
- Non-stationary: statistical properties change over time.
Statistical Properties of Signals
- The mean and variance of a discrete random process can be estimated.
- Standard deviation is the square root of variance.
- Estimates of real stats of an underlying process or noise source.
- Mean is a first-order statistic; variance is second order.
- Stochastic processes are described by their statistics and distribution.
- Continuous: Probability density function (PDF); area under PDF = 1.
- Discrete: Probability mass function (PMF); sum of PMF points = 1 (like a scaled-down histogram). Values represent the probability that a sample has a certain value.
Biosignals characteristics
- All real biosignals are stochastic.
- Many are 'almost deterministic' with a typical shape and periodicity (e.g., ECG, blood pressure, feet acceleration during walking).
- 'Truly stochastic' signals (e.g., EEG) are characterized by statistical distributions.
- Stochastic biosignals can be seen as the sum of a deterministic signal plus noise.
Noise
- An undesirable component of acquired data.
- Intrinsically unpredictable, described by statistics.
- Can be intrinsic to the measured bio-process, a byproduct of DSP operation, or due to equipment imperfection.
- Noise signals can be considered random processes, usually non-stationary but 'almost stationary' over limited time ranges.
Artifacts
- Components in the measured signal not from the physiological process but from an external source.
- Close relation to 'noise'.
- Noise: irrelevant or meaningless data.
- Artifact: a product of artificial character due to extraneous agency.
- The extent of the artifact problem ranges from occasional nuisance to serious biosignal processing issue.
Artifacts – Origin-Based Classification
- Physical artifacts: originate 'outside' the patient (e.g., mains interference, electrosurgical equipment, bad sensor connections).
- Biological artifacts: originate within the patient (e.g., ECG activity in EEG signal, spontaneous EEG in EP signal, muscle activity, eye movements (EOG), body movements).
ECG Artifacts
- 50Hz AC superimposed.
- Muscle tremors.
- Moving baseline from patient movement, respiration, dirty or loose electrodes.
Power line noise example
Complex Numbers
- Numbers of the form , where and are real numbers.
- is the real part, is the imaginary part.
- Complex conjugate (notation ): same real part and imaginary part with equal magnitude and opposite sign. If , then .
Complex Numbers Representation
Representation in the complex plane. Polar representation:
Sinusoids and Complex Exponentials
- The signal with angular frequency (rad/s) is periodic because, for :
- We can view sin or cos as:
- Frequency in Hz, , is given by:
Representing Signals in the Frequency Domain
Easier to describe things in the frequency domain, especially for signals composed of one or a few sinusoids of different frequencies (e.g., 50 Hz mains interference).
Signals as Combinations of Frequencies
Combining sinusoids with different amplitudes, frequencies, and phases generates different waveforms.
Approximation of a Rectangular Wave in the Time Domain
The Complex Fourier Series
Any periodic signal can be represented as a sum of weighted sines and cosines at frequencies of
The Fourier Transform
Stretch ‘period’ out to infinity to get the Fourier Transform, which can be applied to any signal and is reversible.
The Fourier Series and Transform
- Fourier Series
- Fourier Transform
Fourier Transform of
Inverse Fourier Transform of
Magnitude and Phase Spectra
- Fourier coefficients are almost always complex numbers (real and imaginary part).
- Magnitude spectra are the modulus of the complex coefficients.
- Magnitude spectra show the amplitude associated with each frequency and are usually represented between and .
- Phase spectra are the arctangent of the imaginary and real parts of the coefficients.
- Phase spectra indicate how “synchronized” the different frequencies are.
Signal Digitalization
- Digitizing a signal involves sampling and quantization.
- Quantization introduces an error and maps the range of the signal to a limited number of values based on the available bits.
Sampling
- Convert a continuous-time signal to a discrete-time signal.
- Oversampling requires more space and processing time.
- Undersampling leads to loss of information.
- Correct sampling depends on the bandwidth of the signal.
- Sampling frequency must be greater than twice the highest frequency of a signal ().
Why Digitalization?
- Easier signal processing in the frequency domain.
- Noises and artifacts are easily separable in the frequency domain.
- Digital filters are easier to develop than analog filters.
Ideal Filters
Ideal filters can be highpass, lowpass, bandpass, or bandstop.
Filters
- Real filters are defined by parameters that model how close they are to ideal filters
- How much is the passband flat? How much is the stopband flat? How long does it take to transition from the passband to the stopband?
Actual Filters
- Filters are almost always synthesized using specific equations (e.g. Butterworth, Chebyshev…)
- These equations can have different orders (coefficient at increasing power). The higher the order, the more complex and computationally demanding is the equation, but the better is the filter.
Filtering and Signal Spectra
e.g. ECG
- The ECG waveform contains QRS complex, P and T waves, 50-Hz noise from power-line interference, EMG from muscles, motion artifact from the electrode and skin interface, and possibly other interference from electrosurgery equipment in the operating room.
- Relative power spectra of QRS complex, P and T waves, muscle noise and motion artifacts based on an average of 150 beats
Specific filtering examples
- Motion artifact is at very low frequencies, can be easily filtered out using a high-pass filter
- Power-line noise is, usually, a single frequency (although it may have harmonics) and can be usually filtered using a very narrow bandstop filter (notch filter)
Example of EMG Manipulation: Envelope Extraction
Bandpass filtered (20-450 Hz), Full-wave Rectification, Low-pass Filter (< 20 Hz).
Alternative Filtering - Averaging EEG Traces
EEG traces during recording – one per electrode. Averaging.
General Pattern Recognition System
- A sensor.
- Pre-processing routines.
- A feature extraction/selection mechanism (manual or automated).
- A classification or description algorithm – this usually needs to be trained, or more generally, involves learning.
- Often it is important to adapt or tweak aspects of every stage of the system based on the pattern recognition output.
Classification boundary Machine learning
Classification boundary. A great many features can be obtained from a 'simple' ECG curve
Machine learning – supervised Vs unsupervised:
- Pattern recognition is a form of machine learning.
- Characteristic patterns are sought in the combination of one or more features
- Classification - Supervised learning
- Have labels for some points
- Want a “rule” that will accurately assign labels to new points
- Clustering - Unsupervised learning
- No labels
- Group points into clusters based on how “near” (similar) they are to one another
- Identify structure in data
- Classification - Supervised learning