vibrato

Digital Signal Processing Framework for Java


Project maintained by ghadeeras Hosted on GitHub Pages — Theme by mattgraham

Fourier Transforms

The vibrato.fourier package contains the classes that transform a “windowed signal” from/to its discrete time-domain representation (real time samples) to/from its discrete frequency-domain representation (complex frequency samples).

There are three main classes in this package:

For all these classes, the constructors/factory methods take the minimum number of time/frequency samples. The actual number of samples is the nearest higher power of two.

Example:

class MyClass {
    
    public static void main(String[] args) {
        var sawSignal = RealVector.window(1000, i -> (i % 100) / 100d);
        var fft = new FFT(500);

        var buffer = new ComplexBuffer(fft.frequencySamplesCount());
        ComplexBuffer.Pointer pointer = buffer.pointer();

        fft.transform(sawSignal, pointer);

        for (var i = 0; i < fft.frequencySamplesCount(); i++) {
            System.out.println(pointer.slideTo(i));
        }
    }
    
}