freqz
Compute digital filter frequency response values.
Syntax
h = freqz(b,a,f,fs)
[h,f] = freqz(...)
Inputs
- b
- The numerator polynomial coefficients of the filter.
- a
- The denominator polynomial coefficients of the filter.
- f
- The frequencies (in Hz) at which the response is computed.
- fs
- The sampling frequency (in Hz).
Outputs
- h
- The frequency response values.
- f
- The frequencies (in Hz) at which the response is computed.
Example
Verify the cutoff frequency of a fourth order Butterworth low pass digital filter with a 300 Hz cutoff frequency and a 1000 Hz sampling frequency.
b = [0.16718, 0.66872, 1.0031, 0.66872, 0.16718];
a = [1, 0.7821, 0.67998, 0.18268, 0.030119];
h = freqz(b,a,300,1000);
abs(h)
ans = 0.70715
Comments
A warning is issued if values of f exceed the Nyquist frequency.