Vous êtes sur la page 1sur 3

QUANTIZATION AND SAMPLING USING MATLAB

Introduction
In this part of the voice communication lab a simulation tool (Matlab) is used to
experiment with quantizing and sampling audio. The idea is you get to change
sampling and quantization parameters and hear the effects. or bac!ground see
lecture slides and supporting notes.
This part of the lab needs to be done in "I# $%& as Matlab software is required.
The Matlab environment allows us to experiment with processes li!e quantization
and sampling in software as if it was being done in real hardware.
The lab can be underta!en in pairs although you are encouraged to discuss
results with the rest of your group.
The lab
"opy model files ('.mdl) from ()* (.zip file) into M+T,+# directory in your
documents folder.
-un Matlab (start menu ./ programs)
Communication Technology RG '11
irst record a sample file using the record model (double0clic! the model name)
there is also some sample music (music %.avi and music $.avi). If the files aren1t
listed ma!e sure you have the correct directory.
-un the simulation by pressing the blac! arrow !ey. The default is to run for %2
seconds (you can ma!e a longer sample by changing the %2 to the right of the
arrow to a bigger value). The audio sample will be stored in a file called
3input.avi3. 4ou can change this by double0clic!ing the 3to Multimedia file3 box. To
change the audio sample at any time simply re0run the record model.
(ow you have some audio to use as input you are ready to experiment with
quantization and sampling. +t this stage it should be possible to test the effects
of quantization and sampling in real0time. That is run the models and send the
output directly to the audio output (.headphone soc!et). 5owever 6"s in "I#$%&
appear too slow so an interim step of sending the output to another avi file is
required.
Communication Technology RG '11
Quantization
)pen quantization.mdl. -un the model. Then use play.mdl to listen to the result
(use the headphones). (ote any differences with the original unquantized
%
audio.
(ow run the quantization model again but this time changing the quantization
step size first (double0clic! on the quantizer and increase the quantization0step
parameter). (ote any effects on the quantized audio. -epeat this exercise with
progressively larger values of quantization step. +t what step0size is the
quantization 7ust noticeable8
Samlin!
(ow open and run the sampling model. The default is to not change the sample
rate so everything should sound fine. (ow run the model again this time
changing the downsample9 upsample and gain parameters to $. (ote any effects
on the resulting audio. -epeat increasing the parameters by % each time.
+bout the model: To change the sampling rate of the audio we throw away some
of the samples (downsample bloc!). ;o that we can listen to the result we need
to put the sampling rate bac! to the original rate (<<.%!5z) as required by the
audio output. To do this the downsampled signal is first filtered then upsampled
by the same factor as the downsample. This then needs to be filtered and
amplified (again by the same factor). The result is a signal which behaves as if it
was sampled at <<.%!5z=downsample0factor.
-epeat the exercises with the sample audio in sample%.avi. +re your results
different8
"onclu#ion
Include this exercise in the report for the overall lab (about one side)9 record and
explain your results.
% (ote: The original audio sample is already sampled and quantized. 5owever the
sample rate (<<.%!5z and %> bits) do not result in noticeable affects such as aliasing
and noise. ?uantization.mdl and sampling.mdl allow us to change the quantization
step and sampling rate respectively.
Communication Technology RG '11

Vous aimerez peut-être aussi