# ndarray-freqz

1.0.0 • Public • Published

# ndarray-freqz

Compute the frequency response of a digital filter based on it's transfer function.

## Introduction

This scijs compatible module calculates the frequency response of a given transfer function, described by the coefficient of the numerator and denominator polynomials.

``````|           jw              -jw            -jmw
|    jw  B(e)    b[0] + b[1]e + .... + b[m]e
| H(e) = ---- = ------------------------------------
|          jw               -jw            -jnw
|        A(e)    a[0] + a[1]e + .... + a[n]e
``````

Inspired by the scipy.signal.freqz function.

Sample usage:

## API

### `freqz( b, a, [omega] )`

Compute the frequency response of a digital filter based on it's transfer function.

• `b` Array/ndarray of the numerator polynomial coefficients of the filter transfer function.
• `a` Array/ndarray of the denominator polynomial coefficients of the filter transfer function.
• `omega` Optional Array/ndarray of frequency (in radians/sample) values to calculate the frequency response for. If the value is a Number, then frequency response will be calculated for that many frequencies equally spaced around the unit circle. If undefined then frequency response will be calculated at 512 frequencies equally spaced around the unit circle.

Returns a object with following components

• `H_r` ndarray of the real part of the generated frequency response.
• `H_i` ndarray of the imaginary part of the generated frequency response.
• `omega` ndarray of the frequencies of the generated frequency response.

## Credits

(c) 2016 Chinmay Pendharkar. MIT License

## Package Sidebar

### Install

`npm i ndarray-freqz`

### Repository

github.com/notthetup/ndarray-freqz

10

1.0.0