shithub: sox

Download patch

ref: 4c8e01b3df850a0aefdc5d9860d7cff9a4f74dcf
parent: 6781f7b4630e07f84679fd8e79044a825751aac9
author: cbagwell <cbagwell>
date: Tue Aug 1 14:03:18 EDT 2000

Updated on man pages.

--- a/Changelog
+++ b/Changelog
@@ -70,7 +70,7 @@
   o Fabien COELHO added a speed effect to sox (like speeding up a tape
     machine).  Also added pitch which changes pitch without effecting
     duration and stretch which stretch time without effecting pitch.
-  o Leigh Smit updated aiff support to use the COMT check when writing
+  o Leigh Smith updated aiff support to use the COMT check when writing
     comments instead of the ANNO.  It is the prefered method from Apple
     and newer programs are starting to require it.  Also fixed some bugs
     in how we compute the length of various chunks in output files.
--- a/sox.1
+++ b/sox.1
@@ -755,7 +755,7 @@
 
 .br
 -cutoff # : specify the filter cutoff frequency in terms of fraction of
-bandwidth, also know as the Nyquist frequency.  Please see 
+frequency bandwidth, also know as the Nyquist frequency.  Please see 
 the \fIresample\fR effect for
 further information on Nyquist frequency.  If upsampling, then this is the 
 fraction of the original signal
@@ -831,15 +831,23 @@
 be something between 0.0 and 1.0, in practice 0.8-0.95.  The defaults are
 indicated above.
 
-The \fINyquist frequency\fR is 1/2 of the sample rate.  This refers to the
-fact that an audio file can only represent frequencies up to 1/2 of the 
-sample rate.  Therefore, when reducing the sample rate of an audio file a
-filter will remove all frequency information above the new Nyquist frequency.
+The \fINyquist frequency\fR is equal to (sample rate / 2).  Logically,
+this is because the A/D converter needs at least 2 samples to detect 1
+cycle at the Nyquist frequency.  Frequencies higher then the Nyquist
+will actually appear as lower frequencies to the A/D converter and
+is called aliasing.  Normally, A/D converts run the signal through
+a highpass filter first to avoid these problems.
+
+Similar problems will happen in software when reducing the sample rate of 
+an audio file (frequencies above the new Nyquist frequency can be aliased
+to lower frequencies).  Therefore, a good resample effect
+will remove all frequency information above the new Nyquist frequency.
+
 The \fIrolloff\fR refers to how close to the Nyquist frequency this cutoff
 is, with closer being better.  When increasing the sample rate of an 
 audio file you would not expect to have any frequencies exist that are 
-past the original Nyquist frequency.  Because of filter properties, it 
-is common to have false frequency data created that is above the old 
+past the original Nyquist frequency.  Because of resampling properties, it 
+is common to have alaising data created that is above the old 
 Nyquist frequency.  In that case the \fIrolloff\fR refers to how close 
 to the original Nyquist frequency to use a highpass filter to remove
 this false data, with closer also being better.
--- a/src/resample.c
+++ b/src/resample.c
@@ -20,14 +20,17 @@
  * at ftp://ccrma-ftp.stanford.edu/pub/NeXT/
  * under the name of resample-version.number.tar.Z
  *
- * NOTE: This source badly needs to be updated to reflect the latest
- * version of the above software!  Someone please perform this and
- * send patches to cbagwell@sprynet.com.
+ * NOTE: There is a newer version of the resample routine then what
+ * this file was originally based on.  Those adventurous might be
+ * interested in reviewing its improvesments and porting it to this
+ * version.
  */
+
 /* Fixed bug: roll off frequency was wrong, too high by 2 when upsampling,
  * too low by 2 when downsampling.
  * Andreas Wilde, 12. Feb. 1999, andreas@eakaw2.et.tu-dresden.de
 */
+
 /*
  * October 29, 1999
  * Various changes, bugfixes(?), increased precision, by Stan Brooks.