Skip to content

Commit

Permalink
triangle_sw.m: Rename output to 'c' to match other window functions.
Browse files Browse the repository at this point in the history
* triangle_sw.m: Rename output "retval" to "c" to match other window functions.
  • Loading branch information
Rik committed Feb 2, 2024
1 parent 5309d0d commit 5c4a012
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/signal/private/triangle_sw.m
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,21 @@
########################################################################

## -*- texinfo -*-
## @deftypefn {} {@var{retval} =} triangle_sw (@var{n}, @var{b})
## @deftypefn {} {@var{c} =} triangle_sw (@var{n}, @var{b})
## Triangular spectral window.
##
## Subfunction used for spectral density estimation.
## @seealso{spectral_xdf}
## @end deftypefn

function retval = triangle_sw (n, b)
function c = triangle_sw (n, b)

retval = zeros (n,1);
retval(1) = 1 / b;
c = zeros (n,1);
c(1) = 1 / b;

l = (2:n)' - 1;
l = 2 * pi * l / n;

retval(2:n) = b * (sin (l / (2*b)) ./ sin (l / 2)).^2;
c(2:n) = b * (sin (l / (2*b)) ./ sin (l / 2)).^2;

endfunction

0 comments on commit 5c4a012

Please sign in to comment.