~ubuntu-branches/ubuntu/raring/octave-signal/raring-proposed

« back to all changes in this revision

Viewing changes to inst/bilinear.m

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot, Rafael Laboissiere, Sébastien Villemot
  • Date: 2012-09-23 09:14:33 UTC
  • mfrom: (1.2.1) (3.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20120923091433-cq0xatf7i45t3tcv
Tags: 1.2.0-1
[ Rafael Laboissiere ]
* Imported Upstream version 1.2.0.
  Test of function pei_tseng_notch is fixed. (Closes: #664694)
* debian/copyright: Reflect upstream changes
* debian/patches/autoload-yes.patch: Refresh for new upstream version
* Add Lintian overrides for false positives on hardening flags
* debian/rules: Fix the permission of some installed *.m files
* debian/control:
  - Drop build-dependency on octave-image
  - Build-Depends on octave-general

[ Sébastien Villemot ]
* Bump to Standards-Version 3.9.4, no changes needed

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
## Copyright (C) 1999 Paul Kienzle
2
 
##
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.
7
 
##
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.
12
 
##
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>
 
2
##
 
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
 
6
## version.
 
7
##
 
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
 
11
## details.
 
12
##
 
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/>.
15
15
 
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.
 
23
##
 
24
## Note: this differs from the bilinear function in the signal processing
 
25
## toolbox, which uses 1/T rather than T.
23
26
##
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.
69
72
 
70
 
## Author: Paul Kienzle <pkienzle@users.sf.net>
71
 
 
72
73
function [Zz, Zp, Zg] = bilinear(Sz, Sp, Sg, T)
73
74
 
74
75
  if nargin==3
75
76
    T = Sg;
76
77
    [Sz, Sp, Sg] = tf2zp(Sz, Sp);
77
78
  elseif nargin!=4
78
 
    usage("[Zz, Zp, Zg]=bilinear(Sz,Sp,Sg,T) or [Zb, Za]=blinear(Sb,Sa,T)");
79
 
  end;
 
79
    print_usage;
 
80
  end
80
81
 
81
82
  p = length(Sp);
82
83
  z = length(Sz);