%% Input Parameters
fs=30000;
Duration=30; % duration in sec
Tvec=0:1/fs:Duration; %teim vector
FreqRange=[4,25]; % initial frequency (1st) and end frequency (2nd)

%% Main function
AudioFileName=sprintf('Chirp%d-%dHz%dSecfs%d',FreqRange(1),FreqRange(2),Duration,fs);
ChirpWave=chirp(Tvec,FreqRange(1),Duration,FreqRange(2));

figure(1);
plot(Tvec,ChirpWave);
%% save data
saveas(1,'ChirpRawData.fig');
saveas(1,'ChirpRawData.jpg');
audiowrite([AudioFileName,'.wav'],ChirpWave,fs);
save(AudioFileName,'-v7.3');