Mercurial > octave
annotate scripts/signal/private/rectangle_sw.m @ 23220:092078913d54
maint: Merge stable to default.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 22 Feb 2017 12:58:07 -0500 |
parents | ef4d915df748 3ac9f9ecfae5 |
children | 194eb4bd202b |
rev | line source |
---|---|
23219
3ac9f9ecfae5
maint: Update copyright dates.
John W. Eaton <jwe@octave.org>
parents:
23083
diff
changeset
|
1 ## Copyright (C) 1995-2017 Friedrich Leisch |
3426 | 2 ## |
3922 | 3 ## This file is part of Octave. |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
8 ## (at your option) any later version. |
3426 | 9 ## |
3922 | 10 ## Octave is distributed in the hope that it will be useful, but |
3191 | 11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 ## GNU General Public License for more details. |
3426 | 14 ## |
3191 | 15 ## You should have received a copy of the GNU General Public License |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
3191 | 18 |
3449 | 19 ## -*- texinfo -*- |
20852
516bb87ea72e
2015 Code Sprint: remove class of function from docstring for all m-files.
Rik <rik@octave.org>
parents:
19697
diff
changeset
|
20 ## @deftypefn {} {} rectangle_sw (@var{n}, @var{b}) |
3449 | 21 ## Rectangular spectral window. Subfunction used for spectral density |
3191 | 22 ## estimation. |
3449 | 23 ## @end deftypefn |
3426 | 24 |
3457 | 25 ## Author: FL <Friedrich.Leisch@ci.tuwien.ac.at> |
26 ## Description: Rectangular spectral window | |
3191 | 27 |
28 function retval = rectangle_sw (n, b) | |
3426 | 29 |
3191 | 30 retval = zeros (n, 1); |
31 retval(1) = 2 / b + 1; | |
32 | |
33 l = (2:n)' - 1; | |
34 l = 2 * pi * l / n; | |
35 | |
3457 | 36 retval(2:n) = sin ((2/b + 1) * l / 2) ./ sin (l / 2); |
3426 | 37 |
3191 | 38 endfunction |