function y = synth_sinesweep(ms, fs) %SYNTH_SINESWEEP generate sinusoidal sweep (chirp) signal % synth_sinesweep(ms, fs) generates a sweeping sinusoidal wave from % DC to Nyquist of specified duration with unity amplitude. % % Input: % ms - duration in milli-second % fs - sampling frequency in Hertz % % Example: % y = synth_sinesweep(1000, 44100); % sound(y, 44100); % specgram(y, 256, 44100); % % 2004-11-11 by MARUI Atsushi method = 'logarithmic'; t = 0 : 1/fs : ms/1000; t = t(1:length(t)-1); y = chirp(t, min(t), max(t), fs/2, method);