Return to Dave's Planet

This is a Java project that performs FFT/Wavelet like audio deconstruction and re-synthesis but which adds greater flexibility for the developer seeking to perform audio processing. Source code for the full project may be downloaded from here.

This code is the original work and copyright property of David Hill - Dave@DavesPlanet.net, All rights reserved. For educational purposes only, Redistribution of this or any derived work is strictly forbidden.

These are not Fourier transforms and they are not Wavelets. They are similar but different. I originally named everything after Wavelets but as I prepared to release the code I decided this could cause confusion and so I renamed everything Davelets (a corny but useful naming distinction).

All things Fourier are based on window sizes that are a power of 2 and all frequencies must be less than the widow size.

Wavelets are based on variable window sizes, high frequency small windows and low frequency wide windows. This gives much greater resolution of all the frequencies involved but presents difficulties in viewing a single discrete slice of the signal.

A Davelet window size can be any positive integer value and can represents the entire frequency range present regardless of how narrow the window. It does this by comparing an arbitrary number of neighboring Davelets to extend the frequency response to whatever level is desired. Each Davelet represents a list of DaveletBands (frequency, amplitude, phase) that can be recombined into the original window points. The fact that a Davelet is always a single fixed width vertical slice of the source file makes them ideal for many types of audio modification.

The power of Davelets to create arbitrarily thin slices of data at arbitrary frequency response can be demonstrated at an extreme by selecting a 22050hz input file, a 5 point window, and allowing 30 neighboring Davelets to share. The result will be a near perfect reproduction of the original, though computationally intensive. The following command will perform this demonstration:

target\test-classes\ab.wav 5 30

Class Davelet.java contins a list of DaveletBand.java, each band represents the amplitude and phase at a given frequency. The frequency is defined as 1.0 = one full sine wave over the selected window size. The frequency is a double and can take on any value, it can be greater or less than 1.0

The first parameter is a wav file to process. Currently supported is the 16 bit mono little endian wav file. It might also still work with 8 bit files but I haven't used one in a long time.

The second parameter is an integer window size, a number of sample points that each Davelet will represent.

The third parameter is the number of passes, or the number of neighboring Davelets that will be combined to detect extended frequency ranges in DaveletUtil.processNeighboringFrequencies. A value of 1 will cause no neighboring Davelets to be used, just the basic processing of frequencies of 1.0 and higher.

Use the -Xmx1g JVM parameter to give the app enough memory, I've been working with a 22 second file without problems.

example usages that all reproduce 22050hz with good results are
target\test-classes\ab.wav 20 5
target\test-classes\ab.wav 150 1
target\test-classes\ab.wav 5 10

One last detail, Microsoft media player takes exception to my output, simple to figure out why, but I use Audacity so I haven't bothered to look. If you want to see the difference, just load a resulting wav in Audacity and save it back out again in the same format. The one Audacity saves will play in media player, should be easy to see the difference.

Download the full project here.

Return to Dave's Planet