Professional Documents
Culture Documents
Experiment # 06
Performed on
Student Name:
Roll Number: Section: E
Performance =
Maximum Marks Viva = 05 Total = 10
05
Marks Obtained
Remarks (if any)
Experiment evaluated by
Instructor Name: Engr. Muhammad Waseem Zeeshan Ashrafi
Signature:
Required Equipment:
Software: MATLAB-16
Hardware: Headphone with Mic
Example#01: (Generation and audio observation of Sinusoidal signal and convert into
.wav file)
In this example, a sinusoidal signal is generated and then play it. This should work on any
computer that has MATLAB and a working sound card.
fs = 16000;
f = 2000;
n = 0:1/fs:5;
x = sin(2*pi*f*n); % generating sinusoidal signal
plot(x)
axis([0 100 -2 2])
sound(x,fs); % to hear the signal
audiowrite('tone.wav',x,fs); %to create .wav file
Example#02:
r = audiorecorder(22050, 16, 1);
record(r); % speak into microphone...
pause(r);
p = play(r); % listen
resume(r); % speak again
stop(r);
p = play(r); % listen to complete recording
mySpeech = getaudiodata(r); % store the recorded values in
array format
plot(mySpeech)
Lab Task:
1) Apply different frequencies on sinusoidal signal, and compare the signal on the basis of
hearing.
2) Record and play your voice. Change into double format and plot it.
3) Read any .wav file. Add AWGN to the signal and by changing SNR, plot and hear the
signal.
4) Apply filter on the above signal. Plot and hear the filtered signal.