resample (1)





NAME

       resample  - resample a 16-bit mono or stereo sound file by an arbitrary
       factor


SYNOPSIS

       resample [-by factor] [-to newSrate] [-f filterFile] [-n] [-l] [-trace]
       [-version] inputFile [outputFile]


DESCRIPTION

       The  resample  program  takes  a 16-bit mono or stereo sound file and a
       "sampling-rate conversion factor" r, specified as a floating-point num-
       ber,  and  produces an output sound file whose sampling rate is r times
       that of the input file.

       The output file is in AIFF format. If you omit the  output  file  name,
       resample  will  create a file using the input file name, with ".resamp"
       appended.


OPTIONS

       -byFactor
              Specify  conversion  factor.   This  option  or  "-toSrate"   is
              required.  The conversion factor is the amount by which the sam-
              pling rate is changed.  If the sampling rate of the input signal
              is  Srate1,  then  the  sampling  rate  of  the  output  is fac-
              tor*Srate1.  For example, a factor of 2.0 increases the sampling
              rate  by a factor of 2, giving twice as many samples in the out-
              put signal as in the input.  The fractional part of the  conver-
              sion  factor is accurate to 15 bits.  This is sufficiently accu-
              rate that humans should not be able to hear any error whatsoever
              in the pitch of resampled sounds.

       -toSrate
              Specify new sampling rate in samples per second.  The conversion
              factor is implied and will be  set  to  the  new  sampling  rate
              divided by the sampling rate of the input soundfile.

       -filterFile
              Change  the  resampling  filter from its default.  Such a filter
              file can be designed by the windowfilter (1)  program  (included
              with  the  resample  distribution).   The  preloaded filter file
              requires an oversampling factor of at least 20% to avoid  alias-
              ing  (in  other words, its "transition band" as a lowpass filter
              is at least 20% of the useable frequency range  in  the  sampled
              signal); the stop-band attenuation is approximately 80 dB.

       -noFilterInterp
              By default, the resampling filter table is linearly interpolated
              to provide high audio quality at arbitrary sampling-rate conver-
              sion  factors.  This option turns off filter interpolation, thus
              tion  of the signal with linear interpolation of the resampling-
              filter-table which is controlled by the "noFilterInterp" option.

       -terse Disable informational printout.

       -version
              Print program version.


EXAMPLE

       To convert the sampling rate from 48 kHz (used by DAT machines) to 44.1
       kHz (the standard sampling rate for Compact Discs),  the  command  line
       would look something like

            resample -by 0.91875 dat.snd cd.snd

       or, more simply,

            resample -to 44100 dat.snd cd.snd

       Any  reasonable  sampling  rate  can  be converted to any other.  (Note
       that, in this example, if you have obtained a  direct-digital  transfer
       from  DAT  or  CD,  you probably have some pre-emphasis filtering which
       should be canceled using a digital filter. See README.deemphasis in the
       resample release for further information)


REFERENCES

       Source code and further documentation may be found at the Digital Audio
       Resampling Home Page located at

            http://www-ccrma.stanford.edu/~jos/resample/


HISTORY

       The first version of this software was written by Julius O.  Smith  III
       <jos@ccrma.stanford.edu>  at  CCRMA  <http://www-ccrma.stanford.edu> in
       1981.  It was called SRCONV and was written in SAIL for PDP-10 compati-
       ble machines.  The algorithm was first published in

       Smith,  Julius  O. and Phil Gossett. ``A Flexible Sampling-Rate Conver-
       sion Method,''  Proceedings  (2):  19.4.1-19.4.4,  IEEE  Conference  on
       Acoustics, Speech, and Signal Processing, San Diego, March 1984.

       An  expanded  tutorial  based on this paper is available at the Digital
       Audio Resampling Home Page given above.

       Circa 1988, the SRCONV  program  was  translated  from  SAIL  to  C  by
       Christopher Lee Fraley working with Roger Dannenberg at CMU.

       Since then, the C version has been maintained by jos.

       Sndlib support was added 6/99 by John Gibson <jgg9c@virginia.edu>.

       The  resample  program  is free software distributed in accordance with