0% found this document useful (0 votes)
26 views19 pages

ASP Lab Manual

Uploaded by

muskansiddiqa63
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)
26 views19 pages

ASP Lab Manual

Uploaded by

muskansiddiqa63
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/ 19

RV COLLEGE OF ENGINEERING®, Bengaluru-59

(Autonomous Institution affiliated to VTU, Belagavi)


Department of Electronics and Telecommunication Engineering
M.Tech in DIGITAL COMMUNICATION ENGINEERING
Advanced Signal Processing (22MDC13TL) (SEM-I)
(2022-2023)

List of Experiments

Sno Experiment CO’S


Mapping

1 Design and simulation of FIR lowpass and highpass filter 1


using windowing functions

2 Design and simulation of FIR bandpass and bandstop filter 1


using windowing functions

3 Design and Simulation of FIR Differentiator 1

4 Design and Simulation of FIR Hilbert Transformer 1

5 Up-sampling of input in time domain and frequency 2


domain.

6 Down-sampling of input in time domain and frequency 2


domain

7 Simulation of DCT & IDCT, DFT and IDFT for a given 3


sequence

8 Simulation of Weiner filter 2

9 Simulation of Optimum filter 2

10 Simulation of LMS algorithm for a random Signal 3

Course Outcomes

CO1: Apply design techniques for FIR filters.


CO2: Design and demonstrate various adaptive filters and sampling rate
conversions.
CO3: Design and demonstrate various Processing systems
CO4: Apply machine learning algorithms to signal processing test cases

Faculty Incharge HOD


RV COLLEGE OF ENGINEERING®, Bengaluru-59
(Autonomous Institution affiliated to VTU, Belagavi)
Department of Electronics and Telecommunication Engineering
M.Tech in DIGITAL COMMUNICATION ENGINEERING
Advanced Signal Processing (22MDC13TL) (SEM-I)
(2022-2023)
Question bank for Lab
Sno

1a Design and simulate FIR Lowpass filter using Hann windowing function.

Order of the Filter(N)=7

High Cutoff Frequency(Wh)=0.4Π rad/sec

1b Design and simulate FIR Highpass filter using Hamming windowing functions.

Order of the Filter(N)=7

Low Cutoff Frequency(Wl)=0.4Π rad/sec

2a Design and simulate FIR Bandpass filter using Hann windowing function.

Order of the Filter(N)=7

Lower Cutoff Frequency(Wl)=0.2Π rad/sec

Higher Cutoff Frequency(Wh)=0.8Π rad/sec

2b Design and simulate FIR Bandstop filter using Hamming windowing functions.

Order of the Filter(N)=7

Lower Cutoff Frequency(Wl)=0.2Π rad/sec

Higher Cutoff Frequency(Wh)=0.8Π rad/sec

3a Simulate a 25 tap FIR Hilbert transformer using Barlett window

3b Simulate a 25 tap FIR Hilbert transformer using Hamming window

4a Simulate a 25 tap FIR Differentiator using Rectangular window


4b Simulate a 25 tap FIR Hilbert transformer using Barlett window

5a Design and simulate DCT & IDCT for a given input sequence of length N

5b Design and simulate DFT & IDFT for a given input sequence of length N

6a Design and simulate Up-sampling for a given sequence & sinewave in time domain.

Plot the output in time domain

6b Design and simulate Up-sampling for a given sinewave in frequency domain.

Plot the output in Frequency domain

7a Design and simulate Down-sampling for a given sequence & sinewave in time domain.

Plot the output in time domain

7b Design and simulate Down-sampling for a given sinewave in frequency domain.

Plot the output in Frequency domain

8 Simulate Weiner Filter and obtain the output after the removal of Gaussian noise

9 Simulate Optimum Filter for a random signal

10 Simulate LMS algorithm for a random signal

step size (μ) = 0.03,

length(N) of FIR window =11

Cut off frequency (wc)=0.4 rad/sec

Faculty In- Charge Prof & HOD

1. FIR Lowpass and FIR Highpass filter

Aim: Design and simulate FIR Lowpass filter & FIR Highpass filter using
windowing function (Hamming, Hann, Barlett etc)

Theory: An FIR filter is one that is described by the difference equation


and by the transfer function

The window design method does not produce filters that are optimal (in the sense of meeting
the design specifications in the most computationally-efficient fashion), but the method is
easy to understand and does produce filters that are reasonably good. Of all the hand-design
methods, the window method is the most popular and effective. In brief, in the window
method we develop a causal linear-phase FIR filter by multipying an ideal filter that has an
infinite-duration impulse response (IIR) by a finite-duration window function:

where is the practical FIR filter, is the ideal IIR prototype filter, and is the finite-duration
window function.
Ideal filters
Ideal filters have a response that is constant in the passbands and zero in the stopbands, along
with linear phase. As a reference, the transfer functions and corresponding impulse responses
ideal filters are as follows:
i. Lowpass filters

ii. Highpass filters

Windowing function

A lot of window shapes have been used for filter design, which are defined in 0 ≤ n ≤ M. A
few are discussed in the following section.
A. Rectangular window
The rectangular window is what you would obtain if you were to simply segment a
finite portion of the impulse response without any shaping in the time domain:
B. Bartlett (or triangular) window
The Bartlett window is triangularly shaped:

The Bartlett window has a wider mainlobe than the rectangular window, but more
attenuated sidelobes.
C. Hanning window
The Hanning window(or more properly, the von Hann window) is nothing more than
a raised cosine:

The Hanning window has the same mainlobe width as the Bartlett window, but its
sidelobes are attenuated further.

D. Hamming window
Hamming observed that the sidelobes of the rectangular and Hanning windows are
phase reversed relative to each other, so a linear combination of the two would tend to
cause them to cancel each other.

Hamming window is given as

E. Blackman window

The Hann and Hamming have a constant and a cosine term; the Blackman window
adds a cosine at twice the frequency
Fig: Classic window function

Program 1a: Design a FIR Lowpass Filter using Rectangular, Hann and
Hamming window

CODE:
%LOWPASS
clc;
close all;
N=7;
Wc=0.4;
%N=input('Enter the value of N=');
%Wc=input('Enter the value of Wc=');
window1=boxcar(N);
window2=hann(N);
window3=hamming(N);

%Rectangular window
b1=fir1(N-1,Wc,window1);
disp('(Rectangular Window)H1(Z)=')
disp(b1)
[H1,W1]=freqz(b1,1);
figure
subplot(2,1,1)
plot(W1/pi, 20*log(abs(H1)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-RECTANGULAR WINDOW')
grid on
subplot(2,1,2)
plot (W1/pi, angle(H1));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')

%Hanning window
b2=fir1(N-1,Wc,window2);
disp('(Hanning Window)H2(Z)=')
disp(b2)
[H2,W2]=freqz(b2,1);
figure
subplot(2,1,1)
plot(W2/pi, 20*log(abs(H2)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-HANNING WINDOW')
grid on
subplot(2,1,2)
plot(W2/pi, angle(H2));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')

%Hamming window
b3=fir1(N-1,Wc,window3);
disp('(Hamming Window)H3(Z)=')
disp(b3)
[H3,W3]=freqz(b3,1);
figure
subplot(2,1,1)
plot(W3/pi, 20*log(abs(H3)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-HAMMING WINDOW')
grid on
subplot(2,1,2)
plot(W3/pi, angle(H3));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')

INPUT
Enter the value of N=7

Enter the value of wc=0.4

OUTPUT
(Rectangular Window)H1(Z)=
-0.0584 0.0876 0.2835 0.3746 0.2835 0.0876 -0.0584

(Hanning Window)H2(Z)=
0 0.0260 0.2520 0.4440 0.2520 0.0260 0
(Hamming Window)H3(Z)=
-0.0055 0.0317 0.2550 0.4375 0.2550 0.0317 -0.0055

Program 1b: Design a FIR Highpass Filter using Rectangular, Hann and
Hamming window

clc;
close all;
%N=input('Enter the value of N=');
%Wc=input('Enter the value of Wc=');
window1=boxcar(N);
window2=hann(N);
window3=hamming(N);
%Rectangular window
b1=fir1(N-1,Wc,'high',window1);
disp('(Rectangular Window)H1(Z)=')
disp(b1)
[H1,W1]=freqz(b1,1);
figure
subplot(2,1,1)
plot(W1/pi, 20*log(abs(H1)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-RECTANGULAR WINDOW')
grid on
subplot(2,1,2)
plot(W1/pi, angle(H1));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')
%Hanning window
b2=fir1(N-1,Wc,'high',window2);
disp('(Hanning Window)H2(Z)=')
disp(b2)
[H2,W2]=freqz(b2,1);
figure
subplot(2,1,1)
plot(W2/pi, 20*log(abs(H2)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-HANNING WINDOW')
grid on
subplot(2,1,2)
plot(W2/pi, angle(H2));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')
%Hamming window
b3=fir1(N-1,Wc,'high',window3);
disp('(Hamming Window)H3(Z)=')
disp(b3)
[H3,W3]=freqz(b3,1);
figure
subplot(2,1,1)
plot(W3/pi, 20*log(abs(H3)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-HAMMING WINDOW')
grid on
subplot(2,1,2)
plot(W3/pi, angle(H3));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')

INPUT
Enter the value of N=7

Enter the value of wc=0.4

OUTPUT
(Rectangular Window)H1(Z)=
0.0698 -0.1047 -0.3388 0.6714 -0.3388 -0.1047 0.0698

(Hanning Window)H2(Z)=
0 -0.0232 -0.2254 0.5956 -0.2254 -0.0232 0

(Hamming Window)H3(Z)=
0.0050 -0.0291 -0.2335 0.6011 -0.2335 -0.0291 0.0050
2. FIR Bandpass and Bandstop Filter

Aim: Design and simulate FIR Bandpass filter & FIR Bandstop filter using
windowing function (Hamming, Hann, Barlett etc)

Theory: An FIR filter is one that is described by the difference equation

and by the transfer function

The window design method does not produce filters that are optimal (in the sense of meeting
the design specifications in the most computationally-efficient fashion), but the method is
easy to understand and does produce filters that are reasonably good. Of all the hand-design
methods, the window method is the most popular and effective. In brief, in the window
method we develop a causal linear-phase FIR filter by multipying an ideal filter that has an
infinite-duration impulse response (IIR) by a finite-duration window function:

where is the practical FIR filter, is the ideal IIR prototype filter, and is the finite-duration
window function.

Ideal filters
Ideal filters have a response that is constant in the passbands and zero in the stopbands, along
with linear phase. As a reference, the transfer functions and corresponding impulse responses
ideal filters are as follows:
Bandpass Filter
2a AIM: TO DESIGN AND SIMULATE BANDPASS AND
BANDREJECT/BANDSTOP.

CODE:
%BANDPASS
clc;
close all;
N=7;
Wl=0.2;
Wh=0.8;
Wc=[Wl Wh];
window1=boxcar(N);
window2=hann(N);
window3=hamming(N);
%Rectangular window
b1=fir1(N-1,Wc,'bandpass',window1);
disp('(Rectangular Window)H1(Z)=')
disp(b1)
[H1,W1]=freqz(b1,1);
figure
subplot(2,1,1)
plot(W1/pi, 20*log(abs(H1)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-RECTANGULAR WINDOW')
grid on
subplot(2,1,2)
plot(W1/pi, angle(H1));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')
%Hanning window
b2=fir1(N-1,Wc,'bandpass',window2);
disp('(Hanning Window)H2(Z)=')
disp(b2)
[H2,W2]=freqz(b2,1);
figure
subplot(2,1,1)
plot(W2/pi, 20*log(abs(H2)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-HANNING WINDOW')
grid on
subplot(2,1,2)
plot(W2/pi, angle(H2));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')
%Hamming window
b3=fir1(N-1,Wc,'bandpass',window3);
disp('(Hamming Window)H3(Z)=')
disp(b3)
[H3,W3]=freqz(b3,1);
figure
subplot(2,1,1)
plot(W3/pi, 20*log(abs(H3)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-HAMMING WINDOW')
grid on
subplot(2,1,2)
plot(W3/pi, angle(H3));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')

INPUT:
Enter the value of N=
7
Enter ther value of wl=
0.2
Enter ther value of wh=
0.8

OUTPUT:
(Rectangular Window)H1(Z)=
0.0000 -0.2511 0.0000 0.4977 0.0000 -0.2511 0.0000

(Hanning Window)H2(Z)=
0 -0.1007 0.0000 0.7985 0.0000 -0.1007 0

(Hamming Window)H3(Z)=
0.0000 -0.1191 0.0000 0.7617 0.0000 -0.1191 0.0000
2b AIM: TO DESIGN AND SIMULATE BANDPASS AND
BANDREJECT/BANDSTOP.
clc;
close all;
N=7;
Wl=0.3;
Wh=0.66;
Wc=[Wl Wh];
window1=rectwin(N);
window2=hann(N);
window3=hamming(N);
%Rectangular window
b1=fir1(N-1,Wc,'stop',window1);
disp('(Rectangular Window)H1(Z)=')
disp(b1)
[H1,W1]=freqz(b1,1);
figure
subplot(2,1,1)
plot(W1/pi, 20*log(abs(H1)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-RECTANGULAR WINDOW')
grid on
subplot(2,1,2)
plot(W1/pi, angle(H1));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')
%Hanning window
b2=fir1(N-1,Wc,'stop',window2);
disp('(Hanning Window)H2(Z)=')
disp(b2)
[H2,W2]=freqz(b2,1);
figure
subplot(2,1,1)
plot(W2/pi, 20*log(abs(H2)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-HANNING WINDOW')
grid on
subplot(2,1,2)
plot(W2/pi, angle(H2));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')
%Hamming window
b3=fir1(N-1,Wc,'stop',window3);
disp('(Hamming Window)H3(Z)=')
disp(b3)
[H3,W3]=freqz(b3,1);
figure
subplot(2,1,1)
plot(W3/pi, 20*log(abs(H3)));
xlabel('nF')
ylabel('Magnitude(dB)')
title('MAGNITUDE RESPONSE-HAMMING WINDOW')
grid on
subplot(2,1,2)
plot(W3/pi, angle(H3));
xlabel('nF')
ylabel('Angle')
grid on
title('PHASE RESPONSE')

INPUT:

Enter the value of N=7


Enter the value of wl=0.3

Enter the value of wh=0.66

OUTPUT:

(Rectangular Window)H1(Z)=
0.0316 0.2290 -0.0172 0.5130 -0.0172 0.2290 0.0316

(Hanning Window)H2(Z)=
0 0.0952 -0.0214 0.8525 -0.0214 0.0952 0

(Hamming Window)H3(Z)=
0.0040 0.1121 -0.0209 0.8096 -0.0209 0.1121 0.0040
RV COLLEGE OF ENGINEERING®, Bengaluru-59
(Autonomous Institution affiliated to VTU, Belagavi)
Department of Electronics and Telecommunication Engineering
M.Tech in DIGITAL COMMUNICATION ENGINEERING
Advanced Signal Processing (22MDC13TL) (SEM-I)
(2022-2023)

Scheme of Continuous Internal Evaluation (CIE): 10 + 30 + 30 + 30 = 100


QUIZZES: Quizzes will be conducted in online/offline mode. Two quizzes will be
conducted & Each Quiz will be evaluated for 10 Marks. The average of two quizzes
will be the Final Quiz marks.
TESTS: Students will be evaluated in test, descriptive questions with different
complexity levels (Revised Bloom’s Taxonomy Levels: Remembering,
Understanding, Applying, Analyzing, Evaluating, and Creating). Two tests will be
conducted. Each test will be evaluated for 50 Marks, adding upto 100 Marks. Final
test marks will be reduced to 30 Marks.
EXPERIENTIAL LEARNING: Students will be evaluated for their creativity and
practical implementation of the problem. Case study-based teaching learning and
Program specific requirements (10), Video based seminar /presentation
/demonstration (20) adding upto 30 marks
Laboratory: Conduction of laboratory exercises, Lab report & observation &
analysis (30 Marks), Lab Test (10 Marks) & Innovative Experiment/Concept Design
& Implementation (10 Marks) adding up to 50 Marks. The final marks will be
reduced to 30 Marks. NO SEE for lab
Scheme of Semester End Examination (SEE) for 100 marks: Each unit consists of
TWO Questions of 16 Marks each. Answer FIVE full questions selecting one from
each unit (from 1 to 5). Question No. 11 is compulsory (Laboratory component) for
20 Marks.
RV COLLEGE OF ENGINEERING®, Bengaluru-59
(Autonomous Institution affiliated to VTU, Belagavi)
Department of Electronics and Telecommunication Engineering
M.Tech in DIGITAL COMMUNICATION ENGINEERING
Advanced Signal Processing (22MDC13TL) (SEM-I)
(2022-2023)
Innovative Experiment
Sl
No. RVCE No. Name Topic
1 RVCE22MDC001 Suchetha G SGPA Calculator
Image edge detection using canny edge
2 RVCE22MDC002 Yashwanth R algorithm
3 RVCE22MDC003 Sukruth Gowda KP Extract text from Video using python
4 RVCE22MDC004 Shyampradeep K Audio Compression
Amith Rajendra Explaining Error detection and error
5 RVCE22MDC005 Telgar correction using python
6 RVCE22MDC006 Muskan Siddiqa I Signal denoising using wavelet transform
7 RVCE22MDC007 Sri HariPriya Rai N Generating QR code for wifi using python
8 RVCE22MDC008 Supritha N Object detection using open cv library
9 RVCE22MDC009 Anagha B R Generation and analysis of Chrip signal
Human Activity Recognition Using Signal
10 RVCE22MDC010 Prajwal K T Feature Extraction
vehicular Number plate detection using
11 RVCE22MDC011 Harshitha LN image processing
12 RVCE22MDC012 M santhosh Kumar Image processing
RUBRIC for Lab Programs

Sl. Experiments Marks


No. Excellent Good Average Poor

1. Conduction of Student is highly Student is Student is less Student is least


laboratory motivated to motivated to motivated to motivated and
exercises, Lab understand the understand the understand the does not
report & basics , basics , basics , demonstrate demonstrate
observation & demonstrates demonstrates with less clarity and accurately and
analysis accurately and adequately the professionally the professionally the
30
professionally the concepts and concepts, Average concepts, and
concepts, excellent professionally the report writing professionally the
report writing concepts, good concepts,
report writing completes report
writing

(28-30) (25-28) (20-25) (15-20)

2. Lab test Student is least


Student is highly Student is Student is less motivated to
Conduction, motivated to motivated to motivated to conduct conduct the
Results, conduct the conduct the the experiment, experiment,
Inference, experiment, experiment, Interpret the findings Interpret the
Viva Interpret the Interpret the and answers findings and
findings, and findings and properly in viva. answers average in
10 answers excellently answers properly viva.
in viva. in viva.

(10) (08-09) (06-08) (04-06)

4. Innovative Explains the Adequately Incomplete Unable to


Experiment concepts of the explains the explanation the communicate
experiment concepts of the concepts of the ideas of the
requirements. experiment & experiment & experiment &
10 Communicates all requirements requirements. shows requirements.
ideas clearly and shows the the execution shows the
shows the execution execution execution

(10) (08) (06) (04)

RV COLLEGE OF ENGINEERING®, Bengaluru-59


(Autonomous Institution affiliated to VTU, Belagavi)
Department of Electronics and Telecommunication Engineering
M.Tech in DIGITAL COMMUNICATION ENGINEERING
Advanced Signal Processing (22MDC13TL) (SEM-I)
(2022-2023)

You might also like