You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
miller-book/node180.html

269 lines
8.6 KiB

<!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>Narrow-band companding: noise suppression</TITLE>
<META NAME="description" CONTENT="Narrow-band companding: noise suppression">
<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="node181.html">
<LINK REL="previous" HREF="node179.html">
<LINK REL="up" HREF="node178.html">
<LINK REL="next" HREF="node181.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A ID="tex2html3259"
HREF="node181.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="next.png"></A>
<A ID="tex2html3253"
HREF="node178.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="up.png"></A>
<A ID="tex2html3247"
HREF="node179.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="prev.png"></A>
<A ID="tex2html3255"
HREF="node4.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="contents.png"></A>
<A ID="tex2html3257"
HREF="node201.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="index.png"></A>
<BR>
<B> Next:</B> <A ID="tex2html3260"
HREF="node181.html">Timbre stamp ("vocoder")</A>
<B> Up:</B> <A ID="tex2html3254"
HREF="node178.html">Examples</A>
<B> Previous:</B> <A ID="tex2html3248"
HREF="node179.html">Fourier analysis and resynthesis</A>
&nbsp; <B> <A ID="tex2html3256"
HREF="node4.html">Contents</A></B>
&nbsp; <B> <A ID="tex2html3258"
HREF="node201.html">Index</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H2><A ID="SECTION001372000000000000000">
Narrow-band companding: noise suppression</A>
</H2>
<P>
<DIV ALIGN="CENTER"><A ID="fig09.16"></A><A ID="12719"></A>
<TABLE>
<CAPTION ALIGN="BOTTOM"><STRONG>Figure 9.16:</STRONG>
Noise suppression as an example of narrow-band companding: (a)
analysis and reconstruction of the signal; (b) computation of the
"mask".</CAPTION>
<TR><TD><IMG
WIDTH="663" HEIGHT="477" BORDER="0"
SRC="img1227.png"
ALT="\begin{figure}\psfig{file=figs/fig09.16.ps}\end{figure}"></TD></TR>
</TABLE>
</DIV>
<P>
Example I04.noisegate.pd (Figure <A HREF="#fig09.16">9.16</A>) shows an example of narrow-band
companding using Fourier analysis/resynthesis. (This is a realization of the
block diagram of Figure <A HREF="node173.html#fig09.08">9.8</A>.) Part (a) of the figure shows a filter
configuration similar to the previous example, except that the gain for each
channel is now a function of the channel magnitude.
<P>
For each <IMG
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img58.png"
ALT="$k$">, if we let <IMG
WIDTH="28" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1228.png"
ALT="$s[k]$"> denote the power in channel <IMG
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img58.png"
ALT="$k$">, and let
<IMG
WIDTH="35" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1229.png"
ALT="$m[k]$"> be a mask level (a level presumably somewhat higher than the noise
power for channel <IMG
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img58.png"
ALT="$k$">), then the gain in channel <IMG
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img58.png"
ALT="$k$"> is given by
<BR><P></P>
<DIV ALIGN="CENTER">
<!-- MATH
\begin{displaymath}
\left \{
\begin{array}{ll}
{\sqrt{{s[k]-m[k]}\over {s[k]}}} & {s[k] > m[k]} \\
0 & \mbox{otherwise}
\end{array}
\right .
\end{displaymath}
-->
<IMG
WIDTH="186" HEIGHT="55" BORDER="0"
SRC="img1230.png"
ALT="\begin{displaymath}
\left \{
\begin{array}{ll}
{\sqrt{{s[k]-m[k]}\over {s[k]}...
... {s[k] &gt; m[k]} \\
0 &amp; \mbox{otherwise}
\end{array} \right .
\end{displaymath}">
</DIV>
<BR CLEAR="ALL">
<P></P>
The power in the <IMG
WIDTH="12" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img58.png"
ALT="$k$">th channel is thus reduced by <IMG
WIDTH="35" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1229.png"
ALT="$m[k]$"> if possible,
and otherwise replaced by zero.
<P>
The mask itself is the product of the measured average noise in each channel,
which is contained in the table "$0-mask", multiplied by a value named
"mask-level". The average noise is measured in a subpatch
(<TT>pd calculate-mask</TT>), whose contents are shown in part (b) of the
figure. To compute the mask we are using two new new objects:
<P>
<BR><!-- MATH
$\fbox{\texttt{bang\~}}$
-->
<IMG
WIDTH="56" HEIGHT="39" ALIGN="MIDDLE" BORDER="0"
SRC="img1231.png"
ALT="\fbox{\texttt{bang\~}}">:
<A ID="12903"></A>send a bang in advance of each block of computation. The bang appears at the
logical time of the first sample in each block (the earliest logical time whose
control computation affects that block and not the previous one), following
the scheme shown
in Figure <A HREF="node42.html#fig03.02">3.2</A>.
<P>
<BR><!-- MATH
$\fbox{\texttt{tabsend\~}}$
-->
<IMG
WIDTH="81" HEIGHT="39" ALIGN="MIDDLE" BORDER="0"
SRC="img1233.png"
ALT="\fbox{\texttt{tabsend\~}}">:
<A ID="12904"></A>the companion object for <TT>tabreceive~</TT>, repeatedly copies its input to
the contents of a table, affecting up to the first <IMG
WIDTH="18" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img3.png"
ALT="$N$"> samples of the table.
<P>
The power averaging process is begun by sending a time duration in milliseconds
to "make-mask". The patch computes the equivalent number of blocks <IMG
WIDTH="10" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img21.png"
ALT="$b$">
and generates a sequence of weights: <!-- MATH
$1, 1/2, 1/3, \ldots, 1/b$
-->
<IMG
WIDTH="131" HEIGHT="32" ALIGN="MIDDLE" BORDER="0"
SRC="img1235.png"
ALT="$1, 1/2, 1/3, \ldots, 1/b$">,
by which each of the <IMG
WIDTH="10" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img21.png"
ALT="$b$"> following blocks' power is averaged into whatever the
mask table held at the previous block. At the end of <IMG
WIDTH="10" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img21.png"
ALT="$b$"> blocks the table holds
the equally-weighted average of all <IMG
WIDTH="10" HEIGHT="14" ALIGN="BOTTOM" BORDER="0"
SRC="img21.png"
ALT="$b$"> power measurements. Thereafter, the
weight for averaging new power measurements is zero, so the measured average
stops evolving.
<P>
To use this patch for classical noise suppression requires at least a few
seconds of recorded noise without the "signal" present. This is played into
the patch, and its duration sent to "make-mask", so that the
"$0-mask" table holds the average measured noise power for each channel.
Then, making the assumption that the noisy part of the signal rarely exceeds 10
times its average power (for example), "mask-level" is set to 10, and the
signal to be noise-suppressed is sent through part (a) of the patch. The noise
will be almost all gone, but those channels in which the signal exceeds 20
times the noise power will only be attenuated by 3dB, and higher-power channels
progressively less. (Of course, actual noise suppression might not be the
most interesting application of the patch; one could try masking any signal
from any other one.)
<P>
<HR>
<!--Navigation Panel-->
<A ID="tex2html3259"
HREF="node181.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next"
SRC="next.png"></A>
<A ID="tex2html3253"
HREF="node178.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up"
SRC="up.png"></A>
<A ID="tex2html3247"
HREF="node179.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous"
SRC="prev.png"></A>
<A ID="tex2html3255"
HREF="node4.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents"
SRC="contents.png"></A>
<A ID="tex2html3257"
HREF="node201.html">
<IMG WIDTH="43" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="index"
SRC="index.png"></A>
<BR>
<B> Next:</B> <A ID="tex2html3260"
HREF="node181.html">Timbre stamp ("vocoder")</A>
<B> Up:</B> <A ID="tex2html3254"
HREF="node178.html">Examples</A>
<B> Previous:</B> <A ID="tex2html3248"
HREF="node179.html">Fourier analysis and resynthesis</A>
&nbsp; <B> <A ID="tex2html3256"
HREF="node4.html">Contents</A></B>
&nbsp; <B> <A ID="tex2html3258"
HREF="node201.html">Index</A></B>
<!--End of Navigation Panel-->
<ADDRESS>
Miller Puckette
2006-12-30
</ADDRESS>
</BODY>
</HTML>