I have a total sound duration of $T$.
I break the duration to several sub-durations and in each sub-duration, I generate several discrete sinusoidal values by the formula $\sin(2\pi ft)$ with a sampling rate of $f_s$.
The frequency used in consecutive sub-durations is different.
Now when I generate sound using these values (using matlab) I get audible click sounds between the point where two sub-durations meet; I think because of discontinuity. How can I remove these audible click sounds?
Edit the code I am using (roughly)
duration = 0.25; sampleRate = 44100; numberOfSamples = (duration * sampleRate); frequency = 19000:500:21500; freqHopSamples = ; for j = 1:length(frequency) startIndex = ((j-1)*(numberSubSamples) + 1); endIndex = j*numberSubSamples; t = (startIndex:endIndex)/sampleRate; freqHopSamples(startIndex:endIndex) = sin(2*pi*frequency(j)*t); end wavwrite(freqHopSamples, sampleRate, 'sound.wav');