Mercurial > octave
annotate scripts/signal/private/triangle_sw.m @ 31706:597f3ee61a48 stable
update Octave Project Developers copyright for the new year
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 06 Jan 2023 13:11:27 -0500 |
parents | 505ed551e366 |
children | 2e484f9f1f18 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 ######################################################################## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 ## |
31706
597f3ee61a48
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31664
diff
changeset
|
3 ## Copyright (C) 1995-2023 The Octave Project Developers |
27918
b442ec6dda5c
use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents:
26376
diff
changeset
|
4 ## |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 ## See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 ## distribution or <https://octave.org/copyright/>. |
3426 | 7 ## |
3922 | 8 ## This file is part of Octave. |
9 ## | |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
10 ## Octave is free software: you can redistribute it and/or modify it |
3922 | 11 ## under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
12 ## the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
13 ## (at your option) any later version. |
3426 | 14 ## |
3922 | 15 ## Octave is distributed in the hope that it will be useful, but |
3191 | 16 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
18 ## GNU General Public License for more details. |
3426 | 19 ## |
3191 | 20 ## You should have received a copy of the GNU General Public License |
7016 | 21 ## along with Octave; see the file COPYING. If not, see |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
22 ## <https://www.gnu.org/licenses/>. |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 ## |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 ######################################################################## |
3191 | 25 |
3449 | 26 ## -*- texinfo -*- |
31664
505ed551e366
doc: Ensure DOCSTRING has an output when function returns a value (bug #61681)
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
27 ## @deftypefn {} {@var{retval} =} triangle_sw (@var{n}, @var{b}) |
505ed551e366
doc: Ensure DOCSTRING has an output when function returns a value (bug #61681)
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
28 ## Triangular spectral window. |
505ed551e366
doc: Ensure DOCSTRING has an output when function returns a value (bug #61681)
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
29 ## |
505ed551e366
doc: Ensure DOCSTRING has an output when function returns a value (bug #61681)
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
30 ## Subfunction used for spectral density estimation. |
505ed551e366
doc: Ensure DOCSTRING has an output when function returns a value (bug #61681)
Rik <rik@octave.org>
parents:
30564
diff
changeset
|
31 ## @seealso{spectral_xdf} |
3449 | 32 ## @end deftypefn |
3426 | 33 |
3191 | 34 function retval = triangle_sw (n, b) |
3426 | 35 |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
36 retval = zeros (n,1); |
3191 | 37 retval(1) = 1 / b; |
38 | |
39 l = (2:n)' - 1; | |
40 l = 2 * pi * l / n; | |
3426 | 41 |
3457 | 42 retval(2:n) = b * (sin (l / (2*b)) ./ sin (l / 2)).^2; |
3191 | 43 |
44 endfunction |