<div class="gmail_quote">On 10 March 2013 09:02, TViT <span dir="ltr"><<a href="mailto:tvitklg@rambler.ru" target="_blank">tvitklg@rambler.ru</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello!<br>
<br>
In Matlab there is a function chirp, and what is in Scilab?<br>
<br>
And why Scilab can not transform a simple example from Matlab of a file?<br>
<br>
//-----------------------------------------------------<br>
t = 0:0.001:2;            % 2 secs @ 1kHz sample rate<br>
y = chirp(t,0,1,150);     % Start @ DC,<br>
                          %   cross 150Hz at t=1 sec<br>
spectrogram(y,256,250,256,1E3,'yaxis')<br>
//-----------------------------------------------------<br>
<br>
 !--error 37<br>
at line     190 of function mfile2sci called by :<br>
at line     142 of function cb_m2sci_gui called by :<br>
cbo = getcallbackobject("-6ebf8d73:13d5388519a:-7f72");cb_m2sci_gui;if<br>
exists("%oldgcbo") then gcbo = %oldgcbo;<br>
while executing a callback<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://mailinglists.scilab.org/Generation-of-linear-frequency-tp4026202.html" target="_blank">http://mailinglists.scilab.org/Generation-of-linear-frequency-tp4026202.html</a><br>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.<br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br></blockquote><div><br>Google the function as chirp.m and you will get the code:<br><br><pre><font size="4">function   x = chirp( T, W, p )
%CHIRP    generate a sampled chirp signal
%-----       exp(j(W/T)pi*t^2)   -T/2 <= t < +T/2
%
%   Usage:   X = chirp( T, W, <P> )
%
%      X :  N=pTW samples of a "chirp" signal
%      T :  time duration from -T/2 to +T/2
%      W :  swept bandwidth from -W/2 to +W/2
%
%   optional (default is P = 1)
%      P :  samples at P times the Nyquist rate (W)
%            i.e., sampling interval is 1/(PW)

%---------------------------------------------------------------
% copyright 1994, by C.S. Burrus, J.H. McClellan, A.V. Oppenheim,
% T.W. Parks, R.W. Schafer, & H.W. Schussler.  For use with the book
% "Computer-Based Exercises for Signal Processing Using MATLAB"
% (Prentice-Hall, 1994).
%---------------------------------------------------------------

if nargin < 3
   p = 1;   end    
J = sqrt(-1);
%--------------
delta_t = 1/(p*W);
N = round( p*T*W );    %--- same as T/delta_t
nn = [0:N-1]';
x = exp( J*pi*W/T * (delta_t*nn - T/2).^2 );</font></pre> Just recode in Scilab and place in your main source code or set in a functions libarry to be called.<br>May be different versions of this so best to check around<br>
</div></div><br>