BMEN90033 · Week 10 · Case Study
Back
BMEN90033 · WEEK 10 · CASE STUDY

Detecting pre-seizure spikes in clinical EEG.

The brief

You are a biomedical engineer working in a seizure clinic. The clinicians have observed a strange phenomenon. When the EEG signal is low pass filtered, there is a recurring peak in the signal that occurs sporadically before a seizure and this peak increases every few seconds but is not periodic. They have asked you to see if you can detect, measure and track this peak every time it occurs.

What circuits that you have learned about so far would you use to perform these mathematical functions?

EEG peak detection comparator Schmitt trigger peak detector monostable
01the problem

What the clinicians see.

The trace below is a representative recording from one of the affected patients, cycling through normal behaviour, a pre-state, a seizure, and a brief recovery. The feature of interest is the band shaded yellow: a small number of brief, sporadic spikes whose amplitude grows in the lead-up to the seizure.

Two facts matter for the design that follows. First, the spikes are not periodic, so a fixed sampling clock cannot decide when a spike has occurred. Second, the amplitude is the quantity of clinical interest, not the count alone, because a rising envelope during the pre-state is what predicts the seizure.

The clinicians ask for three things from the circuit: detect each spike, measure its peak amplitude, and track the trend.

The trace shows the unprocessed electrode signal: alpha-band activity and electrode noise dominate, and the spikes of interest sit on top of that background. Toggle the annotation overlay to mark each ground-truth spike with its peak amplitude.
annotate spikes
EEG · v(t) · cycling normal → pre-state → seizure → recovery
normal behaviour pre-state seizure recovery phase: —
spikes seen0
last amplitude— mV
trend
02the question

Which circuits would you use?

The clinic's brief reduces to three mathematical operations: a binary detection, an analog amplitude measurement, and a slow trend over many events. Pick the blocks from this course that you would assemble to perform those three operations.

Multiple selections are allowed. Some choices are correct, some are partially useful, and some belong to a different problem.

The low-pass filter is already in place, so the front-end conditioning is done. Your job starts at the filtered EEG and ends with three readouts on the clinician's screen: count, amplitude, and amplitude over time.
target signal · what the chain must produce
03approach A · threshold detection

Signal-digitization via comparator.

The simplest detector is an op-amp comparator with its non-inverting input tied to the EEG and its inverting input held at a reference voltage $V_\mathrm{th}$. Whenever the EEG crosses upwards through $V_\mathrm{th}$, the output flips to the positive rail and a spike is registered.

Plain comparators chatter on noisy inputs because the signal can wander across the threshold several times within one true spike. A Schmitt trigger replaces the single threshold with a hysteretic pair $V_{T+} > V_{T-}$. The output goes high only when the input rises above $V_{T+}$ and only resets when the input falls back below $V_{T-}$, so each spike yields exactly one pulse.

// strengths
  • One pulse per spike with hysteresis enabled.
  • Output is digital and drives a counter directly.
  • Robust to baseline drift if $V_\mathrm{th}$ is centred around the running mean.
// weaknesses
  • Carries no amplitude information — every detected spike is the same pulse.
  • Threshold must be set above the noise but below the smallest spike of interest.
  • Misses early sub-threshold spikes during the build-up phase.
Toggle hysteresis off to see the comparator double- and triple-trigger on a single spike when the noise is comparable to the slope at the threshold crossing.
hysteresis on threshold 0.55 hysteresis 0.20
EEG with thresholds and comparator output
true spikes0
detected0
false retriggers0
04approach B · peak measurement

Capturing amplitude via a passive peak detector.

The simplest peak detector is a diode in series with a hold capacitor. While the input rises, the diode conducts and the capacitor charges to the input voltage minus the diode forward drop, $V_C = V_\mathrm{in} - V_D$. When the input falls back, the diode blocks and the capacitor holds the most recent peak.

An ideal hold would freeze the reading forever and confuse the next measurement. A leak resistor is added across the capacitor, giving a decay time constant $\tau_\mathrm{leak} = R_\mathrm{leak} C$, so the held voltage tracks the envelope of the spike train rather than freezing on the first peak.

// strengths
  • One diode and one capacitor; nothing else is required to hold a peak.
  • With a leak resistor across the capacitor, the trace approximates the rising envelope.
  • No threshold to tune; the largest input within $\tau_\mathrm{leak}$ finds itself.
// weaknesses
  • The diode drop $V_D$ is subtracted from every reading: $V_\mathrm{held} \approx V_\mathrm{peak} - V_D$.
  • If $V_D$ exceeds the spike amplitude, the diode never conducts and the detector outputs nothing. Raw EEG spikes are millivolts; a silicon diode at $V_D \approx 0.6$ V will not turn on.
  • The next stage loads the capacitor; without a high-impedance buffer, the held value droops.
  • Charging through the source impedance limits how fast a narrow spike can be captured.
  • No reset path: a tall peak masks every smaller spike until the leak brings the held value back down.
The simulation models the diode drop directly. Note that the held trace sits below the input peaks by $V_D$, and that spikes shorter than $V_D$ produce no charge at all. Slide 5 shows the gain stage that lifts the EEG above the diode knee so this detector becomes usable.
leak τleak 2.0 s diode drop VD 0.30
EEG with held peak · Vpeak(t)
held value— mV
last spike— mV
envelope slope
05the full chain

One potential block diagram that meets the brief.

The filtered EEG is in millivolts and is too small to drive the analog peak detector directly. A pre-amp lifts the signal above the diode forward drop, then a parallel pair of blocks supplies the two outputs the brief requires: a Schmitt trigger plus monostable produce one clean pulse per spike for counting, and a diode with a hold capacitor and leak resistor produce a held envelope that tracks the spike amplitude over time.

  • Pre-amp raises the EEG above the diode forward drop and the Schmitt hysteresis window. Without it neither branch operates.
  • Schmitt + monostable rejects noise the bare comparator would re-trigger on, then standardises pulse width so a downstream counter sees uniform events.
  • Peak detector ($D + C \parallel R_\mathrm{leak}$) holds the most recent peak; the leak time constant $\tau = R_\mathrm{leak} C$ lets the held value follow the envelope rather than freeze.
Every block has appeared earlier in the course. The case study is the mapping from the clinical request to this chain. The trace on the right shows the input EEG and the held output, the signal a clinician would actually read.
V_T+ 0.55 hysteresis 0.20 τ_leak 2.20 s
input v_in (filtered EEG) and output V_held (peak envelope)
block diagram · signal chain from EEG input to held output
pulses (4 s)0
held peak— mV
enveloperising
1 / 6