# FREQZ

## Purpose:

Evaluates the frequency response of a Z-transform.

## Syntax:

FREQZ(b, a, N, "whole", Fs)

(h, w) = FREQZ(b, a, N, "whole", Fs)

 b - A series. The numerator (i.e. zero) coefficients in ascending powers of z-1. a - A series. The denominator (i.e. pole) coefficients in ascending powers of z-1. If the first coefficient is not 1.0, the coefficients are assumed to be in difference equation form. N - Optional. An integer, the number of output samples, defaults to 512. "whole" - Optional. A string. If specified, the transform is evaluated over the entire unit circle. If omitted, the transform is evaluated over the upper half of the unit circle. Fs - Optional. A real, the sample rate of data. If not specified, the transform is evaluated in normalized frequency values of π radians/s.

## Alternate Syntax:

FREQZ(b, a, w, "whole", Fs)

(h, w) = FREQZ(b, a, w, "whole", Fs)

 b - A series. The numerator (i.e. zero) coefficients in ascending powers of z-1. a - A series. The denominator (i.e. pole) coefficients in ascending powers of z-1. If the first coefficient is not 1.0, the coefficients are assumed to be in difference equation form. w - A series. The frequencies to evaluate the system. "whole" - Optional. A string. If specified, the transform is evaluated over the entire unit circle. If omitted, the transform is evaluated over the upper half of the unit circle. Fs - Optional. A real, the sample rate of data. If not specified, the transform is evaluated in normalized frequency values of π radians/s.

## Returns:

Displays the magnitude and phase response in two Windows.

h = FREQZ(b, a) returns the complex frequency response as one XY series.

(h, w) = FREQZ(b, a) returns the complex frequency response as two separate series.

## Example:

h = freqz({1}, {1, -0.5, 0.8})

h contains 512 uniformly spaced samples of the frequency response of the discrete system:

The angular frequency values range from 0 to π radians/s.

## Example:

freqz({1}, {1, -0.5, 0.8})

Same as the first example except the magnitude and frequency responses are displayed in two separate Windows.

The displayed normalized frequency values range from 0 to 1 in units of π radians/s.

## Example:

freqz({1}, {1, -0.5, 0.8}, 1024, 500)

Same as the previous example except 1024 samples are computed and the frequency values range from 0 to 250 Hertz. The magnitude and phase responses are automatically displayed in two separate Windows.

## Remarks:

If no explicit frequency values are specified, FREQZ uses the FFT method to evaluate the specified number of uniformly spaced samples over the unit circle of a Z-transform in direct form:

 z = e jω complex frequency N = number of numerator terms M = number of denominator terms

If no sample rate is specified, angular frequencies are used in units of radians/s.

If a sample rate is specified, the frequencies are determined in Hertz.

If explicit frequencies are specified, the result is an XY series.

If no output arguments are provided, the magnitude response in dB and phase response in degrees are displayed in two separate windows. If no sample rate is specified, the displayed frequencies are in normalized angular units of π radians/s.

h = FREQZ(b, a) returns a complex series Use MAGNITUDE or PHASE to obtain the magnitude or phase separately.

See ZFREQ to specify the input coefficients in combined direct from or cascaded bi-quad from.

Note that FREQZ always assumes the coefficients are in Z-transform form, however ZFREQ assumes the coefficients are in difference equation form if a[1] ≠ 1.