Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!cs.utexas.edu!tut.cis.ohio-state.edu!ucbvax!DC@max.berkeley.edu From: dc@max.berkeley.edu Newsgroups: comp.music Subject: Re: Manipulating sampled sounds. Message-ID: <00933E08.7E4E7D40@max.berkeley.edu> Date: 18 Mar 90 23:46:17 GMT References: <2441@rodan.acs.syr.edu> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: dc@max.berkeley.edu Organization: University of California, Berkeley Lines: 19 One approach you could take that I have not seen mentioned in the various replies to your query in the newsgroup is the brute force method of FFTing the entire stream, truncating the spectrum (i.e. setting everything over 5500 Hz to zero), FFTing back, and picking every fifth sample. This is in some sense the "best" way to do it, and the more usual FIR approach is a decent approximation to this. This method probably sounds intractable but in some cases can actually be faster than the FIR approach, particularly if you want good accuracy. For example, if your samples are 16 bits and you want to preserve you S/N, you need a filter that's good to 96 dB, and if you don't want to roll off too far below the Nyquist frequency, then you are looking at a very long FIR filter, and consequently a long time spent in filtering. If you can fit your whole tune on disk, there are good algorithms for doing the FFT, and the IEEE DSP book that someone else pointed you toward has a canned program for doing this that I've had a lot of luck with. It would probably be more sensible to do it a chunk at a time, but this would involve thinking carefully about how to best window the FFT and how the quality of the resulting filter compares to a FIR. Dave Cottingham