
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
fourier-transform
Advanced tools
Minimalistic and efficient FFT implementation for 2n-size inputs. Includes regular and asm.js versions.
var ft = require('fourier-transform');
var db = require('decibels');
var frequency = 440;
var size = 1024;
var sampleRate = 44100;
var waveform = new Float32Array(size);
for (var i = 0; i < size; i++) {
waveform[i] = Math.sin(frequency * Math.PI * 2 * (i / sampleRate));
}
//get normalized magnitudes for frequencies from 0 to 22050 with interval 44100/1024 ≈ 43Hz
var spectrum = ft(waveform);
//convert to decibels
var decibels = spectrum.map((value) => db.fromGain(value))
To use asm.js version, require as require('fourier-transform/asm')
. That is ~35% faster.
To all the existing fft packages, without them this one would not be possible. Special thanks to @corbanbrook for the most efficient implementation in dsp.js. This package is based on dsp.js RFFT, which is based on RealFFT.
If you find it slow, difficult or broken, please post an issue. If you have ideas or know-hows for better implementation - PR’s are welcome.
FAQs
Minimalistic and efficient FFT implementation
The npm package fourier-transform receives a total of 3,015 weekly downloads. As such, fourier-transform popularity was classified as popular.
We found that fourier-transform demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.