1. NAME :
REG.NO : 19BEC0858
COURSE CODE : ECE2006
COURSE TITLE : DIGITAL SIGNAL PROCESSING
SHAHUKARI CHETAN
LAB TASK - 2
FALL Semester 2021-22
19BEC0858
SHAHUKARI CHETAN
FACULTY NAME : PROF. MALAYA KUMAR HOTA
SLOT : L45+L46
2. 19BEC0858
SHAHUKARI CHETAN
i)
Objective:
To Reading an audio and adding noise and filtering it using moving average
filter.
Procedure:-
▪ Reading an audio signal of format .wav from the user
▪ Adding noise to that signal of its length
▪ Producing the mixed signal and plotting the signals.
▪ Using moving average filter removing the noise from the mixed signal
using commands b = (1/size)*ones(1,size); output = filter(b,1,d); and
also plotting the removed noise signal. Here size determines the extend
of filtering.
▪ And we used get the noise removal signal at the output.
Code:-
clc;
clear all;
close all;
[signal,fs]=audioread('chetan.wa
v');
signal=signal(:,1);
%sound(signal,fs) %signal sound
length(signal)
noise=0.1*randn(536474,1);
%sound(noise,fs) %noise sound
d=signal+noise;
%sound(d,fs)%signal with noise
subplot(4,1,1);
plot(signal);
4. 19BEC0858
SHAHUKARI CHETAN
Output:
Interface:-
Read an audio signal add random noise to get the noisy signal. Use moving
average filter to remove the noise from the contaminated audio signal
ii)
Objective:
Using MATLAB write a code for cross correlation of two signals without using
inbuilt function xcorr and after performing, to cross verify the result using xcorr.
Procedure:-
1. Input the two sequences respectively.
2. Arrange the 1st signal as it is in a column form.1st signal will now work as the
first column.
3. Then flip the 2nd sequence and arrange it in a row form.
4. Multiply the corresponding elements of the 1st row and 1st column to get the
values of the cells of the table.
5. Take the sum of the table value diagonally such that we get n1+n2-1 elements,
starting with R[1]C[1] as the 1st element, R[2]C[1]+R[1]C[2] as the 2nd, and
so on, where n1 and n2 are the number of elements in the 1st and the 2nd
sequence respectively. Sum must be done diagonally strictly.
6. Output sequence obtained is the correlation between the initial two sequences.
7. Finally cross check the answer using inbuilt function xcorr().
8. 19BEC0858
SHAHUKARI CHETAN
Result/Inference:
We ploted the cross correlation and verified it successfully
Output:
iii)
Objective:
To generate the Circular convolution between two sequences in time domain
without using any inbuilt function and cross verify the result using “cconv”.
Procedure:-
▪ Enter the two functions
▪ Find the length of the two function Use for loop to multiply the two function
and calculate the product.
clc;
clear all;
close all;
x=input('enter x:');
h=input('enter h:');
m=length(x);
n=length(h);
k=max(m,n);
a=1:k;
X=[x,zeros(1,k-m)];
Code: