Digital Signal Processing Reference
In-Depth Information
HPF
(DC-
block)
Signal
level
monitor
Input
Rectify
LPF
Buffer
#1
Buffer
#2
Output
FIGURE 10.18. Block diagram for the detection of a voice signal from a microphone and
playback of that signal in the reverse direction.
+
DC estimate
-
Input
Output
a
+
z -1
1-a
FIGURE 10.19. DC blocking first-order IIR highpass filter for voice signal detection and
reverse playback.
When a voice signal appears and subsequently dies out, the signal-level monitor
sends a command to start the playback of the accumulated voice signal, specifying
the duration of the signal in samples. The stored data are transferred from the input
buffer to the output buffer for playback. Playback stops when one reaches the end
of the entire signal detected.
The signal-level monitoring scheme includes rectification and filtering (using a
simple first-order IIR filter). An indicator specifies when the signal reaches an upper
threshold. When the signal drops below a low threshold, the time difference between
the start and end is calculated. If this time difference is less than a specified dura-
tion, the program continues into a no-signal state (if noise only). Otherwise, if it is
more than a specified duration, a signal-detected mode is activated.
Figure 10.19 shows the DC blocking filter as a first-order IIR highpass filter. The
coefficient a is much smaller than 1 (for a long time constant). The estimate of the
DC filter is stored as a 32-bit integer.
The lowpass filter for the envelope detection is also implemented as a first-order
IIR filter, similar to the DC blocking filter except that the output is returned directly
rather than being subtracted from the input. The filter coefficient a is larger for this
filter to achieve a short time contant.
Build and test this project as detect_play . You may need to change the header
file c6713dskinit.h for a microphone input (see Chapter 1).
Search WWH ::




Custom Search