RESAMPLE(1)

πŸ“¦
version 1.8.1 Β· 2 versions
, in opensuse-leap 16.0, ubuntu jammy

πŸŽ€ RESAMPLE(1) πŸŽ€

ok so you found yourself in the General Commands Manual section, bestie, and this is resample β€” the little icon that resamples a 16-bit mono or stereo sound file by an arbitrary factor. yes, arbitrary. she does not gatekeep. ✨


πŸ’– 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 πŸ¦‹

okay so here's the vibe: resample takes a 16-bit mono or stereo sound file and does bandlimited interpolation to produce an output sound file that has whatever new sampling rate you asked for. the output file is in the same format as the input. no glow-up, no surprise format change, just the rate. periodt. πŸ’…


✨ OPTIONS ✨

  • -toSrate β€” this option or "-byFactor" is required, so pick one, you can't skip this step bestie. it specifies the new sampling rate in samples per second. the conversion factor is implied and gets set to the new sampling rate divided by the sampling rate of the input soundfile.
  • -byFactor β€” specify the conversion factor. this option or "-toSrate" is required (again: one of them, not neither). the conversion factor is the amount by which the sampling rate is changed. if the sampling rate of the input signal is Srate1, then the sampling rate of the output is factor*Srate1. for example, a factor of 2.0 increases the sampling rate by a factor of 2, giving twice as many samples in the output signal as in the input. the fractional part of the conversion factor is accurate to 15 bits, which is so accurate that humans should not be able to hear any error whatsoever in the pitch of resampled sounds. we love a precise queen. πŸ‘‘
  • -filterFile β€” change the resampling filter from its default. a filter file like this can be designed by the windowfilter (1) program (included with the resample distribution, cute right?). the preloaded filter file requires an oversampling factor of at least 20% to avoid aliasing β€” 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 conversion factors. this option turns off filter interpolation, which cuts the number of multiply-adds in half in the inner loop (for most conversion factors). efficiency era fr fr. ⚑
  • -linearInterpolation β€” select plain linear interpolation for resampling, which means the resampling filter table is not used at all. this option is very fast, but the output quality is poor unless the signal is already heavily oversampled. > do not confuse linear interpolation of the signal with linear interpolation of the resampling-filter-table, which is controlled by the "noFilterInterp" option. two completely different things, bestie, do not mix them up. πŸ™ˆ
  • -terse β€” disable informational printout. she's quiet now. shh. 🀫
  • -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 -to 44100 dat.snd cd.snd or      resample -by 0.91875
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.deemph in the resample release for further information)


πŸ’œ REFERENCES πŸ’œ

source code and further documentation may be found at the Digital Audio Resampling Home Page (DARHP) located at

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

πŸ‘‘ HISTORY πŸ‘‘

the first version of this software was written by Julius O. Smith III <jos /at/ ccrma /dot/ stanford /dot/ edu> at CCRMA <http://ccrma.stanford.edu> in 1981. it was called SRCONV and was written in SAIL for PDP-10 compatible machines (see the DARHP for that code). the algorithm was first published in

Smith, Julius O. and Phil Gossett. ``A Flexible Sampling-Rate Conversion 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 DARHP.

circa 1988, the SRCONV program was translated from SAIL to C by Christopher Lee Fraley working with Roger Dannenberg at CMU. the lore is deep. πŸ“œ

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 the Lesser GNU Public License (LGPL).

there is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. she said what she said. πŸ’€

and that's the whole page, bestie!! 🫢 this was brought to you by CCRMA, dated 5 Jan 2006, under the title RESAMPLE(1) β€” go forth and convert every sampling rate your heart desires. mwah. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ