{"_id":"@alexanderlee/stft","name":"@alexanderlee/stft","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@alexanderlee/stft","version":"1.0.0","description":"Short time Fourier transform","main":"stft.js","directories":{"test":"test"},"dependencies":{"ndarray":"~1.0.19","ndarray-fft":"~1.0.3"},"devDependencies":{"tape":"~1.0.4"},"scripts":{"test":"tap test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/stft.git"},"keywords":["short","time","fourier","transform","fft","stft","audio","dsp","signal","processing"],"author":{"name":"Mikola Lysenko"},"license":"MIT","gitHead":"5f024f4ae91c64a9f00f3e91782c0b0151e16fc1","bugs":{"url":"https://github.com/mikolalysenko/stft/issues"},"homepage":"https://github.com/mikolalysenko/stft#readme","_id":"@alexanderlee/stft@1.0.0","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-+PF/IqnB0LKal6nAWirpG7mPcfTBZgNk7vMsF4orjyyAPLMpLj9W/RwOhkL/rcAe39z8eQBxAGkI80EitZKadQ==","shasum":"b9bf4c11b77820669eb4bfa1cd29dabfb6a6efb9","tarball":"https://registry.npmjs.org/@alexanderlee/stft/-/stft-1.0.0.tgz","fileCount":5,"unpackedSize":6900,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD67dvbhiOAtTRGsIdO7dPz85U+BMUlzpl85JiIaMgp1AIgFk/p7J10f3BVXRjm7v7B95zbkVnpw+Vi2xI5/gCFKNE="}]},"_npmUser":{"name":"alexanderlee","email":"thealexanderlee@me.com"},"maintainers":[{"name":"alexanderlee","email":"thealexanderlee@me.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/stft_1.0.0_1698986729801_0.8311991116049648"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-03T04:45:29.650Z","1.0.0":"2023-11-03T04:45:30.045Z","modified":"2023-11-03T04:45:30.374Z"},"maintainers":[{"name":"alexanderlee","email":"thealexanderlee@me.com"}],"description":"Short time Fourier transform","homepage":"https://github.com/mikolalysenko/stft#readme","keywords":["short","time","fourier","transform","fft","stft","audio","dsp","signal","processing"],"repository":{"type":"git","url":"git://github.com/mikolalysenko/stft.git"},"author":{"name":"Mikola Lysenko"},"bugs":{"url":"https://github.com/mikolalysenko/stft/issues"},"license":"MIT","readme":"stft\n====\nA streaming-ish [short time Fourier transform](http://en.wikipedia.org/wiki/Short-time_Fourier_transform).\n\n## Example\n```javascript\nvar shortTimeFT = require(\"stft\")\n\n\nfunction onFreq(re, im) {\n  //Frequency stuff.  Process it here\n  istft(re, im)\n}\n\nfunction onTime(v) {\n  //Got data, emit it here\n  console.log(\"out frame:\", v)\n}\n\nvar stft = shortTimeFT(1, 1024, onFreq)\nvar istft = shortTimeFT(-1, 1024, onTime)\n\n//Feed stuff into signal\nstft(new Float32Array([1, 0, 0, 0, ... ])\n```\n\n## Install\n\n    npm install stft\n\n### `require(\"stft\")(direction, frame_size, ondata[, options])`\nCreates a function for processing a signal with a short time Fourier transform.\n\n* `direction` is a flag that determines whether the stft is forward or inverse\n* `frame_size` is the size of a frame for the stft\n* `ondata` is a callback that gets fired whenever data is ready to be processed\n* `options` is an optional object that takes the following parameters\n\n    + `options.hop_size` the amount of samples between stft hops\n    + `options.window_func` a windowing function, which takes a parameter from `[0,1]` and returns a weight\n\n**Returns** A function that can be called with a frame (either real or complex) that adds a chunk of data to the stft queue\n\n### `require(\"stft\").stft(frame_size, ondata[, options])`\nShort cut for `require(\"stft\")(1, frame_size, ondata, options)`\n\n### `require(\"stft\").istft(frame_size, ondata[, options])`\nShort cut for `require(\"stft\")(-1, frame_size, ondata, options)`\n\n## Credits\n(c) 2013 Mikola Lysenko. MIT License\n","readmeFilename":"README.md"}