1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
|
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="GENERATOR" CONTENT="Mozilla/4.03 [en] (X11; I; IRIX 6.3 IP32) [Netscape]">
<TITLE>DOWNSAMP</TITLE>
</HEAD>
<BODY>
<CENTER><A NAME="downsamp"></A>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SIG_MOD.html">Top of this section</A></B> - <A HREF="dam.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="harmon.html">Next</A>
<HR></CENTER>
<H2>
samphold, downsamp, upsamp, interp, integ, diff, samphold</H2>
<PRE> kr <B>downsamp</B> asig[, iwlen]
ar <B>upsamp</B> ksig
ar <B>interp</B> ksig[, istor]
kr <B>integ</B> ksig[, istor]
ar <B>integ</B> asig[, istor]
kr <B>diff</B> ksig[, istor]
ar <B>diff</B> asig[, istor]
kr <B>samphold</B> xsig, kgate[, ival, ivstor]
ar <B>samphold</B> asig, xgate[, ival, ivstor]</PRE>
<HR>
<H4>
<U>DESCRIPTION</U></H4>
Modify a signal by up- or down-sampling, integration, and differentiation.
<H4>
<U>INITIALIZATION</U></H4>
<I>iwlen</I> (optional) - window length in samples over which the audio
signal is averaged to determine a downsampled value. Maximum length is
<I>ksmps</I>; 0 and 1 imply no window averaging. The default value is 0.
<P><I>istor</I> (optional) - initial disposition of internal save space
( <A HREF="port.html">see reson</A>). The default value is 0.
<P><I>ival, ivstor</I> (optional) - controls initial disposition of internal
save space. If <I>ivstor</I> is zero the internal "hold" value is set to
<I>ival</I> ; else it retains its previous value. Defaults are 0,0 (i.e.
init to zero)
<H4>
<U>PERFORMANCE</U></H4>
<B>downsamp</B> converts an audio signal to a control signal by downsampling.
It produces one kval for each audio control period. The optional window
invokes a simple averaging process to suppress foldover.
<P><B>upsamp, interp</B> convert a <I>control</I> signal to an <I>audio</I>
signal. The first does it by simple repetition of the kval, the second
by linear interpolation between successive kvals. <B>upsamp</B> is a slightly
more efficient form of the assignment, `asig = ksig'.
<P><B>integ, diff</B> perform <I>integration</I> and <I>differentiation</I>
on an input control signal or audio signal. Each is the converse of the
other, and applying both will reconstruct the original signal. Since these
units are special cases of low-pass and high-pass filters, they produce
a scaled (and phase shifted) output that is frequency-dependent. Thus <B>diff</B>
of a sine produces a cosine, with amplitude <I>2 * sin(pi * cps / <B>sr</B>)</I>
that of the original (for each component partial); <B>integ</B> will inversely
affect the magnitudes of its component inputs. With this understanding,
these units can provide useful signal modification.
<P><B>samphold</B> performs a sample-and-hold operation on its input according
to the value of <I>gate</I>. If <I>gate > 0</I>, the input samples are
passed to the output; If <I>gate >= 0</I>, the last output value is repeated.
The controlling <I>gate</I> can be a constant, a control signal, or an
audio signal.
<H4>
<U>EXAMPLE:</U></H4>
<PRE> asrc <B>buzz</B> 10000,440,20, 1 ; band-limited pulse train
adif <B>diff</B> asrc ; emphasize the highs
anew <B>balance</B> adif, asrc ; but retain the power
agate <B>reson</B> asrc,0,440 ; use a lowpass of the original
asamp <B>samphold</B> anew, agate ; to gate the new audiosig
aout <B>tone</B> asamp,100 ; smooth out the rough edges</PRE>
<CENTER><P>
<HR><B><A HREF="../REFER.html">QUICK-REF</A></B> - <B><A HREF="../TITLE.html"><FONT SIZE=+1>C</FONT>soundManual</A></B>
- <B><A HREF="SIG_MOD.html">Top of this section</A></B> - <A HREF="dam.html">Previous</A>
- <A HREF="../CONTENTS.html">Contents</A> - <A HREF="../INDEX.html">Index</A>
- <A HREF="harmon.html">Next</A>
<HR></CENTER>
<P><CENTER>
<B><I><FONT COLOR="#006600">HTML Csound Manual - <FONT SIZE=-1>©
Jean Piché & Peter J. Nix, 1994-97</FONT></FONT></I></B>
</CENTER>
</HTML>
|