Franklin - since your four sound function calls follow one after the other, all four sounds are playing at roughly the same time. You have a couple of options. The first is to put a pause in between each call to sound given the number of samples being played and the sample rate.
sound(sampledSig, reSampRate,resolution);
pause(ceil(length(sampledSig)/reSampRate));
sound(quantizedSig,reSampRate,resolution);
pause(ceil(length(quantizedSig)/reSampRate));
player = audioplayer(sampledSig, reSampRate,resolution);
playblocking(player);
player = audioplayer(quantizedSig,reSampRate,resolution);
playblocking(player);
We use the playblocking function to play the sound and not return control until the playback has completed. A nicer alternative to a pause.
Best Answer