1
## Copyright (C) 1999 Paul Kienzle
3
## This program is free software; you can redistribute it and/or modify
4
## it under the terms of the GNU General Public License as published by
5
## the Free Software Foundation; either version 2 of the License, or
6
## (at your option) any later version.
8
## This program is distributed in the hope that it will be useful,
9
## but WITHOUT ANY WARRANTY; without even the implied warranty of
10
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
## GNU General Public License for more details.
13
## You should have received a copy of the GNU General Public License
14
## along with this program; If not, see <http://www.gnu.org/licenses/>.
1
## Copyright (C) 1999 Paul Kienzle <pkienzle@users.sf.net>
3
## This program is free software; you can redistribute it and/or modify it under
4
## the terms of the GNU General Public License as published by the Free Software
5
## Foundation; either version 3 of the License, or (at your option) any later
8
## This program is distributed in the hope that it will be useful, but WITHOUT
9
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
13
## You should have received a copy of the GNU General Public License along with
14
## this program; if not, see <http://www.gnu.org/licenses/>.
16
16
## usage: [Zz, Zp, Zg] = bilinear(Sz, Sp, Sg, T)
17
17
## [Zb, Za] = bilinear(Sb, Sa, T)
19
19
## Transform a s-plane filter specification into a z-plane
20
20
## specification. Filters can be specified in either zero-pole-gain or
21
21
## transfer function form. The input form does not have to match the
22
## output form. T is the sampling frequency represented in the z plane.
22
## output form. 1/T is the sampling frequency represented in the z plane.
24
## Note: this differs from the bilinear function in the signal processing
25
## toolbox, which uses 1/T rather than T.
24
27
## Theory: Given a piecewise flat filter design, you can transform it
25
28
## from the s-plane to the z-plane while maintaining the band edges by
67
70
## Proakis & Manolakis (1992). Digital Signal Processing. New York:
68
71
## Macmillan Publishing Company.
70
## Author: Paul Kienzle <pkienzle@users.sf.net>
72
73
function [Zz, Zp, Zg] = bilinear(Sz, Sp, Sg, T)
76
77
[Sz, Sp, Sg] = tf2zp(Sz, Sp);
78
usage("[Zz, Zp, Zg]=bilinear(Sz,Sp,Sg,T) or [Zb, Za]=blinear(Sb,Sa,T)");