FUNCTION REFERENCE

freqz

Frequency response of a digital filter.

Frequency response of a digital filter.

Syntax

[h, w] = freqz(b, a, n)

Syntax

[h, f] = freqz(b, a, n, fs)

Syntax

[h, w] = freqz(b, a, n, 'whole')

Syntax

h = freqz(b, a, w)

Syntax

h = freqz(b, a, f, fs)

Syntax

[h, w] = freqz(sos, n)

Syntax

[h, w] = freqz(d, n)

Returns the complex response h and frequencies w at n points (default 512, at most 65536) from 0 up to pi rad/sample (2*pi with 'whole'); with a sample rate fs the frequencies are in Hz. A frequency vector w (rad/sample) or f (Hz) gives h in the same orientation; n-point outputs are columns. a defaults to 1. sos is an L-by-6 second-order-section matrix with L >= 2 (one row is a numerator b); d is a digitalFilter. Without outputs it plots the magnitude in dB in the current axes.

Example

[h, w] = freqz([1 1], 1, 4)   % h = [2; 1.7071-0.7071i; 1-1i; 0.2929-0.7071i]

Example

[h, f] = freqz([1 1], [1 -0.5], 8, 1000);   % f in Hz, 0 to 437.5

Differences from MATLAB: the bare call plots only the magnitude (dB), in the current axes, not magnitude and phase panels.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.