freqr
Compute the frequency response of a digital filter.
Installation
npm install freqr
Quick Example
const freqr = ; // type: "lowpass", freq: 2400hz, Q: 8const b = 0027136 0054272 0027136 ;const a = 1000000 -1766316 0874860 ; for let f = 0; f < 02; f += 00025 const res = ; console;
API
freqr(b, a, f)
b: number[]
- coefficients of feedforwarda: number[]
- coefficients of feedbackf: number
- normalized frequency [0..1]f = frequency / sampleRate
- returns
mag: number
phase: number
db: number
db = 20 * Math.log(mag) / Math.LN10
License
MIT