200 lines
7.2 KiB
HTML
200 lines
7.2 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<!--Converted with LaTeX2HTML 2002-2-1 (1.71)
|
|
original version by: Nikos Drakos, CBLU, University of Leeds
|
|
* revised and updated by: Marcus Hennecke, Ross Moore, Herb Swan
|
|
* with significant contributions from:
|
|
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
|
|
<HTML>
|
|
<HEAD>
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
|
|
|
<TITLE>Event detection</TITLE>
|
|
<META NAME="description" CONTENT="Event detection">
|
|
<META NAME="keywords" CONTENT="book">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
|
|
<META NAME="Generator" CONTENT="LaTeX2HTML v2002-2-1">
|
|
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
|
|
|
<LINK REL="STYLESHEET" HREF="book.css">
|
|
|
|
<LINK REL="next" HREF="node47.html">
|
|
<LINK REL="previous" HREF="node45.html">
|
|
<LINK REL="up" HREF="node40.html">
|
|
<LINK REL="next" HREF="node47.html">
|
|
</HEAD>
|
|
|
|
<BODY >
|
|
<!--Navigation Panel-->
|
|
<A NAME="tex2html1231"
|
|
HREF="node47.html">
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
|
|
SRC="next.png"></A>
|
|
<A NAME="tex2html1225"
|
|
HREF="node40.html">
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
|
|
SRC="up.png"></A>
|
|
<A NAME="tex2html1219"
|
|
HREF="node45.html">
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
|
|
SRC="prev.png"></A>
|
|
<A NAME="tex2html1227"
|
|
HREF="node4.html">
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
|
|
SRC="contents.png"></A>
|
|
<A NAME="tex2html1229"
|
|
HREF="node201.html">
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
|
|
SRC="index.png"></A>
|
|
<BR>
|
|
<B> Next:</B> <A NAME="tex2html1232"
|
|
HREF="node47.html">Audio signals as control</A>
|
|
<B> Up:</B> <A NAME="tex2html1226"
|
|
HREF="node40.html">Audio and control computations</A>
|
|
<B> Previous:</B> <A NAME="tex2html1220"
|
|
HREF="node45.html">Control streams in block</A>
|
|
<B> <A NAME="tex2html1228"
|
|
HREF="node4.html">Contents</A></B>
|
|
<B> <A NAME="tex2html1230"
|
|
HREF="node201.html">Index</A></B>
|
|
<BR>
|
|
<BR>
|
|
<!--End of Navigation Panel-->
|
|
|
|
<H1><A NAME="SECTION00760000000000000000">
|
|
Event detection</A>
|
|
</H1>
|
|
|
|
<P>
|
|
Besides taking snapshots, a second mode of passing information from
|
|
audio signals to control computations is
|
|
<A NAME="3634"></A>
|
|
<I>event detection</I>.
|
|
Here we derive time information from the audio signal. An example
|
|
is
|
|
<A NAME="3636"></A><I>threshold detection</I>,
|
|
in which the input is an audio signal and the output is a time sequence.
|
|
We'll consider the example of threshold detection in some detail here.
|
|
|
|
<P>
|
|
A
|
|
typical reason to use threshold detection is to find out when
|
|
some kind of activity starts and stops, such as a performer playing
|
|
an instrument. We'll suppose we already have a continuous measure of activity
|
|
in the form of an audio signal. (This can be done, for example, using an
|
|
<A NAME="3638"></A><I>envelope follower</I>). What we want is a pair of time sequences, one which
|
|
marks times in which activity starts, and the other marking stops.
|
|
|
|
<P>
|
|
|
|
<DIV ALIGN="CENTER"><A NAME="fig03.07"></A><A NAME="3642"></A>
|
|
<TABLE>
|
|
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 3.7:</STRONG>
|
|
Threshold detection: (a) with no debouncing; (b) debounced using two
|
|
threshold levels; (c) debounced using dead periods.</CAPTION>
|
|
<TR><TD><IMG
|
|
WIDTH="413" HEIGHT="551" BORDER="0"
|
|
SRC="img331.png"
|
|
ALT="\begin{figure}\psfig{file=figs/fig03.07.ps}\end{figure}"></TD></TR>
|
|
</TABLE>
|
|
</DIV>
|
|
|
|
<P>
|
|
Figure <A HREF="#fig03.07">3.7</A> (part a) shows a simple realization of this idea.
|
|
We assume the signal input is as shown in the continuous graph. A horizontal
|
|
line shows the constant value of the threshold. The time sequence marked
|
|
"onsets" contains one event for each time the signal crosses the threshold
|
|
from below to above; the one marked "turnoffs" marks crossings in the other
|
|
direction.
|
|
|
|
<P>
|
|
In many situations we will get undesirable onsets and turnoffs
|
|
caused by small ripples in the signal close to the threshold. This is
|
|
avoided by
|
|
<A NAME="3646"></A><I>debouncing</I>,
|
|
which can be
|
|
done in at least two simple ways. First, as shown in part (b) of the figure,
|
|
we can set two thresholds: a high one for marking onsets, and a lower one for
|
|
turnoffs. In this scheme the rule is that we only report the first onset after
|
|
each turnoff, and, <I>vice versa</I>, we only report one turnoff after each onset. Thus
|
|
the third time the signal crosses the high threshold in the figure, there is
|
|
no reported onset because there was no turnoff since the previous one. (At
|
|
startup, we act as if the most recent output was a turnoff, so that the first
|
|
onset is reported.)
|
|
|
|
<P>
|
|
A second approach to filtering out multiple onsets and turnoffs, shown in
|
|
part (c) of the figure, is to associate a <I>dead period</I> to each onset.
|
|
This is a constant interval of time after each reported onset, during which
|
|
we refuse to report more onsets or turnoffs. After the period ends, if
|
|
the signal has dropped below the threshold in the meantime, we belatedly
|
|
report a turnoff. Dead periods may also be associated with turnoffs, and the
|
|
two time periods may have different values.
|
|
|
|
<P>
|
|
The two filtering strategies may be used separately or simultaneously. It
|
|
is usually necessary to tailor the threshold values and/or dead
|
|
times by hand to each specific situation in which thresholding is used.
|
|
|
|
<P>
|
|
Thresholding is often used as a first step in the design of higher-level
|
|
strategies for arranging computer responses to audible cues from performers.
|
|
A simple example could be to set off a sequence of pre-planned processes, each
|
|
one to be set off by an onset of sound after a specified period of relative
|
|
silence, such as you would see if a musician played a sequence of phrases
|
|
separated by rests.
|
|
|
|
<P>
|
|
More sophisticated detectors (built on top of threshold detection) could detect
|
|
continuous sound or silence within an expected range of durations, or sequences
|
|
of quick alternation between playing and not playing, or periods of time in
|
|
which the percentage of playing time to rests is above or below a threshold, or
|
|
many other possible features. These could set off predetermined reactions or
|
|
figure in an improvisation.
|
|
|
|
<P>
|
|
<HR>
|
|
<!--Navigation Panel-->
|
|
<A NAME="tex2html1231"
|
|
HREF="node47.html">
|
|
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
|
|
SRC="next.png"></A>
|
|
<A NAME="tex2html1225"
|
|
HREF="node40.html">
|
|
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
|
|
SRC="up.png"></A>
|
|
<A NAME="tex2html1219"
|
|
HREF="node45.html">
|
|
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
|
|
SRC="prev.png"></A>
|
|
<A NAME="tex2html1227"
|
|
HREF="node4.html">
|
|
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
|
|
SRC="contents.png"></A>
|
|
<A NAME="tex2html1229"
|
|
HREF="node201.html">
|
|
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
|
|
SRC="index.png"></A>
|
|
<BR>
|
|
<B> Next:</B> <A NAME="tex2html1232"
|
|
HREF="node47.html">Audio signals as control</A>
|
|
<B> Up:</B> <A NAME="tex2html1226"
|
|
HREF="node40.html">Audio and control computations</A>
|
|
<B> Previous:</B> <A NAME="tex2html1220"
|
|
HREF="node45.html">Control streams in block</A>
|
|
<B> <A NAME="tex2html1228"
|
|
HREF="node4.html">Contents</A></B>
|
|
<B> <A NAME="tex2html1230"
|
|
HREF="node201.html">Index</A></B>
|
|
<!--End of Navigation Panel-->
|
|
<ADDRESS>
|
|
Miller Puckette
|
|
2006-12-30
|
|
</ADDRESS>
|
|
</BODY>
|
|
</HTML>
|