Java FFT ToolkitAn application and java API for spectral manipulation
So I wanted to manipulate spectral data in java code, and I couldn't find any useful code libraries out there fore it, so I buckled down and wrote one myself. It has methods for vector addition, creating an average frame out of a range of frames (an aggregate), comparing FFT frames for similarity, and more. I then used it to make an application that runs three of my ideas for a spectrum-based manipulation, that implement spectral-analysis based splicing, morphing and reconstitution. Use it and have fun.
Download
To use the API, just copy FFTToolkit.jar into your classpath. To use the app, just double click "runMeOnAPC.bat" or "runMeOnAMac.command"
Java API
There are a few java classes that may be useful to you, specifically the following:
- FFTSettings - holds values for FFTSize, WindowSize, and HopSize.
- FFTFile - holds an array of FFTFrame for each channel of a sound file.
Create one by passing the file name of a sound file (currently only 16bit, 44.1K aiff and wave formats are accepted), and of an instance of the class FFTSettings. Write an FFTFile to a sound file with the writefile(String outputname) method.
- FFTFrame - holds a single frame as an array of PolarPhasor
- PolarPhasor - holds a single phasor as two floats, "mag" and "phase"
Here's all you really need to get started, check the docs for more:
| |
FFTSettings mySettings = new FFTSettings();
FFTFile myFFTFile = new FFTFile("soundfile.wav", myFFTSettings);
//get the magnitude and phase value of channel 0, frame 50, bin 25
float specificMag = myFFTFile.frame[0][50].bin[25].mag;
float specificPhase = myFFTFile.frame[0][50].bin[25].phase;
//create a new blank FFTFile of 2 channels, length 1000 frames
FFTFile myBlankFFT = new FFTFile(2,1000,mySettings);
//fill it in however you want, here I'll fill the first frame of the left channel with a morph of two other frames, 35% morph with minimum bin threshold of 2
myBlankFFT.frame[0][0] = MorphEngine.interpolatedFrame(mySourceFFTFrame1, mySourceFFTFrame2, .35, 2.);
//write to file
myBlankFFT.write("outputFilename.wav");
|
New algorithms and GUI application for your fun
I used this API to make a application that implements 3 spectral tasks I had been toying with.
 
No compiling or java knowledge necessary! Just play with the sliders...
|