0% found this document useful (0 votes)
9 views9 pages

Ali - Lab 09 Report

DSP LAB 9

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views9 pages

Ali - Lab 09 Report

DSP LAB 9

Uploaded by

Muhammad Ali
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Namal University, Mianwali

Department of Electrical Engineering

EE 345 (L) – Digital Signal Processing (Lab)

Lab – 9

Audio Signal Processing using MATLAB

Student Name Student ID

Muhammad Ali NIM-BSEE-2021-34

Instructor: Zulaikha Kiran

Lab Engineer: Faizan Ahmad


Introduction
The purpose of this lab is to enable the students to study audio signal synthesis and analysis using
MATLAB.
Course Learning Outcomes
CLO1: Develop algorithms to perform signal processing techniques on digital signals using MATLAB and
DSP Kit DSK6713
CLO3: Deliver a report/lab notes/presentation/viva, effectively communicating the design and analysis of
the given problem
Equipment

• Software
o MATLAB
Instructions
1. This is an individual lab. You will perform the tasks individually and submit a report.
2. Some of these tasks are for practice purposes only while others (marked as ‘Exercise’) have
to be answered in the report.
3. When asked to display an image/ graph in the exercise, either save it as jpeg or take a
screenshot, in order to insert it in the report.
4. The report should be submitted on the given template, including:
a. Code (copy and pasted, NOT a screenshot)
b. Output values (from command window, can be a screenshot)
c. Output figure/graph (as instructed in 3)
d. Explanation where required
5. The report should be properly formatted, with easy to read code and easy to see figures.
6. Plagiarism or any hint thereof will be dealt with strictly. Any incident where plagiarism is
caught, both (or all) students involved will be given zero marks, regardless of who copied whom.
Multiple such incidents will result in disciplinary action being taken.

Background
Audio signal processing involves the manipulation, analysis, and enhancement of sound waves
using digital techniques. Initially, analog audio signals are converted into digital format through
analog-todigital converters (ADCs). Once digitized, various processing techniques can be applied,
including filtering, equalization, compression, and reverberation, among others. Filtering can
remove unwanted frequencies or enhance specific ones, while equalization adjusts the frequency
balance of the signal. Compression reduces the dynamic range of the signal, making it more
uniform in volume, often used in music production and broadcasting. Reverberation adds
simulated acoustic reflections to create a sense of space or ambiance. These techniques can be
implemented using algorithms in software or hardware, providing flexibility and control over
audio content in applications ranging from music production and mixing to telecommunications
and entertainment. Additionally, advancements in machine learning and artificial intelligence have
further expanded the capabilities of audio signal processing, enabling tasks such as noise reduction,
source separation, and automatic audio tagging.
Exercise:
Task 1:

Code:

% Define the time variable


fs=8000;
t = 0:1/fs:1;

a = sin(2*pi*174.61*t);
b = sin(2*pi*195.99*t);
g = sin(2*pi*220*t);
f = sin(2*pi*246.94*t);

line1 = [a,b,g,f,f,b,b];
line2 = [a,b,b,f,f,g,g];

music = [line1, line2];

% Play the music


sound(music,fs);

Task2:

Code:

% Define the time variable

fs=8000;
t = 0:1/fs:2;

a = sin(2*pi*174.61*t);
b = sin(2*pi*195.99*t);
g = sin(2*pi*220*t);
f = sin(2*pi*246.94*t);

line1 = [a,b,g,f,f,b,b];
line2 = [a,b,b,f,f,g,g];

music = [line1, line2];


noise=2*randn(size(music));
%signal after adding noise
z=music+noise;
% Play the music
sound(z,fs);

Task3:

Code:
% Define the time variable

fs=8000;
t = 0:1/fs:1;

a = sin(2*pi*174.61*t);
b = sin(2*pi*195.99*t);
g = sin(2*pi*220*t);
f = sin(2*pi*246.94*t);

line1 = [a,b,g,f,f,b,b];
line2 = [a,b,b,f,f,g,g];

music = [line1, line2];


noise=2*randn(size(music));
%signal after adding noise
z=music+noise;
f1=175;
cutoff =f1/(fs/2);
order=50;
d=designfilt('lowpassfir','CutoffFrequency',cutoff,'FilterOrder',order);
output= filter(d,z);
sound(output,fs);

Task4:

Code:

% Define the time variable

fs=8000;
t = 0:1/fs:1;

a = sin(2*pi*174.61*t);
b = sin(2*pi*195.99*t);
g = sin(2*pi*220*t);
f = sin(2*pi*246.94*t);

line1 = [a,b,g,f,f,b,b];
line2 = [a,b,b,f,f,g,g];

music = [line1, line2];


noise=2*randn(size(music));
%signal after adding noise
z=music+noise;
f1=200;
cutoff =f1/(fs/2);
order=50;
d=designfilt('highpassfir','CutoffFrequency',cutoff,'FilterOrder',order);
output= filter(d,z);
sound(output,fs);
Task5:

Code:

% Define the time variable

fs=8000;
t = 0:1/fs:1;

a = sin(2*pi*174.61*t);
b = sin(2*pi*195.99*t);
g = sin(2*pi*220*t);
f = sin(2*pi*246.94*t);

line1 = [a,b,g,f,f,b,b];
line2 = [a,b,b,f,f,g,g];

music = [line1, line2];


noise=2*randn(size(music));
%signal after adding noise
z=music+noise;
f1=200;
cutoff1=200/(fs/2);

cutoff2=300/(fs/2);
order=100;
d=designfilt('bandpassfir','CutoffFrequency1',cutoff1,'CutoffFrequency2',cu
toff2,'FilterOrder',order);
output= filter(d,z);
sound(output,fs);

Task6:

myVoice = audiorecorder;
t = 0:1/8000:1;
disp('Start speaking.')

Start speaking.

recordblocking(myVoice, 10)
disp('End of recording. Playing back ...')

End of recording. Playing back ...

play(myVoice)

ans =
audioplayer with properties:

a=getaudiodata(myVoice);
% Time domain plot
t = 0:1/fs:(length(a)-1)/fs; % Time vector
figure; % Create a new figure window
plot(t, a);
title('Time Domain Signal');
xlabel('Time (seconds)');
ylabel('Amplitude');

y = fft(a);
f = (0:length(y)-1)*fs/length(y); %
magnitudeY = abs(y);
figure; % Create a new figure window
stem(f, magnitudeY);
title('Frequency Domain Spectrum');
xlabel('Frequency (Hz)');
ylabel('Magnitude');
Explanation of all tasks is give below:
Conclusion:
Evaluation Rubric
• Method of Evaluation: In-lab marking by instructors, Report submitted by students
• Measured Learning Outcomes:
CLO1: Develop algorithms to perf orm signal processing techniques on digital signals using MATLAB and DSP Kit
DSK6713 CLO3: Deliver a report/lab notes/presentation/viva, ef f ectively communicating the design and analysis of
the given problem

Excellent Good Satisfactory Unsatisfactory Poor Marks


10 9-7 6-4 3-1 0 Obtained
All tasks completed All tasks
Tasks Most tasks completed Some tasks completed Most tasks incomplete
correctly. Correct code incomplete or
(CLO1) correctly. correctly. or incorrect.
with proper comments. incorrect.
Some Output/Figures/Plots
Output Most displayed with proper Most of the required Output/Figures/Plots
Output correctly shown
(CLO1) Output/Figures/Plots labels Output/Figures/Plots not not displayed
with all Figures/Plots
displayed with proper OR Most displayed
displayed
labels Output/Figures/Plots
as required and properly
displayed but without
labelled proper
labels
Meaningful answers to all Some correct/ Answers not
Answers questions. Answers show Meaningful answers to meaningful understandable/
(CLO1) the understanding of the most questions. answers with some not relevant to Not Written any
student. irrelevant ones questions Answer
Report submitted with Some correct/ meaningful
Report submitted with
Report proper conclusions drawn conclusions. Some parts Conclusions not
proper grammar and
(CLO3) with good formatting but of the document not based on results.
punctuation with proper Report not
some grammar mistakes properly Bad formatting with
conclusions drawn and submitted
OR proper grammar but not formatted or some no proper
good
very good formatting grammar grammar/punctuation
formatting
mistakes
Total

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy