<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hello,<br>
<br>
Le 20/09/2012 00:05, Lester Anderson a écrit :
<blockquote
 cite="mid:CAE3taFDh85yb6UrdGBh2NbemCXW1ir7ae3czr99cXo6dCaNMwA@mail.gmail.com"
 type="cite"><br>
  <pre
 style="font-family: Monospaced; font-style: normal; font-size: 14px;"><span
 style="color: rgb(176, 24, 19);">function</span> <span
 style="color: rgb(131, 67, 16); font-weight: bold;">w</span><span
 style="color: rgb(92, 92, 92);">=</span><span
 style="color: rgb(0, 0, 0); text-decoration: underline;">tukeywin</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">L</span><span
 style="color: rgb(0, 0, 0);">, </span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">r</span><span
 style="color: rgb(92, 92, 92);">=</span> <span
 style="color: rgb(188, 143, 143);">1</span><span
 style="color: rgb(92, 92, 92);">/</span><span
 style="color: rgb(188, 143, 143);">2</span><span
 style="color: rgb(74, 85, 219);">)</span>

  <span style="color: rgb(160, 32, 240);">if</span> <span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(0, 0, 0);">nargin</span> <span
 style="color: rgb(92, 92, 92);"><</span> <span
 style="color: rgb(188, 143, 143);">1</span> <span
 style="color: rgb(92, 92, 92);">|</span><span
 style="color: rgb(92, 92, 92);">|</span> <span
 style="color: rgb(0, 0, 0);">nargin</span> <span
 style="color: rgb(92, 92, 92);">></span> <span
 style="color: rgb(188, 143, 143);">2</span><span
 style="color: rgb(74, 85, 219);">)</span>    ------ Not sure how to replace this bit (variable not defined)
  </pre>
</blockquote>
nargin => <tt>argn(2)</tt><br>
<br>
<blockquote
 cite="mid:CAE3taFDh85yb6UrdGBh2NbemCXW1ir7ae3czr99cXo6dCaNMwA@mail.gmail.com"
 type="cite">
  <pre
 style="font-family: Monospaced; font-style: normal; font-size: 14px;">   .../...

  <span style="color: rgb(1, 168, 1); font-style: italic;">//  generate window</span>
  <span style="color: rgb(0, 0, 0);">switch</span> <span
 style="color: rgb(131, 67, 16); font-weight: bold;">r</span>   --------- think this should be select ?
  </pre>
</blockquote>
Right<br>
<blockquote
 cite="mid:CAE3taFDh85yb6UrdGBh2NbemCXW1ir7ae3czr99cXo6dCaNMwA@mail.gmail.com"
 type="cite">
  <pre
 style="font-family: Monospaced; font-style: normal; font-size: 14px;">.../...
    <span style="color: rgb(160, 32, 240);">case</span> <span
 style="color: rgb(188, 143, 143);">1</span><span
 style="color: rgb(0, 0, 0);">,</span>
      <span style="color: rgb(1, 168, 1); font-style: italic;">//  Hanning window</span>
      <span style="color: rgb(131, 67, 16); font-weight: bold;">w</span> <span
 style="color: rgb(92, 92, 92);">=</span> <span
 style="color: rgb(0, 0, 0);">hanning</span> <span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">L</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(0, 0, 0);">;</span>
  </pre>
</blockquote>
<tt>window('hn',L)</tt><br>
<blockquote
 cite="mid:CAE3taFDh85yb6UrdGBh2NbemCXW1ir7ae3czr99cXo6dCaNMwA@mail.gmail.com"
 type="cite">
  <pre
 style="font-family: Monospaced; font-style: normal; font-size: 14px;">    <span
 style="color: rgb(0, 0, 0);">otherwise</span>   ------------- else
  </pre>
</blockquote>
Yes<br>
<blockquote
 cite="mid:CAE3taFDh85yb6UrdGBh2NbemCXW1ir7ae3czr99cXo6dCaNMwA@mail.gmail.com"
 type="cite">
  <pre
 style="font-family: Monospaced; font-style: normal; font-size: 14px;">      <span
 style="color: rgb(1, 168, 1); font-style: italic;">//  cosine-tapered window</span>
      <span style="color: rgb(0, 0, 0);">t</span> <span
 style="color: rgb(92, 92, 92);">=</span> <span
 style="color: rgb(174, 92, 176); text-decoration: underline;">linspace</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(188, 143, 143);">0</span><span
 style="color: rgb(0, 0, 0);">,</span><span
 style="color: rgb(188, 143, 143);">1</span><span
 style="color: rgb(0, 0, 0);">,</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">L</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(188, 143, 143);">1</span><span
 style="color: rgb(255, 170, 0);">:</span><span
 style="color: rgb(160, 32, 240);">end</span><span
 style="color: rgb(92, 92, 92);">/</span><span
 style="color: rgb(188, 143, 143);">2</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(92, 92, 92);">'</span><span
 style="color: rgb(0, 0, 0);">;</span>
  </pre>
</blockquote>
replace <tt>end</tt> with <tt>$</tt>  : (1:$/2)';<br>
<br>
<blockquote
 cite="mid:CAE3taFDh85yb6UrdGBh2NbemCXW1ir7ae3czr99cXo6dCaNMwA@mail.gmail.com"
 type="cite">
  <pre
 style="font-family: Monospaced; font-style: normal; font-size: 14px;">      <span
 style="color: rgb(131, 67, 16); font-weight: bold;">w</span> <span
 style="color: rgb(92, 92, 92);">=</span> <span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(188, 143, 143);">1</span> <span
 style="color: rgb(92, 92, 92);">+</span> <span
 style="color: rgb(50, 185, 185);">cos</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(0, 0, 0);">pi</span><span
 style="color: rgb(92, 92, 92);">*</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(188, 143, 143);">2</span><span
 style="color: rgb(92, 92, 92);">*</span><span
 style="color: rgb(0, 0, 0);">t</span><span
 style="color: rgb(92, 92, 92);">/</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">r</span><span
 style="color: rgb(92, 92, 92);">-</span><span
 style="color: rgb(188, 143, 143);">1</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(92, 92, 92);">/</span><span
 style="color: rgb(188, 143, 143);">2</span><span
 style="color: rgb(0, 0, 0);">;</span>
  </pre>
</blockquote>
pi => <tt>%pi</tt><br>
<br>
<blockquote
 cite="mid:CAE3taFDh85yb6UrdGBh2NbemCXW1ir7ae3czr99cXo6dCaNMwA@mail.gmail.com"
 type="cite">
  <pre
 style="font-family: Monospaced; font-style: normal; font-size: 14px;">      <span
 style="color: rgb(131, 67, 16); font-weight: bold;">w</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(50, 185, 185);">floor</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">r</span><span
 style="color: rgb(92, 92, 92);">*</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">L</span><span
 style="color: rgb(92, 92, 92);">-</span><span
 style="color: rgb(188, 143, 143);">1</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(92, 92, 92);">/</span><span
 style="color: rgb(188, 143, 143);">2</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(92, 92, 92);">+</span><span
 style="color: rgb(188, 143, 143);">2</span><span
 style="color: rgb(255, 170, 0);">:</span><span
 style="color: rgb(160, 32, 240);">end</span><span
 style="color: rgb(74, 85, 219);">)</span> <span
 style="color: rgb(92, 92, 92);">=</span> <span
 style="color: rgb(188, 143, 143);">1</span><span
 style="color: rgb(0, 0, 0);">;</span>
      <span style="color: rgb(131, 67, 16); font-weight: bold;">w</span> <span
 style="color: rgb(92, 92, 92);">=</span> <span
 style="color: rgb(74, 85, 219);">[</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">w</span><span
 style="color: rgb(0, 0, 0);">;</span> <span
 style="color: rgb(50, 185, 185);">ones</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(0, 0, 0);">mod</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">L</span><span
 style="color: rgb(0, 0, 0);">,</span><span
 style="color: rgb(188, 143, 143);">2</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(0, 0, 0);">;</span> <span
 style="color: rgb(0, 0, 0);">flipud</span><span
 style="color: rgb(74, 85, 219);">(</span><span
 style="color: rgb(131, 67, 16); font-weight: bold;">w</span><span
 style="color: rgb(74, 85, 219);">)</span><span
 style="color: rgb(74, 85, 219);">]</span><span
 style="color: rgb(0, 0, 0);">;</span>
  </pre>
</blockquote>
mod => <tt>modulo</tt><br>
flipud(w) =><tt> flipdim(w,1)</tt><br>
<br>
<blockquote
 cite="mid:CAE3taFDh85yb6UrdGBh2NbemCXW1ir7ae3czr99cXo6dCaNMwA@mail.gmail.com"
 type="cite">
  <pre
 style="font-family: Monospaced; font-style: normal; font-size: 14px;">  <span
 style="color: rgb(0, 0, 0);">endswitch</span>  ------------------------------------ end ?
  </pre>
</blockquote>
Yes<br>
<br>
</body>
</html>