Signal Processing Toolbox | Help Desk |
chirp
Swept-frequency cosine generator.
y = chirp(t,f0,t1,f1) y = chirp(t,f0,t1,f1,'method
') y = chirp(t,f0,t1,f1,'method
',phi)
y = chirp(t,f0,t1,f1)
generates samples of a linear swept-frequency cosine signal at the time instances defined in array t
, where f0
is the instantaneous frequency at time 0, and f1
is the instantaneous frequency at time t1
. f0
and f1
are both in Hertz. If unspecified, f0
is 0, t1
is 1, and f1
is 100.
Y = CHIRP(T,F0,T1,F1,'method
')
specifies alternative sweep method options, where method
can be
linear
, which specifies an instantaneous frequency sweep fi(t) given byquadratic
, which specifies an instantaneous frequency sweep fi(t) given bylogarithmic
specifies an instantaneous frequency sweep fi(t) given bywhere
For a log-sweep, f1
must be greater than f0
.
y = chirp(t,f0,t1,f1,'method
',phi)
allows an initial phase phi
to be specified in degrees. If unspecified, phi
is 0.
Default values are substituted for empty or omitted trailing input arguments.
Compute the spectrogram of a linear chirp:
t = 0:0.001:2; % 2 secs @ 1kHz sample rate y = chirp(t,0,1,150); % Start @ DC, cross 150Hz at t=1 sec specgram(y,256,1e3,256,250) % Display the spectrogramCompute the spectrogram of a quadratic chirp:
![]()
t = -2:0.001:2; % ±2 secs @ 1kHz sample rate y = chirp(t,100,1,200,'quadratic'); % Start @ 100Hz, cross 200Hz % at t=1 sec specgram(y,128,1e3,128,120) % Display the spectrogram
![]()
Cosine of vector/matrix elements (see MATLAB Function Reference). |
|
Sine of vector/matrix elements (see MATLAB Function Reference). |
|