[Scilab-users] Trying to work a tukeywin function
Samuel Gougeon
sgougeon at free.fr
Thu Sep 20 00:31:11 CEST 2012
Hello,
Le 20/09/2012 00:05, Lester Anderson a écrit :
>
> function w=tukeywin(L,r= 1/2)
>
> if (nargin < 1 || nargin > 2) ------ Not sure how to replace this bit (variable not defined)
>
nargin => argn(2)
> .../...
>
> // generate window
> switch r --------- think this should be select ?
>
Right
> .../...
> case 1,
> // Hanning window
> w = hanning (L);
>
window('hn',L)
> otherwise ------------- else
>
Yes
> // cosine-tapered window
> t = linspace(0,1,L)(1:end/2)';
>
replace end with $ : (1:$/2)';
> w = (1 + cos(pi*(2*t/r-1)))/2;
>
pi => %pi
> w(floor(r*(L-1)/2)+2:end) = 1;
> w = [w; ones(mod(L,2)); flipud(w)];
>
mod => modulo
flipud(w) => flipdim(w,1)
> endswitch ------------------------------------ end ?
>
Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20120920/272366e9/attachment.htm>
More information about the users
mailing list