Package Exports
- fft-windowing
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fft-windowing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
nodejs-fft-windowing is a node.js module that applies a windowing function to an array of data, making it ready to be FFT'd.
This article by National Instruments gives a good introduction to why windowing functions are useful.
Installation
If you have npm installed, just run:
npm install fft-windowingUsage
The Hann (Hanning) window is a good general-purpose window. You would use it like so:
var windowing = require('fft-windowing');
var raw = [2, 2, 0, -2, -2, 0, 2, 2];
var windowed = windowing.hann(raw);
The resulting windowed variable is then ready to be fed through a Fast Fourier Transform. A good node.js module to use would be this one.
The following windows are available:
- hann
- hamming
- cosine
- lanczos
- gaussian
- tukey
- blackman
- exact_blackman
- kaiser
- nuttall
- blackman_harris
- blackman_nuttall
- flat_top
The following windows can also accept an extra parameter, alpha:
You would use it like this:
var windowing = require('fft-windowing');
var raw = [2, 2, 0, -2, -2, 0, 2, 2];
var windowed = windowing.kaiser(raw, 0.5);
Tests
Run node tests/fft-windowing-tests.js. This should generate a file called fft-windowing.pdf in the root directory which shows what happens if you apply each windowing function to a uniform array.
LICENSE
MIT