Tristan Matthews | 0a329cc | 2013-07-17 13:20:14 -0400 | [diff] [blame] | 1 | README file for resample-1.x.tgz from the |
| 2 | Digital Audio Resampling Home Page located at |
| 3 | http://ccrma.stanford.edu/~jos/resample/. |
| 4 | |
| 5 | SOFTWARE FOR SAMPLING-RATE CONVERSION AND FIR DIGITAL FILTER DESIGN |
| 6 | |
| 7 | For installation instructions, read the INSTALL file in this directory. |
| 8 | |
| 9 | The resample program "resamples" a soundfile to change its sampling |
| 10 | rate. For example, it can be used to convert the sampling rate from |
| 11 | 48 kHz (used by DAT machines) to 44.1 kHz (the standard sampling rate |
| 12 | for Compact Discs). The command line for this operation would look |
| 13 | something like |
| 14 | |
| 15 | resample -by 0.91875 dat.snd cd.snd |
| 16 | |
| 17 | or, more simply, |
| 18 | |
| 19 | resample -to 44100 dat.snd cd.snd |
| 20 | |
| 21 | Any reasonable sampling rate can be converted to any other. |
| 22 | |
| 23 | The windowfilter program designs Finite-Impulse-Response (FIR) digital |
| 24 | filters by the so-called "window method." In this method, the ideal |
| 25 | impulse response (a sinc function) is "windowed" by a Kaiser window (a |
| 26 | popular window used in spectrum analysis). |
| 27 | |
| 28 | The resample program uses 32-bit fixed-point arithmetic: 16-bits data |
| 29 | and 16-bits coefficients. The input soundfile must be 16-bit mono or |
| 30 | stereo (interleaved) audio data. |
| 31 | |
| 32 | SNDLIB |
| 33 | |
| 34 | The program uses elements of Bill Schottstaedt's sndlib sound file |
| 35 | library. This means resample can read many different kinds of sound |
| 36 | file header (AIFF, WAV, NeXT, IRCAM, etc.). |
| 37 | |
| 38 | The sndlib files used by resample are included in this directory to |
| 39 | ensure stability. The latest version of sndlib should be available as |
| 40 | |
| 41 | ftp://ccrma-ftp.stanford.edu/pub/Lisp/sndlib.tar.gz |
| 42 | |
| 43 | See sndlib.html in the sndlib distribution for documentation of SNDLIB. |
| 44 | |
| 45 | CONTENTS of ./src directory |
| 46 | |
| 47 | resample.c Sampling-rate conversion program. |
| 48 | resample.1 Manual page for resample. Try "nroff -man resample.1". |
| 49 | resamplesubs.c Subroutines used by resample. |
| 50 | resample.h Configuration constants for the sampling rate converter. |
| 51 | stdefs.h Machine-dependent definitions, useful constants and macros. |
| 52 | |
| 53 | windowfilter.c Program for designing FIR digital filters used by resample. |
| 54 | windowfilter.1 Manual page for windowfilter. |
| 55 | filterkit.c Library for filter design, application, and file management. |
| 56 | filterkit.h Declarations (procedure prototypes) for the filterkit library. |
| 57 | |
| 58 | README This file. |
| 59 | README.deemph A word about deemphasis filtering. |
| 60 | LGPL GNU Lesser General Public License (LGPL) |
| 61 | |
| 62 | SNDLIB files: |
| 63 | io.c |
| 64 | audio.c |
| 65 | headers.c |
| 66 | sound.c |
| 67 | sndlib.h |
| 68 | sndlib-strings.h |
| 69 | |
| 70 | COPYING |
| 71 | |
| 72 | SNDLIB files are Copyright 2000 by Bill Schottstaedt <bil@ccrma.stanford.edu>. |
| 73 | |
| 74 | The remaining files in this package, unless otherwise noted, are |
| 75 | Copyright 1994-2006 by Julius O. Smith III <jos@ccrma.stanford.edu>, |
| 76 | all rights reserved. Permission to use and copy is granted subject to |
| 77 | the terms of the "GNU Lesser General Public License" (LGPL) as |
| 78 | published by the Free Software Foundation; either version 2.1 of the |
| 79 | License, or any later version. In addition, we request that a copy of |
| 80 | any modified files be sent by email to jos@ccrma.stanford.edu so that |
| 81 | we may incorporate them into the CCRMA version. |
| 82 | |
| 83 | This library is distributed in the hope that it will be useful, |
| 84 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 85 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 86 | Lesser General Public License for more details. |
| 87 | |
| 88 | FILTERKIT CONTENTS |
| 89 | |
| 90 | LpFilter() - Calculates the filter coeffs for a Kaiser-windowed |
| 91 | low-pass filter with a given roll-off frequency. These |
| 92 | coeffs are stored into a array of doubles. |
| 93 | |
| 94 | writeFilter() - Writes a filter to a file. |
| 95 | |
| 96 | makeFilter() - A section of the original SAIL program. Calls |
| 97 | LpFilter() to create a filter, then scales the double |
| 98 | coeffs into a array of half words. |
| 99 | |
| 100 | readFilter() - Reads a filter from a file. |
| 101 | |
| 102 | FilterUp() - Applies a filter to a given sample when up-converting. |
| 103 | |
| 104 | FilterUD() - Applies a filter to a given sample when up- or down- |
| 105 | converting. Both are repoductions of the original SAIL |
| 106 | program. |
| 107 | |
| 108 | initZerox() - Initialization routine for the zerox() function. Must |
| 109 | be called before zerox() is called. This routine loads |
| 110 | the correct filter so zerox() can use it. |
| 111 | |
| 112 | zerox() - Given a pointer into a sample, finds a zero-crossing on the |
| 113 | interval [pointer-1:pointer+2] by iteration. |
| 114 | |
| 115 | Query() - Ask the user for a yes/no question with prompt, default, |
| 116 | and optional help. |
| 117 | |
| 118 | GetUShort() - Ask the user for a unsigned short with prompt, default, |
| 119 | and optional help. |
| 120 | |
| 121 | GetDouble() - Ask the user for a double with prompt, default, and |
| 122 | optional help. |
| 123 | |
| 124 | GetString() - Ask the user for a string with prompt, default, and |
| 125 | optional help. |
| 126 | |
| 127 | |
| 128 | FILTER FILE FORMAT |
| 129 | |
| 130 | File Name: "F" Nmult "T" Nhc ".filter" |
| 131 | example: "F13T8.filter" and "F27T8.filter" |
| 132 | |
| 133 | Structure of File: |
| 134 | "ScaleFactor" LpScl |
| 135 | "Length" Nwing |
| 136 | "Coeffs:" |
| 137 | Imp[0] |
| 138 | Imp[1] |
| 139 | : |
| 140 | Imp[Nwing-1] |
| 141 | "Differences:" |
| 142 | ImpD[0] |
| 143 | ImpD[1] |
| 144 | : |
| 145 | ImpD[Nwing-1] |
| 146 | EOF |
| 147 | |
| 148 | where: Something enclosed in "" indicates specific characters in the file. |
| 149 | Nmult, Nwing, Imp[], and ImpD[] are variables (HWORD) |
| 150 | Npc is a conversion constant. |
| 151 | EOF is the end of the file. |
| 152 | |
| 153 | See writeFilter() and readFilter() in "filterkit.c" for more details. |
| 154 | |