Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

FACULTY OF ENGINEERING

TRIMESTER 2, SESSION 2019 / 2020

ETN 3096: DIGITAL SIGNAL PROCESSING

ASSIGNMENT ( 15% )
Name Student ID Majoring

Khayell Balamurali 1161102497 OPE

Suvitha Palani 1161102236 TE

To be filled by lecturer:

Filter specification (out of 3 marks)


FIR filter design (out of 5 marks)
IIR filter design (out of 5 marks)
Evaluation of filtered signal (out of 2 marks)
Total
Original Waveform

Coding to read original waveform for Matlab:

filename = ‘original.wav’;
[y,Fs] = audioread(‘original.wav’);
sound(y,Fs);
plot(y);

Waveform from Matlab:

x-axis : Frequency ( Hz )
y-axis : magnitude ( dB )
Noisy Waveform

Coding to read noisy waveform for Matlab:

filename = ‘original.wav’;
[y,Fs] = audioread(‘original.wav’);
sound(y,Fs);
plot(y);

Waveform from Matlab:

x-axis : Frequency ( Hz )
y-axis : magnitude ( dB )
Filter design specification

As shown in diagram below, we can see the amplitude versus samples graph for time domain and
magnitude versus normalised frequency graph for frequency domain.

The leakage factor is 0.04%.


The relative sideband attenuation is -35.8 dB.
The mainlobe width (-3dB) is 0.27344.
Finite Impulse Response (FIR)

Filter Specification

Response type: Lowpass


Design method: FIR – Window ( Hamming )
Order: 10
Stability: Yes, stable
Sampling frequency (Fs): 8000 Hz
Cutoff frequency (Fc): 1300 Hz

Magnitude response of FIR filter


We used Analog Filter Wizard, an online tool to design the filter. We use the specifications of
filters like the passband value, stopband value and filter response to design the filter.

Magnitude Response (dB) using online tool

Passband: -3dB, 1000Hz


Stopband: -20dB, 2100 Hz
Filter Response: 10th order Butterworth Bessel 0.26 (5 stages)
Filter design of FIR
Infinite Impulse Response (IIR)

Filter Specification

Response type: Lowpass


Design method: IIR – Butterworth
Order: 10
Stability: Yes, stable
Sampling frequency (Fs): 8000 Hz
Cutoff frequency (Fc): 1750 Hz

Magnitude response of FIR filter


We used Analog Filter Wizard, an online tool to design the filter. We use the specifications of
filters like the passband value, stopband value and filter response to design the filter.

Magnitude Response (dB) using online tool

Passband: -3dB, 1510Hz


Stopband: -20dB, 2200 Hz
Filter Response: 10th order Butterworth Bessel 0.45 (5 stages)
Filter design for IIR
WAVEFORM ANALYSIS

1. Coding to analyse signal/design sign

%sound(x,fs);
[x, fs] = audioread ('noisy.wav');
x = x(:,1);
N = length(x);
t = (0:N-1)/fs;
audiosec = N/fs;

%sound(x1,1);
[x1, fs1] = audioread ('original.wav');
x1 = x1(:,1);
N1 = length(x1);
t1 = (0:N1-1)/fs1;
audiosec1 = N1/fs1;

%Plot graph
%subplot(2,1,1); % (row,column,position)
plot(t,x);
grid on;
xlim ([0, 8]);
xlabel('time (s)');
ylabel ('amplitude');
title('Noisy Signal');
hold on

%%subplot(2,1,2);
plot(t1,x1);
grid on;
xlabel('time (s)');
ylabel ('amplitude');
title('Original Signal');
ylim([-0.5,0.5]);
xlim([0,8]);

%time to freq domain


Y = fft(x);
originalSignal = fft(x1);

%observe effect of noise on signal both in time and freq domain


f = linspace (0,fs,length(x));
figure;
subplot(2,1,1);
plot(f,abs(Y));
title ('Noisy signal in frequency');
xlabel ('freq (Hz)'); ylabel ('magnitude');

subplot(2,1,2);
plot(f,abs(originalSignal));
title ('original signal in frequency');
xlabel ('freq (Hz)'); ylabel ('magnitude');

%Design Filter
filterDesigner;
%fpass=1750 fstop=2000 fs=8000
FilteredSignal = filter(Hd, x);
FilteredSignalTransform = fft(FilteredSignal);

figure
plot(t,FilteredSignal);
hold on;
plot(t1,x1);
grid on;
ylim([-0.5,0.5]);
xlim([0,8]);

figure
subplot(2,1,1);
plot(f,abs(Y));
title ('Noisy signal in frequency');
xlabel ('freq (Hz)'); ylabel ('magnitude');

subplot(2,1,2);
plot(f,abs(FilteredSignalTransform));
title ('Filtered signal in frequency');
xlabel ('freq (Hz)'); ylabel ('magnitude');
ylim([0,400]);

sound(FilteredSignal,fs);
Figure 1: Original Waveform and Noise waveform in time domain

Figure 2: Original Waveform and Noise waveform in time domain after using FIR
Figure 3: Original Waveform and Noise waveform in time domain after using IIR

Discussion
The blue waveforms are known as noise signals and the orange waveform is the original signals.
In figure 1 the noise signals is beyond the original signal and it creates distortion in the sound. In
figure 2, the noise signal have been reduced after using finite impulse response. As for figure 3, the
noise signal is being reduced even more better compare to figure 2 after using infinite impulse
response.
Figure 4: Original Waveform and Noise waveform in frequency domain

Figure 5: Original Waveform and Noise waveform in frequency domain after using FIR
Figure 6: Original Waveform and Noise waveform in frequency domain after using IIR

Discussion
In figure 4, approximately from 2kHz to 6kHz there is additional waveform in noise signal
compare to original signal. Using FIR, the additional waveform in noise signal will be filtered as
shown in figure 5 and figure 6. Comparing original signal and filtered signal, the waveform from
2kHz to 6kHz is removed slightly indicates that some original signal has been deleted after filter.

Conclusion
After doing this assignment both of us learnt the importance of finite impulse response(FIR) and
infinite impulse response(IIR). Removing noise from original signal is an essential role of filter.
We have applied the theory and design a filter using matlab and analog filter wizard.We are happy
doing this assignment as we learnt several technical skills like using matlab in simpler way.

Reference
1. Youtube link - https://www.youtube.com/watch?v=VFt3UVw7VrE

You might also like