Mercurial > hg > octave-nkf
annotate scripts/signal/private/triangle_sw.m @ 17796:6b51f5f44aea
find symbols in proper scope when debugging (bug #40397)
* lex.h (lexical_feedback::symbol_table_context::init_scope):
Delete member variable and all uses.
(lexical_feedback::symbol_table_context::pop): Assert that the context
is not empty before popping.
(lexical_feedback::symbol_table_context::push): Use default argument.
(lexical_feedback::symbol_table_context::curr_scope): If empty, return
symbol_table::current_scope, not the initial scope in effect when the
object is created.
* oct-parse.in.yy (octave_base_parser::make_anon_fcn_handle,
octave_base_parser::recover_from_parsing_function):
Don't check for empty lexer.symtab_context here.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 29 Oct 2013 16:29:46 -0400 |
parents | d63878346099 |
children | 4197fc428c7d |
rev | line source |
---|---|
17744
d63878346099
maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents:
17338
diff
changeset
|
1 ## Copyright (C) 1995-2013 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 | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## 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 |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
3426 | 13 ## General Public License for more details. |
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 -*- |
20 ## @deftypefn {Function File} {} triangle_sw (@var{n}, @var{b}) | |
3191 | 21 ## Triangular spectral window. Subfunction used for spectral density |
22 ## estimation. | |
3449 | 23 ## @end deftypefn |
3426 | 24 |
3457 | 25 ## Author: FL <Friedrich.Leisch@ci.tuwien.ac.at> |
26 ## Description: Triangular spectral window | |
3191 | 27 |
28 function retval = triangle_sw (n, b) | |
3426 | 29 |
14868
5d3a684236b0
maint: Use Octave coding conventions for cuddling parentheses in scripts directory
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
30 retval = zeros (n,1); |
3191 | 31 retval(1) = 1 / b; |
32 | |
33 l = (2:n)' - 1; | |
34 l = 2 * pi * l / n; | |
3426 | 35 |
3457 | 36 retval(2:n) = b * (sin (l / (2*b)) ./ sin (l / 2)).^2; |
3191 | 37 |
38 endfunction | |
39 |