Mercurial > octave
comparison scripts/signal/stft.m @ 31551:fd29c7a50a78 stable
maint: use commas, semicolons consistently with Octave conventions.
* makeValidName.m: Remove %!test and move BIST %!asserts to column 1.
* base64decode.m, base64encode.m, which.m, logm.m, uniquetol.m, perms.m:
Delete semicolon (';') at end of %!assert BIST.
* lin2mu.m, interp2.m, interpn.m, lsqnonneg.m, pqpnonneg.m, uniquetol.m,
betainc.m, normalize.m: Add semicolon (';') to end of assert statement within
%!test BIST.
* __memoize__.m, tar_is_bsd.m, publish.m: Add semicolon (';') to line with
keyword "persistent".
* stft.m: Use comma (',') after "case" keyword when code immediately follows.
* gallery.m: Align commas used in case statements in massive switch block.
Remove unnecessary parentheses around a numeric case argument.
* ranks.m: Remove semicolon (';') from case statemnt argument.
author | Rik <rik@octave.org> |
---|---|
date | Sat, 26 Nov 2022 06:32:08 -0800 |
parents | 796f54d4ddbf |
children | 597f3ee61a48 |
comparison
equal
deleted
inserted
replaced
31549:ed7b17c7ddf3 | 31551:fd29c7a50a78 |
---|---|
70 print_usage (); | 70 print_usage (); |
71 endif | 71 endif |
72 | 72 |
73 if (ischar (win_type)) | 73 if (ischar (win_type)) |
74 switch (tolower (win_type)) | 74 switch (tolower (win_type)) |
75 case "hanning" win_type = 1; | 75 case "hanning" , win_type = 1; |
76 case "hamming" win_type = 2; | 76 case "hamming" , win_type = 2; |
77 case "rectangle" win_type = 3; | 77 case "rectangle" , win_type = 3; |
78 otherwise | 78 otherwise |
79 error ("stft: unknown window type '%s'", win_type); | 79 error ("stft: unknown window type '%s'", win_type); |
80 endswitch | 80 endswitch |
81 endif | 81 endif |
82 | 82 |
93 endif | 93 endif |
94 num_win = fix ((rows (x) - win_size) / inc); | 94 num_win = fix ((rows (x) - win_size) / inc); |
95 | 95 |
96 ## compute the window coefficients | 96 ## compute the window coefficients |
97 switch (win_type) | 97 switch (win_type) |
98 case 1 win_coef = hanning (win_size); | 98 case 1 , win_coef = hanning (win_size); |
99 case 2 win_coef = hamming (win_size); | 99 case 2 , win_coef = hamming (win_size); |
100 case 3 win_coef = ones (win_size, 1); | 100 case 3 , win_coef = ones (win_size, 1); |
101 endswitch | 101 endswitch |
102 | 102 |
103 ## Create a matrix Z whose columns contain the windowed time-slices. | 103 ## Create a matrix Z whose columns contain the windowed time-slices. |
104 z = zeros (ncoef, num_win + 1); | 104 z = zeros (ncoef, num_win + 1); |
105 start = 1; | 105 start = 1; |