From: John David Eriksen on 8 Aug 2010 22:46 Hi All, I'm working on a fun little audio side-project. I want to be able to create a sound collage using sounds I find online. I hope you can point me in the right direction with regard to algorithms, approaches, etc. I'll be writing a Clojure (Java) program to find and download mp3s, chop them up into chunks, perform spectrum analysis on the chunks, and then write an algorithm to layer them together in such a way that I don't combine two or more chunks with lots of amplitude in a given frequency band. Basically, I want to avoid layering two very bassy sounds together or two very hissy sounds together so that the finished sound collage has some space and musicality. I'll want to figure out a quick way to adjust amplitude to prevent clipping, as well. But that will wait until a later time. So. I've found Java libraries for manipulating chunks of sound, but have not found libraries that I could easily use to obtain the kinds of spectral information I want. When I'm done analyzing a chunk of sound, I want the following information. I want the average amplitude of the energy at the given frequency bands over the length of the sound sample expressed as a floating-point value between 0 and 1.0: 0 - 150 150 - 250 250 - 350 350 - 500 500 - 750 750 - 1000 1000 - 1500 1500 - 2500 2500 - 5000 5000+ A chunk of a bass-heavy dance track might look like: {0.8, 0.9. 0.6, 0.5, 0.4, 0.4, 0.3, 0.2, 0.2, 0.2} A field recording of birds might look like: {0.0, 0.1, 0.2, 0.3, 0.5, 0.6, 0.4, 0.2, 0.1, 0.1} I'm looking for something quick and dirty that can execute quickly. I've read enough about spectrum analysis to determine that I need to use an FFT. I located the following FFT Java library: http://sites.google.com/site/piotrwendykier/software/jtransforms which provides access to FFTs of various types over sets of single and double-precision data. I have a basic (if rusty) understanding of discrete math and have to admit that the Wikipedia pages on these subjects have not been terribly illuminating. I appreciate any pointers and general guidance. Thanks! John David
From: Vladimir Vassilevsky on 9 Aug 2010 08:29 John David Eriksen wrote: > When I'm done analyzing a chunk of sound, I want the following > information. I want the average amplitude of the energy at the given > frequency bands over the length of the sound sample expressed as a > floating-point value between 0 and 1.0: > I'm looking for something quick and dirty that can execute quickly. Use a simplest zero crossing period counter. Make a hystogram of half-periods. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
From: jacko on 9 Aug 2010 12:49 high pass the top half of your spectrum and measure the range min,max. square your residual and repeat for an octave division... normalize outputs to approximate unit range. Not as quick as Vlad's but will be different. Cheers Jacko
From: Mark on 9 Aug 2010 13:05 > > When I'm done analyzing a chunk of sound, I want the following > information. I want the average amplitude of the energy at the given > frequency bands over the length of the sound sample The MP3 compression has already perfomred a frequency domain analysis, perhaps you can use the MP3 data? Mark
From: John David Eriksen on 9 Aug 2010 13:53
On Aug 9, 6:29 am, Vladimir Vassilevsky <nos...(a)nowhere.com> wrote: > John David Eriksen wrote: > > When I'm done analyzing a chunk of sound, I want the following > > information. I want the average amplitude of the energy at the given > > frequency bands over the length of the sound sample expressed as a > > floating-point value between 0 and 1.0: > > I'm looking for something quick and dirty that can execute quickly. > > Use a simplest zero crossing period counter. > Make a hystogram of half-periods. > > Vladimir Vassilevsky > DSP and Mixed Signal Design Consultanthttp://www.abvolt.com Hi Vladimir, Thanks for your help. Correct me if I am wrong, but doesn't zero crossing information fail to give me any information about amplitude? John David |