0% found this document useful (0 votes)
146 views12 pages

DSP Cep

The document describes a digital signal processing capstone project to design and implement filters to remove noise from signals. Students were asked to generate test signals, add noise, and use FIR and IIR filters like Butterworth filters to extract the original signals. Code was provided to generate signals, add noise, apply filters, and analyze performance in both time and frequency domains. The objectives were to learn signal processing design skills, analyze problems using techniques like DTFT and Z-transform, and select optimal filter methods meeting requirements.

Uploaded by

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

DSP Cep

The document describes a digital signal processing capstone project to design and implement filters to remove noise from signals. Students were asked to generate test signals, add noise, and use FIR and IIR filters like Butterworth filters to extract the original signals. Code was provided to generate signals, add noise, apply filters, and analyze performance in both time and frequency domains. The objectives were to learn signal processing design skills, analyze problems using techniques like DTFT and Z-transform, and select optimal filter methods meeting requirements.

Uploaded by

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

DSP CEP

SUBMITTED BY:
OSAMA BIN SHAHAB (01-133192-162)
ZEESHAN (01-133192-103)

SUBMITTED TO: SIR ADNAN YAQOOB


DATE: JUNE 30, 2022
PROBLEM STATEMENT:

In Wireless Communication, whenever the signal passes through the medium, it undergoes additive white
Gaussian noise (AWGN) which attenuates the amplitude of the original signal. AWGN equally affects all
the frequencies and is unavoidable. Objective of this engineering problem is to effectively remove the
noise by performing spectral analysis of the signal. Based on the frequency analysis, you would be
required to design suitable IIR and FIR filters with suitable cutoff frequencies to extract the original
signal by removing unwanted noise. At the end, perform the comparative analysis of proposed IIR and
FIR filters.

OBJECTIVE:
The main objective of this CEP is to equip the students with the design, analysis and implementation
skills used in modern signal processing systems. Other objectives include
i. To understand technical requirements of the problem.
ii. ii. To analyze the problem using different techniques (e.g., DTFT, ZT).
iii. iii. To select optimal design method meeting the requirements.
SOFTWARE USED:
 Matlab

EXPLAINATION:
 In first step we have set the three frequencies according to our roll numbers.
 We have made four signals.
 Then after that we have added all the signals.
 We have added a random noise to signal.

FIR FILTERS:
 Digital filters with finite-duration impulse response (all-zero, or FIR filters) have both advantages
and disadvantages compared to infinite-duration impulse response (IIR) filters.
 b = fir1(n, Wn, type) returns row vector b containing the n+1 coefficients of an order n low pass
FIR filter. This is a Hamming-window based, linear-phase filter with normalized cutoff
frequency.
 We made a low pass filter with order 100 and cut off frequency 35/1/fs (Nyquistic).
 Greater the order of filter more it removes distortion.
 After that we have computed the impulse response using command impz ()
 h = impz (___, n, fs) returns a vector t with consecutive samples spaced 1/fs units apart. H have
coefficients of filter. • After finding Impulse response we have convolve it with the noisy signal.
 This will pass all the frequencies less than cutoff frequency and will remove the noise.
IIR FILTER:
 The low pass Butterworth filter is an active Low pass filter.
 It is a type of signal processing filter designed to have a frequency response that is as flat as
possible in the passband. It is also referred to as a maximally flat magnitude filter.
 We have also used this filter to remove the noise from the noisy signal.
 [ b, a] = butter (n, Wn) returns the transfer function coefficients of an n th-order low pass digital
Butterworth filter with normalized cutoff frequency Wn.
 We have applied this butter filter on the noisy signal to filter noise.

CODE:
rolln = 12e3;
fs = rolln;
t = 0:0.001:5;
f1= rolln;
f2= 2*rolln;
f3= 3*rolln;
f4= 4*rolln;
fm = f4;
s1 = sin(2*pi*fm/f1*t);
s2 = sin(2*pi*fm/f2*t);
s3 = sin(2*pi*fm/f3*t);
s4 = sin(2*pi*fm/f4*t);
y1=s1*4;
y2=s2*4;
y3=s3*4;
y4=s4*4;
figure(1)
subplot(4,2,1);
plot(t,y1,'b');
title('Signal 1');
xlabel('x-axis');
ylabel('y-axis');
subplot(4,2,2);
plot(t,y2,'b');
title('Signal 2');
xlabel('x-axis');
ylabel('y-axis');
subplot(4,2,3);
plot(t,y3,'b');
title('Signal 3');
xlabel('x-axis');
ylabel('y-axis');
subplot(4,2,4);
plot(t,y4,'b');
title('Signal 4');
xlabel('x-axis');
ylabel('y-axis');
SIGNAL = y1 + y2 + y3 + y4;
subplot(4,2,5);
plot(t,SIGNAL,'b');
title('Added Signal');
xlabel('x-axis');
ylabel('y-axis');

AddNoise = SIGNAL + 4*randn(size(SIGNAL));


subplot(4,2,6);
plot(t,AddNoise,'r');
title('Composite Signal with noise');
xlabel('x-axis');
ylabel('y-axis');

a = fir1(90,35/(fs/2),'low');
y = filter(a, 1, AddNoise );
g = impz(a,1,90);
x = conv(AddNoise,g);
subplot(4,2,7);
plot(x,'b');
title('Signal with FIR Filter');
xlabel('x-axis');
ylabel('y-axis');
%Filtering Noise using time domain using butter Filter
[y1, x1] = butter(4,100/(fs/2));
WN = filter(y1, x1, AddNoise);
subplot(4,2,8);
plot(t,WN,'b');
title('Signal with butter filter');
xlabel('x-axis');
ylabel('y-axis');
figure(2)
sub1 = WN - s1;
s1 = WN - sub1
sub2 = WN - s2;
s2 = WN - sub2;
subplot(2,1,1);
plot(t,s1,'b');
title('Noise free Signal1');
xlabel('x-axis');
ylabel('y-axis');
subplot(2,1,2);
plot(t,s2,'b');
title('Noise free Signal2');
xlabel('x-axis');
ylabel('y-axis');
figure(3)
%signals in frequency domain:
sf = fft(s1,fs);
s2f = fft(s2,fs);
s3f = fft(signal3,fs);
s4f = fft(s4,fs);
subplot(2,2,1);
plot(abs(sf));
title('Signal 1 in Freq domain');
xlabel('x-axis');
ylabel('y-axis');
axis([-100,12100,0,4000]);
subplot(2,2,2);
plot(abs(s2f));
title('Signal 2 in Freq domain');
xlabel('x-axis');
ylabel('y-axis');
axis([-100,12100,0,4000]);
subplot(2,2,3);
plot(abs(s3f));
title('Signal 3 in Freq domain');
xlabel('x-axis');
ylabel('y-axis');
axis([-100,12100,0,4000]);
subplot(2,2,4);
plot(abs(s4f));
title('Signal 4 in Freq domain');
xlabel('x-axis');
ylabel('y-axis');
axis([-100,12100,0,4000]);
figure(4)

fq = fft(SIGNAL,fs);
subplot(2,1,1);
plot(abs(fq));
title('Original Signal in Freq domain');
xlabel('x-axis');
ylabel('y-axis');
axis([-100,12100,0,4000]);
nfq = fft(AddNoise,fs);
subplot(2,1,2);
plot(abs(nfq));
title('Noisy Signal in Freq domain');
xlabel('x-axis');
ylabel('y-axis');
axis([-100,12100,0,4000]);
figure(5)
nfs = fft(y,fs);
subplot(2,1,1);
plot(abs(nfs));
title('Filtered Signal in Freq domain');
xlabel('x-axis');
ylabel('y-axis');
SIGNAL=fft(SIGNAL,fs);
AddNoise= fft(AddNoise,fs);
Noise = AddNoise;
f = find(abs(Noise)<1000);
Noise(f) = zeros(size(f));
out = Noise;
subplot(2,1,2);
plot(abs(out));
title('Filtered Signal in Freq domain');
xlabel('x-axis');
ylabel('y-axis');
figure(6)
sub1 = fq - sf;
s1 = nfs - sub1;
sub2 = fq - s2f;
s2 = nfs - sub2;
subplot(2,1,1);
plot(abs(s1),'b');
title('Noise free Signal1');
xlabel('x-axis');
ylabel('y-axis');
subplot(2,1,2);
plot(abs(s2),'b');
title('Noise free Signal2');
xlabel('x-axis');
ylabel('y-axis');

TIME DOMAIN:
FREQUENCY DOMAIN:
CONCLUSION:

In this we have learned that how we can remove the noise from the signal in both time domain and
frequency domain and we have also learned that how we can use different filters to filter the noise by
their responses.

You might also like