Documentation Center 
Frequency response of filter
[h,w]
= freqz(hfilt)
[h,w]
= freqz(hfilt,n)
freqz(hfilt)
[h,w]
= freqz(hs)
[h,w]
= freqz(hs,n)
[h,w] =
freqz(hs,Name,Value)
freqz(hs)
freqz returns the frequency response based on the current filter coefficients. This section describes common freqz operation with adaptive filters, discretetime filters, multirate filters, and filter System objects. For more input options, refer to freqz in Signal Processing Toolbox™ documentation.
[h,w] = freqz(hfilt) returns the frequency response h and the corresponding frequencies w at which the filter response of hfilt is computed. The frequency response is evaluated at 8192 points equally spaced around the upper half of the unit circle.
[h,w] = freqz(hfilt,n) returns the frequency response h and corresponding frequencies w for the filter or vector of filters hfilt. The frequency response is evaluated at n points equally spaced around the upper half of the unit circle. freqz uses the transfer function associated with the filter to calculate the frequency response of the filter with the current coefficient values.
freqz(hfilt) uses FVTool to plot the magnitude and unwrapped phase of the frequency response of the filter hfilt. If hfilt is a vector of filters, freqz plots the magnitude response and phase for each filter in the vector.
[h,w] = freqz(hs) returns a frequency response for the filter System object™ hs using 8192 samples.
[h,w] = freqz(hs,n) returns a frequency response for the filter System object hs using n samples.
[h,w] = freqz(hs,Name,Value) returns a frequency response with additional options specified by one or more Name,Value pair arguments.
freqz(hs) uses FVTool to plot the magnitude and unwrapped phase of the frequency response of the filter System object hs.
hfilt 
hfilt is either:

hs 
Filter System object. The following Filter System objects are supported by this analysis function: 
n 
Number of samples. For an FIR filter where n is a power of two, the computation is done faster using FFTs. Default: 8192 
Specify optional commaseparated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
'Arithmetic' 
For filter System object inputs only, specify the arithmetic used during analysis. When you specify 'double' or 'single', the function performs double or singleprecision analysis. When you specify 'fixed' , the arithmetic changes depending on the setting of the CoefficientDataType property and whether the System object is locked or unlocked. Details for FixedPoint Arithmetic When you do not specify the arithmetic for nonCIC structures, the function uses doubleprecision arithmetic if the filter System object is in an unlocked state. If the System object is locked, the function performs analysis based on the locked input data type. CIC structures only support fixedpoint arithmetic. 
h 
Complex, nelement frequency response vector. If hfilt is a vector of filters, h is a complex, length(hfilt)byn matrix of frequency response vectors corresponding to each filter in hfilt. If n is not specified, the function uses a default value of 8192. For adaptive filters, h is the instantaneous frequency response. 
w 
Frequency vector of length n, in radians/sample. w consists of n points equally spaced around the upper half of the unit circle (from 0 to π radians/sample). If n is not specified, the function uses a default value of 8192. 
Plot the estimated frequency response of a filter. This example uses discretetime filters, but hd can be any adaptfilt object, dfilt object, mfilt object, or filter System object. First plot the results for one filter.
b = fir1(80,0.5,kaiser(81,8)); hd = dfilt.dffir(b); freqz(hd);
If you have more than one filter, you can plot them on the same figure using a vector of filters.
b = fir1(40,0.5,kaiser(41,6)); hd2 = dfilt.dffir(b); h = [hd hd2]; freqz(h);