Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!usc!chaph.usc.edu!alcor.usc.edu!alves From: alves@alcor.usc.edu (William Alves) Newsgroups: comp.music Subject: Re: Books on massaging waveforms... Keywords: samples sound Message-ID: <10494@chaph.usc.edu> Date: 29 Jun 90 22:23:33 GMT References: <4090@uqcspe.cs.uq.oz.au> <987@anaxagoras.ils.nwu.edu> Sender: news@chaph.usc.edu Organization: University of Southern California, Los Angeles, CA Lines: 41 >In article <4090@uqcspe.cs.uq.oz.au>, tonyg@batserver.cs.uq.oz.au (Tony >Gedge) writes: >> Can someone point me towards a good starting book in manipulating >> sampled sound? I want to do things like: >> >> * Raise and lower the pitch of samples without changing the speed >> that samples are played. >> * Mix two or more samples together. >> * Change the sampling rate. >> Try "Programs for Digital Signal Processing" (IEEE press, 1979). It con- tains many sample programs (unfortunately all in Fortran) to do all of what you're asking and much more. To mix 2 samples, simply add them, taking care that the sum doesn't go out of range. The easy (but not optimal) way to do this is to divide each one by 2 before adding. The optimal way would be to have a normalization pass. In article <987@anaxagoras.ils.nwu.edu> sandell@ils.nwu.edu (Greg Sandell) writes: >For changing the >sampling rate, if you are going from a higher sampling rate to a lower >one, you can keep one sample, delete the next (new_samp_rate/old_samp_rate) >samples, and keep doing this for the rest of the soundfile. I have done this >in going from 22000k to 8000k and the results sound just fine. Somehow >I suspect this is not the most HiFi way to do this task, though. As for going >from a smaller sampling rate to a larger one, the strategy of duplicating >samples in the equivalent way will *definitely* not work! Your results probably sounded okay because you didn't have too much frequency information above the new Nyquist frequency. If you did, you would experience aliasing. Thus your suspicions are correct. One should first apply a low-pass filter to make sure this doesn't happen. Likewise, when interpolating samples (smaller to larger sampling rate), one must take care that the new samples don't introduce unwanted frequencies. Because this is a fundamental function of samplers, several solutions have been developed. One of the fastest is detailed in the following paper: Andy Duncan and Dave Rossum, "Fundamentals of Pitch Shifting," presented at the 85th convention of the Audio Engineering Society, preprint #2714 (1988). These are the fellows who developed the Emulator at Emu. Bill Alves