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

« back to all changes in this revision

Viewing changes to inst/qp_kaiser.m

  • Committer: Package Import Robot
  • Author(s): Sébastien Villemot
  • Date: 2012-09-23 09:14:33 UTC
  • mfrom: (1.1.7)
  • mto: This revision was merged to the branch mainline in revision 5.
  • Revision ID: package-import@ubuntu.com-20120923091433-wzfir0y7ongjrubp
Tags: upstream-1.2.0
Import upstream version 1.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
## Copyright (C) 2002 André Carezia
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 (at
6
 
## your option) any later version.
7
 
##
8
 
## This program is distributed in the hope that it will be useful, but
9
 
## WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11
 
## 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) 2002 André Carezia <andre@carezia.eng.br>
 
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:  qp_kaiser (nb, at, linear)
17
17
##
28
28
## By using a third non-null argument, the minimum-phase calculation is
29
29
## ommited at all.
30
30
 
31
 
## $Id: qp_kaiser.m 4585 2008-02-04 13:47:45Z adb014 $
32
 
##
33
 
## Author: André Carezia <andre@carezia.eng.br>
34
 
## Description:  Coefficients for a PPN filter bank
35
 
 
36
 
function h = qp_kaiser (nb, at, linear)
 
31
function h = qp_kaiser (nb, at, linear = 0)
37
32
 
38
33
  if (nargin < 2)
39
 
    usage ("qp_kaiser (nb, at)");
40
 
  endif
41
 
 
42
 
  if (nargin < 3)
43
 
    linear = 0;
44
 
  endif
45
 
 
46
 
  if !(isscalar (nb) && (nb == round(nb)) && (nb >= 0))
 
34
    print_usage;
 
35
  elseif !(isscalar (nb) && (nb == round(nb)) && (nb >= 0))
47
36
    error ("qp_kaiser: nb has to be a positive integer");
48
 
  endif
49
 
 
50
 
  if !(isscalar (at) && (at == real (at)))
 
37
  elseif !(isscalar (at) && (at == real (at)))
51
38
    error ("qp_kaiser: at has to be a real constant");
52
39
  endif
53
40