jsfft

Small, efficient Javascript FFT implementation

  • 所有者: dntj/jsfft
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

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 (发布于 )
用户参与
星数285
关注者数17
派生数41
提交数54
已启用问题?
问题数16
打开的问题数2
拉请求数3
打开的拉请求数0
关闭的拉请求数1
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?