Sound Processing in MATLAB
Sound Processing in MATLAB
1 of 7
http://homepages.udayton.edu/~hardierc/ece203/sound.htm
2 of 7
http://homepages.udayton.edu/~hardierc/ece203/sound.htm
3 of 7
http://homepages.udayton.edu/~hardierc/ece203/sound.htm
sound stops from one command before you enter another sound
command!
soundsc(left,fs)
soundsc(right,fs)
same)
soundsc(road,fs)
Another audio format is the .au file format. These files are read in
using
[lunch,fs2]=auread('lunch.au');
soundsc(lunch,fs2);
To save an array as a .wav file, use wavwrite( ). Use auwrite( ) for .au
format output.
4 of 7
http://homepages.udayton.edu/~hardierc/ece203/sound.htm
5 of 7
http://homepages.udayton.edu/~hardierc/ece203/sound.htm
soundsc(out,fs) % echo
25-06-2015 13:41
6 of 7
http://homepages.udayton.edu/~hardierc/ece203/sound.htm
out(n,1)=.9*out(n-1,1)+hootie(n,1); % left
out(n,2)=.9*out(n-1,2)+hootie(n,2); % right
end
Compare the input and output as before. Note that the modified signal
sounds muffled in comparison to the input data. This is because the high
frequency components have been suppressed in the output.
soundsc(hootie,fs)
% original
soundsc(out,fs)
7 of 7
http://homepages.udayton.edu/~hardierc/ece203/sound.htm
In most popular music recordings, the vocal track is the same on the left
and right channels (or very similar). The volume of the various
instruments are more unevenly distributed between the two channels.
Since the voice is the same on both channels, what would happen if we
subtract one channel from the other and listen to the result?
soundsc(left,fs);
You still hear some vocal here because this song uses a stereo
reverberation effect and the echo moves back and forth between left and
right channels (like our stereo delay above). This makes the voice
unequal from left to right channels.
25-06-2015 13:41