% create frequency sweep %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % f = chirp(t1,f1,t2,f2); % t1 = time vector % f1 = initial frequency % f2 = final frequency % t2 = time at which f2 is reached %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Fs = 44100; dur = .5; ratio = 10; t1 = [0 : 1/Fs : dur-1/Fs]; f1 = 440; f2 = 440 * ratio; t2 = dur; f = chirp(t1,f1,dur,f2); sound(f,Fs) plot(t1(1:length(f)/2),f(1:length(f)/2)) % plot the spectrogram of the sound figure(2)