<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hi Scilabers</p>
<p>I'm trying to understand how to use the FFT function in Scilab.
I'm using v. 6.1.0 on a Windows 10 machine.</p>
This crashes Scilab:
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="color:rgb(92,92,92);">y =</span> <span style="color:rgb(50,185,185);">linspace</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(188,143,143);">256,256</span><span style="color:rgb(0,0,0);"></span><span style="color:rgb(74,85,219);">)
x = fft(y)
</span>
BTW, the example in the online help (<a class="moz-txt-link-freetext" href="https://help.scilab.org/docs/6.1.0/en_US/fft.html">https://help.scilab.org/docs/6.1.0/en_US/fft.html</a>) also crashes Scilab:</pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0;"><span style="color:rgb(74,85,219);"></span>
<span style="color:rgb(74,85,219);"><span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">sample_rate</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">=</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">1000</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">;</span>
<span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">t</span> <span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">=</span> <span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">0</span><span class="scilabspecial" style="font-style: normal; color: rgb(255, 170, 0);">:</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">1</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">/</span><span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">sample_rate</span><span class="scilabspecial" style="font-style: normal; color: rgb(255, 170, 0);">:</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">0.6</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">;</span>
<span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">N</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">=</span><a class="scilabcommand" href="https://help.scilab.org/docs/6.1.0/en_US/size.html" style="color: rgb(50, 185, 185); text-decoration: underline; font-style: normal;">size</a><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">(</span><span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">t</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">,</span><span class="scilabstring" style="font-style: normal; color: rgb(188, 143, 143);">'</span><span class="scilabstring" style="font-style: normal; color: rgb(188, 143, 143);">*</span><span class="scilabstring" style="font-style: normal; color: rgb(188, 143, 143);">'</span><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">)</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">;</span> <span class="scilabcomment" style="font-style: italic; color: rgb(1, 168, 1);">//number of samples</span>
<span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">s</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">=</span><a class="scilabcommand" href="https://help.scilab.org/docs/6.1.0/en_US/sin.html" style="color: rgb(50, 185, 185); text-decoration: underline; font-style: normal;">sin</a><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">(</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">2</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">*</span><span class="scilabconstants" style="font-style: normal; color: rgb(218, 112, 214);">%pi</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">*</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">50</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">*</span><span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">t</span><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">)</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">+</span><a class="scilabcommand" href="https://help.scilab.org/docs/6.1.0/en_US/sin.html" style="color: rgb(50, 185, 185); text-decoration: underline; font-style: normal;">sin</a><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">(</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">2</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">*</span><span class="scilabconstants" style="font-style: normal; color: rgb(218, 112, 214);">%pi</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">*</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">70</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">*</span><span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">t</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">+</span><span class="scilabconstants" style="font-style: normal; color: rgb(218, 112, 214);">%pi</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">/</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">4</span><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">)</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">+</span><a class="scilabcommand" href="https://help.scilab.org/docs/6.1.0/en_US/grand.html" style="color: rgb(50, 185, 185); text-decoration: underline; font-style: normal;">grand</a><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">(</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">1</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">,</span><span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">N</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">,</span><span class="scilabstring" style="font-style: normal; color: rgb(188, 143, 143);">'</span><span class="scilabstring" style="font-style: normal; color: rgb(188, 143, 143);">nor</span><span class="scilabstring" style="font-style: normal; color: rgb(188, 143, 143);">'</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">,</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">0</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">,</span><span class="scilabnumber" style="font-style: normal; color: rgb(188, 143, 143);">1</span><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">)</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">;</span>
<span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">y</span><span class="scilaboperator" style="font-style: normal; color: rgb(92, 92, 92);">=</span><a class="scilabcommand" href="https://help.scilab.org/docs/6.1.0/en_US/fft.html" style="color: rgb(50, 185, 185); text-decoration: underline; font-style: normal;">fft</a><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">(</span><span class="scilabid" style="font-style: normal; color: rgb(0, 0, 0);">s</span><span class="scilabopenclose" style="font-style: normal; color: rgb(74, 85, 219);">)</span><span class="scilabdefault" style="font-style: normal; color: rgb(0, 0, 0);">;</span>
</span>
Cheers,
Claus</pre>
<pre style="font-family:Monospaced;font-style:normal;font-size:14.0;">
<span style="color:rgb(74,85,219);"></span></pre>
</body>
</html>