Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Objective:
1. To learn to how to read, play, and write sound signals (audio files) in
MATLAB.
2. To learn the how to plot sound signals in time and frequency domain.
3. Do exercises to practice manipulation of sound signals in MATLAB.
Notes:
v Solve all the exercises and submit a report containing each question followed
by MATLAB code , followed by result figure (s) if any.
v All exercises to be attempted during lab allocated time .
Introduction
Sound signals are the consequence of changing air pressure over time. These pressure
variances propagate as analog waves from a vibrating source (mouth in case of
humans is the source of the sound). When entering the sound signal into a computer
using microphone for example , it will be converted to discrete signal using Analog to
Digital converter, that's where MATLAB comes in handy, because now we can
represent and store the sound signals in vector or matrix format. MATLAB provides
basic commands to read (load) sound signals that will be treated as data vectors –
mostly column vectors -. Microsoft wave sound files (".wav") can be read using
MATLAB command ‘wavread’. After executing this command it will return the
samples of the sound file, its sampling frequency and the number of bits used per
sample. Sampling frequency plays a critical part when you listen to the signal using
the sound command of MATLAB. A similar command ‘wavwrite’ can write the data
from MATLAB to a wav file (".wav") that can be played later.
Lab Work :
3- Compare the quality of sound results you got in exercise 2. Are they
completely different sounds? Why?
4- Write the sound data you got from exercise 1 above to a new wav file using
'wavwrite' command with appropriate parameters. Listen to the sound
samples through Windows media player without using the MATLAB
sound command.
5- Use windows sound recorder and open the file ms.wav. Observe the
properties of the file. Save the file with different names with the following
properties:
6- Load all these sound files and listen to them. In each case, observe the data
vector containing the samples of the sound signal and comment on the
following points:
a. What is the difference between mono and stereo signals? How the
data vector differs for mono and stereo in MATLAB ?
d. How does the number of bits per sample affect the quality of
sound?
e. What is the effect of number of bits per sample on the size of the
data vector?
12- Use plot command to sketch the samples of the sound signal in time
domain. You need to define a proper time vector based on the sampling
time and end time.
14- Plot the spectrum of the sound signal. You need to define a proper
frequency vector.