
of false detections alone and by the receiver operat-
ing characteristic (ROC). Fig. 4a shows that, for low
thresholds, the two-threshold with filtering method
can reduce two- to threefold the rate of false detec-
tions comparedto a standard single-threshold method,
while the improvement is less than 20% if no filter is
used. Such a difference is explained by the fact that
the trough is usually slower and smaller than the peak,
and, without a proper filtering, the trough detector is
much more likely to respond to the background noise.
Meanwhile, ROC analysis Fig. 4b shows that the two-
threshold with filtering method performs much better
than the other two methods, especially for low signal-
to-noise ratio (SNR). For instance, for a SNR (de-
fined as the ratio between the peak-to-trough ampli-
tude and six times the standard deviation (σ) of the
noise) of 0.7, this method still detects APs reason-
ably well while the other two methods perform no bet-
ter than detection by chance. Based on these results,
we designed an analog circuit to implement the two-
threshold with filtering algorithm. As shown in Fig. 1,
the conditioned signal is split in two paths. The first
signal path has a comparator with a selectable posi-
tive threshold V
H
. Whenever the threshold is crossed,
the comparator triggers a time-window generator, de-
picted in Fig. 5. The output of the set-reset flip-
flop is normally in a low logic state (Q = 0), keep-
ing the capacitor charged. When a positive peak of
AP is detected, the NMOS swiftly discharges the ca-
pacitor and the resulting drop of the transistor drain
voltage turns off the same NMOS, thus enabling the
capacitor re-charging. When the recharging capaci-
tor voltage crosses the trigger threshold, the cycle is
repeated. This block acts then as a clock generator,
feeding the counter that generates the output, namely
the time window. When the counter completes its cy-
cle, it resets the flip-flop, bringing everything to the
initial state. The current I
CHARGE
can be externally
tuned in order to produce time windows of different
lengths. For example, by setting I
CHARGE
= 20 nA
we obtain a time window of 1 ms with a 10 pF ca-
pacitor. The second signal path has a low-pass filter
(implemented with a G
M
−C cell with tunable band-
width) followed by a second comparator with nega-
tive threshold V
L
. Finally, outputs of the two channels
feed a D-type flip-flop acting as an AND port: its out-
put is true only when a negative crossing happens dur-
ing the assertion of the time window. The following
parameters of the circuit were used for the tests here:
5 kHz for the low-pass filter, 0.6 for the ratio of the
two threshold amplitudes and about 2 ms for the time
window duration.
S
R
Q
Q
V
D D
- V
D D
C O U N T E R
E O C
C K
I
C H A R G E
C
P O S S P I K E
W I N D O W
Figure 5: Simplified schematic of the time-window genera-
tor.
2.3 Spike-sorter Circuit
The amplified signal is also processed by a spike-
sorter block (see Fig. 1) that measures the peak and
the trough amplitudes and the width of the detected
spike. The peak detector circuit is shown in Fig 6(a).
If the ENABLE signal is low, the circuit acts as a tradi-
tional voltage follower, while when ENABLE is high
the source follower M
6
is biased with the small leak-
age current of transistor M
7
and it is able to follow
only the rising edge of the input signal. In the imple-
mented circuit, the ENABLE signal comes from the
time-window generator output: when the amplified
signal crosses the positive threshold, the time-window
signal is set high, forcing the detector to track the
peak. This control signal allows detecting peaks with
very different amplitudes and very close to each other,
that was not possible with the implementation in (Ho-
riuchi et al., 2004) because of the slow discharge after
a peak detection. Two aspects were taken into con-
sideration in the design of the peak detector. First,
the M
1
−M
4
amplifier gain was maximized (to about
50 dB) in order to reduce the detector offset (which
could cause a systematic error in the peak amplitude
evaluation). Second, the gate-source capacitance of
the follower transistor M
6
was minimized in order to
keep low the voltage drop caused by the input voltage
that drops below the peak voltage.
The trough detector is the PMOS equivalent of the
Fig 6(a) circuit. In this case, the enable signal for the
trough detector is the spike-detector output itself.
The width detector circuit, shown in Fig. 6(b), is a
time-to-amplitude converter, based on the charging of
a capacitor with a constant current, with two control
signals, ENABLE and RESET. The latter is the time-
window signal (TIME WINDOW), while ENABLE is
the logic exclusive OR between TIME WINDOW and
SPIKE DET. The crossing of the positive threshold
activates the current generator, M
5
, and switches off
M
6
. The capacitor C = 10 pF is charged by a 30 nA
constant current until the crossing of the negative
BIODEVICES 2009 - International Conference on Biomedical Electronics and Devices
70