% error: y = chirp(t [, f0 [, t1 [, f1 [, form [, phase]]]]]) % % Evaluate a chirp signal at time t. A chirp signal is a frequency % swept cosine wave. % % t: vector of times to evaluate the chirp signal % f0: frequency at time t=0 [ 0 Hz ] % t1: time t1 [ 1 sec ] % f1: frequency at time t=t1 [ 100 Hz ] % form: shape of frequency sweep % 'linear' f(t) = (f1-f0)*(t/t1) + f0 % 'quadratic' f(t) = (f1-f0)*(t/t1)^2 + f0 % 'logarithmic' f(t) = (f1-f0)^(t/t1) + f0 % phase: phase shift at t=0 % % Example % specgram(chirp([0:0.001:5])); % linear, 0-100Hz in 1 sec % specgram(chirp([-2:0.001:15], 400, 10, 100, 'quadratic')); % soundsc(chirp([0:1/8000:5], 200, 2, 500, 'logarithmic'),8000); % % If you want a different sweep shape f(t), use the following: % y = cos(2*pi*integral(f(t)) + 2*pi*f0*t + phase);