Matlab Programming Heres a sound file httpcarmauxcsgsuedumwe
Matlab Programming
Here\'s a sound file http://carmaux.cs.gsu.edu/~mweeks/csc4630/backwards.wav
(The file sound is in reverse so it will sound unclear)
Save it under your MATLAB directory (on a Mac, press the \"control\" key and click the mouse to show options), then use the \"wavread\" command to store the data in a variable. Store the sampling rate in a variable, too, since you will need it. Then use the \"sound\" command to play it.
As you should be able to hear, the message is unclear. In fact, it is backwards. You will need to reverse the array to straighten it out. Do that, and play the new version with the \"sound\" command. Next, use a \"disp\" command to print \"the word or phrase is:\" and then the word or phrase from the reversed data.
Here is a hint: suppose \"old_array\" has 100 values. We could access array values 1 to 100 with the command old_array(1:100). We can reverse that array with this:
>> new_array = old_array(100:-1:1);
Solution
Here is the MATLAB code:-
[y,Fs]=wavread(\'backwards.wav\'); % loads audio clip
% y contains the audio data and the Fs is the sampling frquency
size(road) % See the size of road:
soundsc(y,Fs);
% The left and right channel signals are the two columns of the \'y\' array:
left = y(:,1);
right = y(:,2);
left2 = flipud(left);
soundsc(left2,Fs);
% The sound that will be played here will be the reverse of the audio file.
