jsfft

Small, efficient Javascript FFT implementation

Github星跟蹤圖

jsfft

Small, efficient Javascript FFT implementation for node or the browser.

Usage

JSFFT ships with ComplexArray which can be operated on:

const fft = require('jsfft');

// Use the in-place mapper to populate the data.
const data = new fft.ComplexArray(512).map((value, i, n) => {
  value.real = (i > n/3 && i < 2*n/3) ? 1 : 0;
});

Including the fft module attaches FFT methods to ComplexArray. FFT and
InvFFT perform in-place transforms on the underlying data:

const frequencies = data.FFT();
// Implement a low-pass filter using the in-place mapper.
frequencies.map((frequency, i, n) => {
  if (i > n/5 && i < 4*n/5) {
    frequency.real = 0;
    frequency.imag = 0;
  }
});

Alternatively, frequency-space filters can be implemented via the frequencyMap:

const filtered = data.frequencyMap((frequency, i, n) => {
  if (i > n/5 && i < 4*n/5) {
    frequency.real = 0;
    frequency.imag = 0;
  }
});

Conventions

JSFFT uses the normalization convention that is symmetric between the forward and
reverse transform. With N data points, the transform is normalized by a factor of √N:

           1   N-1       2πik/N
fft(k) =   -    ∑  f(j) ?
          √N   j=0

Other Implementations

DSP is a full featured Digital Signal
Processing library in JS which includes a JS FFT implementation.

主要指標

概覽
名稱與所有者dntj/jsfft
主編程語言JavaScript
編程語言CSS (語言數: 3)
平台
許可證MIT License
所有者活动
創建於2012-09-30 18:30:59
推送於2020-11-03 11:21:11
最后一次提交2019-01-25 10:34:15
發布數2
最新版本名稱v0.0.4 (發布於 )
第一版名稱v0.0.3 (發布於 )
用户参与
星數286
關注者數16
派生數41
提交數54
已啟用問題?
問題數16
打開的問題數2
拉請求數3
打開的拉請求數0
關閉的拉請求數1
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?