
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
apodization
Advanced tools
window function applier and some shapes.
$ npm i window-functions
It is possible to import the functions directly. Those function accepts an object with options and returns a function (i: number) => number to avoid constants calculation for each call.
import { lorentzToGauss } from 'apodization';
const gm = lorentzToGauss({ gaussianHz: 0.2, exponentialHz: 0, center: 0.5, length: 500, dw = 0.01 });
const value = gm(250); //returns the max value of the gaussian;
Current supported shapes:
It is possible to apply a window function directly to data (number[]). It does not change the original data by default but it is possible to pass an array in output
property.
import { applyWindow, exponential } from 'apodization';
const data = [1,2,3,4,5];
const exponentialFunc = exponential({ dw: 0.1, lb: 0.2, start: 0 })
const result = applyWindow(data, {
func: exponential,
start: 0,
output: data //inplace modification
});
It is possible to call a window function by:
import { getFunction } from 'apodization';
const shapeOptions = {
dw = 0.01,
center: 0.5,
length: 500,
gaussianHz: 0.2,
exponentialHz: 0,
};
const func = getFunction({
kind: 'lorentzToGauss',
...shapeOptions,
});
console.log(func(250)); //value of window function of index 250
2.0.0 (2022-07-19)
FAQs
window function applier and some shapes
We found that apodization demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.