You are on page 1of 4

Bilinear transformation method for analog-to-digital filter conversion

Syntax
[zd,pd,kd] = bilinear(z,p,k,fs) [zd,pd,kd] = bilinear(z,p,k,fs,fp) [numd,dend] = bilinear(num,den,fs) [numd,dend] = bilinear(num,den,fs,fp) [Ad,Bd,Cd,Dd] = bilinear(A,B,C,D,fs) [Ad,Bd,Cd,Dd] = bilinear(A,B,C,D,fs,fp)

Description
The bilinear transformation is a mathematical mapping of variables. In digital filtering, it is a standard method of mapping the s or analog plane into the z or digital plane. It transforms analog filters, designed using classical filter design techniques, into their discrete equivalents. The bilinear transformation maps the s-plane into the z-plane by

This transformation maps the j axis (from = - to +) repeatedly around the unit circle ( =- to ) by

, from

can accept an optional parameter Fp that specifies prewarping. fp, in hertz, indicates a "match" frequency, that is, a frequency for which the frequency responses before and after mapping match exactly. In prewarped mode, the bilinear transformation maps the s-plane into the z-plane with
bilinear

With the prewarping option, bilinear maps the j axis (from = - to +) repeatedly around the unit circle ( , from =- to ) by

In prewarped mode, bilinear matches the frequency 2fp (in radians per second) in the s-plane to the normalized frequency 2fp/fs (in radians per second) in the z-plane. The bilinear function works with three different linear system representations: zero-pole-gain, transfer function, and state-space form.

Zero-Pole-Gain
[zd,pd,kd] = bilinear(z,p,k,fs)

and

[zd,pd,kd] = bilinear(z,p,k,fs,fp) convert the s-domain transfer function specified by z, p, and k to a discrete equivalent. Inputs z and p are column vectors containing the zeros and poles, k is a scalar gain, and fs is the sampling frequency in hertz. bilinear returns the discrete equivalent in column vectors zd and pd and scalar kd. The optional match frequency, fp is in hertz and is used for prewarping.

Transfer Function
[numd,dend] = bilinear(num,den,fs)

and

[numd,dend] = bilinear(num,den,fs,fp) convert an s-domain transfer function given by num and den to a discrete equivalent. Row vectors num and den specify the coefficients of the numerator and denominator,

respectively, in descending powers of s.

fs is the sampling frequency in hertz. bilinear returns the discrete equivalent in row vectors numd and dend in descending powers of z (ascending powers of z-1). fp is the optional match frequency, in hertz, for

prewarping.

lp2bp
Transform lowpass analog filters to bandpass

Syntax
[bt,at] = lp2bp(b,a,Wo,Bw) [At,Bt,Ct,Dt] = lp2bp(A,B,C,D,Wo,Bw)

Description
transforms analog lowpass filter prototypes with a cutoff angular frequency of 1 rad/s into bandpass filters with desired bandwidth and center frequency. The transformation is one step in the digital filter design process for the butter, cheby1, cheby2, and ellip functions.
lp2bp

can perform the transformation on two different linear system representations: transfer function form and state-space form. In both cases, the input system must be an analog filter prototype.
lp2bp

Transfer Function Form (Polynomial)


transforms an analog lowpass filter prototype given by polynomial coefficients into a bandpass filter with center frequency Wo and bandwidth Bw. Row vectors b and a specify the coefficients of the numerator and denominator of the prototype in descending powers of s.
[bt,at] = lp2bp(b,a,Wo,Bw)

Scalars Wo and Bw specify the center frequency and bandwidth in units of rad/s. For a filter with lower band edge w1 and upper band edge w2, use Wo = sqrt(w1*w2) and Bw = w2-w1.
lp2bp

returns the frequency transformed filter in row vectors bt and at.

freqz
Frequency response of filter

Syntax
[h,w] = freqz(ha) [h,w] = freqz(ha,n) freqz(ha) [h,w] = freqz(hd) [h,w] = freqz(hd,n) freqz(hd) [h,w] = freqz(hm) [h,w] = freqz(hd,n) freqz(hd)

Description
The next sections describe common freqz operation with adaptive, discrete-time, and multirate filters. For more input options, refer to freqz in Signal Processing Toolbox documentation.

Adaptive Filters
For adaptive filters, freqz returns the instantaneous frequency response based on the current filter coefficients.
[h,w] = freqz(ha) returns the frequency response vector h and the corresponding frequency the adaptive filter ha. When ha is a vector of adaptive filters, freqz returns the matrix h. Each h corresponds to one filter in the vector ha.

vector w for column of

[h,w] = freqz(ha,n) returns the frequency response vector h and the corresponding frequency vector w for the adaptive filter ha. freqz uses the transfer function associated with the adaptive filter to calculate the frequency response of the filter with the current coefficient values. The vectors h and w are both of length n.

The frequency vector w has values ranging from 0 to radians per sample. If you do not specify the integer n, or you specify it as the empty vector [], the frequency response is calculated using the default value of 8192 samples for the FFT. uses FVTool to plot the magnitude and unwrapped phase of the frequency response of the adaptive filter ha. If ha is a vector of filters, freqz plots the magnitude response and phase for each filter in the vector.
freqz(ha)

Discrete-Time Filters
returns the frequency response vector h and the corresponding frequency vector w for the discrete-time filter hd. When hd is a vector of discrete-time filters, freqz returns the matrix h. Each column of h corresponds to one filter in the vector hd.
[h,w] = freqz(hd)

returns the frequency response vector h and the corresponding frequency vector w for the discrete-time filter hd. freqz uses the transfer function associated with the discrete-time filter to calculate the frequency response of the filter with the current coefficient values. The vectors h and w are both of length n. The frequency vector w has values ranging from 0 to radians per sample. If you do not specify the integer n, or you specify it as the empty vector [], the frequency response is calculated using the default value of 8192 samples for the FFT.
[h,w] = freqz(hd,n)

uses FVTool to plot the magnitude and unwrapped phase of the frequency response of the adaptive filter hd. If hd is a vector of filters, freqz plots the magnitude response and phase for each filter in the vector.
freqz(hd)

Examples
Plot the estimated frequency response of a filter. This example uses discrete-time filters, but any adaptfilt, dfilt, or mfilt object would work. 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);

You might also like