ddf / Minim

A Java audio library, designed to be used with Processing.
http://code.compartmental.net/tools/minim
GNU Lesser General Public License v3.0
670 stars 137 forks source link

Windowing #99

Open Neginysh opened 4 years ago

Neginysh commented 4 years ago

It is mentioned in comments that the FFT algorithm use Hamming window, but I couldn't find the code for that. Does the algorithm use it? and if so, is it overlapping or side-by-side window?

ddf commented 4 years ago

All of the FFT related code is here: https://github.com/ddf/Minim/tree/master/src/main/java/ddf/minim/analysis

This includes classes for all of the window types that are included. If you wanted to use one that isn't included, you could implement it yourself by extending WndowFunction and passing an instance to the window method.

It looks like whatever comments you read are out of date and that by default the window function is set to a Rectangular window (ie no windowing) when making a new FFT.

When using an FFT, the window function is applied to every block of samples passed to the forward method. So whether or not your windows are overlapping or side-by-side depends entirely on how you write the code that uses an FFT.