SlideShare a Scribd company logo
1 of 17
Download to read offline
Digital Signal
Processing
Lab report 09
Submitted By:
Syed Abuzar
Reg Number:
SP15-BEE-096
Submitted To:
Sir Usman
BEE-5A
Date: 12/06/2017
Filter Design and Gibb’s Phenomenon
Objective:
In today’s Lab we will use different versions of
sinc function to design Low-pass, High-pass,
Band-pass, and band-stop filters. We will also
analyze the effect of length of h[n] on frequency
response and understand Gibb’s phenomenon.
Procedure:
1. Open M-file or M-Book
2. Save it by any useful name but remember not to
start the name by any numeric digit, do not use
any special character other than under-the-score
( _ ) and also remember not to give any space in
the name.
Gibb’s phenomenon occurs near a jump
discontinuity in the signal. It says that no
matter how many terms you include in your Fourier
series there will always be an error in the form
of an overshoot near the discontinuity. The
overshoot always be about 9% of the size of the
jump.
Task I:
3. Generate a sinc function with a zero crossing
frequency of 100 Hz and simulated sampling
frequency of 2500 Hz keeping index n=-100:100.
4. Analyze the Fourier transform of the signal
from step one using code from Lab2.
5. Now change the length of index to n=-200:200
and later to n=-1000:1000. While changing the
length continuously observe the effect on
magnitude of fft.
6. You can also observe the wrapped and unwrapped
phase of the sinc function using angle and phase
command, respectively.
7. For calculating group delay take negative
derivative of the unwrapped phase, which shall be
approximate to 0.
 Matlab Code:
 Index =-100:100:

clc
close all
clear all
%Index
n=input('Index = ');
%Zero Crossing frequency
fc=input('Zero Crossing Frequency =');
%simulated frequency
fs=input('Simulated Frequency = ');
%size
N=input('Size in fourier transform = ');
%sinc function
h=sinc(2*fc/fs*n);
%plot the sinc function
subplot(221);
plot(n,h);
title('h_[n]');
grid on
ylabel 'Amplitude'
xlabel 'T(msec)'
%Omega Axis
w=linspace(-fs/2,fs/2,N);
%fourier transform
H=fftshift(fft(h,N));
%plot of Magnitude
subplot(222);
plot(w,abs(H));
title 'Magnitude of fourier transform'
ylabel 'Amplitude'
xlabel 'W rad/sec'
%plot Phase response
subplot(223);
plot(w,angle(H));
title 'Phase Response'
ylabel 'Amplitude'
xlabel 'w rad/sec'
%plot group delay
subplot(224);
plot(w(1:4999),-diff(phase(H)));
title 'Phase Response of group delay'
ylabel 'Amplitude'
xlabel 'w rad/sec'
Output:
 Index= -100:100:
o Input Command Window:
Simulated frequency and size of fourier
transform.
Index is taken as -100:100.
o Graph:
In the above output, we see that when the index
is -100:100 then the there is little jumps in the
sinc function fourier transform
 Index -1000:1000:
o Input Command Window:
o Graph:
In the above graph, index is given as -1000:1000
and then there is a more error in the distortion
nut there are ignore because more term are added
then the gibb’s phenomenon is understand.
 Index -200:200:
o Input Command Window:
o Graph:
In the above graph we clearly see that the jump
near the discontinuity is that when the more term
are accommodated in the fourier transform then
there will be error never the over shoot.
Task II:
8. Now multiply with the sinc function and
repeat step 4 to 7.
9. Now multiply (where fs/2 can be
mapped to π) with the sinc function and repeat
step 4 to 7.
10. Add signals from step 3 and 8, forming a new
impulse response and repeat step 4 to 7.
Multiply :
 Matlab Code:
clc
close all
clear all
%Index
n=input('Index = ');
%Zero Crossing frequency
fc=input('Zero Crossing Frequency =');
%simulated frequency
fs=input('Simulated Frequency = ');
%size
N=input('Size in fourier transform = ');
%sinc function
h=sinc(2*fc/fs*n).*exp(-1i*pi*n);
%plot the sinc function
subplot(221);
plot(n,h);
title('h[n]');
grid on
ylabel 'Amplitude'
xlabel 'T(msec)'
%Omega Axis
w=linspace(-fs/2,fs/2,N);
%fourier transform
H=fftshift(fft(h,N));
%plot of Magnitude
subplot(222);
plot(w,abs(H));
title 'Magnitude of fourier transform'
ylabel 'Amplitude'
xlabel 'W rad/sec'
%plot Phase response
subplot(223);
plot(w,angle(H));
title 'Phase Response'
ylabel 'Amplitude'
xlabel 'w rad/sec'
%plot group delay
subplot(224);
plot(w(1:4999),-diff(phase(H)));
title 'Phase Response of group delay'
ylabel 'Amplitude'
xlabel 'w rad/sec'
Output:
 Index =-100:100:
o Input Comand Window:
o Graph:
In the above graph, we take the index as -100:100
then the transform is shifted to the pi & it is
repeated on the pi and –pi.
 Index =-200:200:
o Graph:
In the above graph ,we take more term in as
increases the index mean by choosing -200:200 and
then repeated the sinc function transform along
pi and –pi .
 Index =-1000:1000:
o Graph:
In this graph, we take index -1000:1000 mean
more term are includes in it means that
exponential is shifting in the fourier transform
and more jums are occur and error are increasing.
Multiply Cos(2*pi/2*n):
 Matlab Code:
clc
close all
clear all
%Index
n=input('Index = ');
%Zero Crossing frequency
fc=input('Zero Crossing Frequency =');
%simulated frequency
fs=input('Simulated Frequency = ');
%size
N=input('Size in fourier transform = ');
%sinc function
h=sinc(2*fc/fs*n).*cos(2*(pi/2)*n);
%plot the sinc function
subplot(221);
plot(n,h);
title('h[n]');
grid on
ylabel 'Amplitude'
xlabel 'T(msec)'
%Omega Axis
w=linspace(-fs/2,fs/2,N);
%fourier transform
H=fftshift(fft(h,N));
%plot of Magnitude
subplot(222);
plot(w,abs(H));
title 'Magnitude of fourier transform'
ylabel 'Amplitude'
xlabel 'W rad/sec'
%plot Phase response
subplot(223);
plot(w,angle(H));
title 'Phase Response'
ylabel 'Amplitude'
xlabel 'w rad/sec'
%plot group delay
subplot(224);
plot(w(1:4999),-diff(phase(H)));
title 'Phase Response of group delay'
ylabel 'Amplitude'
xlabel 'w rad/sec'
Output:
 Graph:
o Index -100:100:
In the above graph, the fourier is similar to
that of the exponential shift and also the
distortion is increases.
 Index -200:200:
o Graph:
In the above graph, Gibb’s Phenomenon is tell
that when the term or the index number is
increases then the distortion is also increases.
 Index =-1000:1000:
o Graph:
In the above graph, when the index is increases
to -1000:1000 then distortion is also increases
mean the following filter will be the clearly
established.
Question and Answers:
Q.No.01:
If all above four versions of sinc act as impulse
response of a system describe a detail of all
four systems.
Answer:
In the given below the impulse response of the
four system are described as
System 1:
In the above system response we take index -
100:100 then there is less distortion and as the
number of index is increasing then the distortion
is also increasing.
System 2:
In the above system, cos is given multiply and
give the above system response
and also the distortion is kept lesser.
System 3:
According to the given above system gibbs
phenomenon tells us that distortion is increases
when the number of terms are increases mean the
index number is increases.
System 4:
In the above graph, it is clearly shown that when
the number of terms are increases when the index
number is increases.
Q.No.02:
If a shift of n0 is given in the sinc function
what will be the effect on group delay? Provide
justification of your answer with the help of
plots.
Answer:
In the above graph ,it is clearly observe that
when the exponential is multiply with that of the
sinc function is basically shifted the given
fourier transform to that of it repeatedly on the
pi to –pi.
Q.No.03:
What do you understand by Gibb’s phenomenon?
Answer:
The given group delay responses of the given
phase is given as
In the given above different types of the
magnitude responses is given that Gibb’s
Phenomenon means that when the number of term is
increases then the error is increases when the
jump of the distortion is producing the
discontinuity.
Conclusion:
In this lab,I learnt about the gibb’s phenomenon
and also means that increasing the number of
term is increasing the errors and also the jumps
discontinuity which increases the errors.

More Related Content

What's hot

Lag lead compensator design in frequency domain 7th lecture
Lag lead compensator design in frequency domain  7th lectureLag lead compensator design in frequency domain  7th lecture
Lag lead compensator design in frequency domain 7th lectureKhalaf Gaeid Alshammery
 
Introduction to Approximation Algorithms
Introduction to Approximation AlgorithmsIntroduction to Approximation Algorithms
Introduction to Approximation AlgorithmsJhoirene Clemente
 
BIometrics- plotting DET and EER curve using Matlab
BIometrics- plotting DET and EER curve using MatlabBIometrics- plotting DET and EER curve using Matlab
BIometrics- plotting DET and EER curve using MatlabShiv Koppad
 
Algorithms of graph
Algorithms of graphAlgorithms of graph
Algorithms of graphgetacew
 
CS106 Lab 9 - 1D array
CS106 Lab 9 - 1D arrayCS106 Lab 9 - 1D array
CS106 Lab 9 - 1D arrayNada Kamel
 
Tail Recursion in data structure
Tail Recursion in data structureTail Recursion in data structure
Tail Recursion in data structureRumman Ansari
 
Multicasting in Linear Deterministic Relay Network by Matrix Completion
Multicasting in Linear Deterministic Relay Network by Matrix CompletionMulticasting in Linear Deterministic Relay Network by Matrix Completion
Multicasting in Linear Deterministic Relay Network by Matrix CompletionTasuku Soma
 
Ee2365 nol part 2
Ee2365 nol part 2Ee2365 nol part 2
Ee2365 nol part 2Arun Kumaar
 
Symbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesSymbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesQuoc-Sang Phan
 

What's hot (20)

Bode plot
Bode plotBode plot
Bode plot
 
Lag lead compensator design in frequency domain 7th lecture
Lag lead compensator design in frequency domain  7th lectureLag lead compensator design in frequency domain  7th lecture
Lag lead compensator design in frequency domain 7th lecture
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
Chap8 new
Chap8 newChap8 new
Chap8 new
 
Bode Plot Notes Step by Step
Bode Plot Notes Step by StepBode Plot Notes Step by Step
Bode Plot Notes Step by Step
 
Vertex cover Problem
Vertex cover ProblemVertex cover Problem
Vertex cover Problem
 
Introduction to Approximation Algorithms
Introduction to Approximation AlgorithmsIntroduction to Approximation Algorithms
Introduction to Approximation Algorithms
 
Deadbeat Response Design _8th lecture
Deadbeat Response Design _8th lectureDeadbeat Response Design _8th lecture
Deadbeat Response Design _8th lecture
 
BIometrics- plotting DET and EER curve using Matlab
BIometrics- plotting DET and EER curve using MatlabBIometrics- plotting DET and EER curve using Matlab
BIometrics- plotting DET and EER curve using Matlab
 
Bode Plots
Bode Plots Bode Plots
Bode Plots
 
Algorithms of graph
Algorithms of graphAlgorithms of graph
Algorithms of graph
 
Bode plot
Bode plot Bode plot
Bode plot
 
CS106 Lab 9 - 1D array
CS106 Lab 9 - 1D arrayCS106 Lab 9 - 1D array
CS106 Lab 9 - 1D array
 
Tail Recursion in data structure
Tail Recursion in data structureTail Recursion in data structure
Tail Recursion in data structure
 
Multicasting in Linear Deterministic Relay Network by Matrix Completion
Multicasting in Linear Deterministic Relay Network by Matrix CompletionMulticasting in Linear Deterministic Relay Network by Matrix Completion
Multicasting in Linear Deterministic Relay Network by Matrix Completion
 
Ee2365 nol part 2
Ee2365 nol part 2Ee2365 nol part 2
Ee2365 nol part 2
 
Symbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo TheoriesSymbolic Execution as DPLL Modulo Theories
Symbolic Execution as DPLL Modulo Theories
 
A star
A starA star
A star
 
Lecture26
Lecture26Lecture26
Lecture26
 
Bode plot
Bode plotBode plot
Bode plot
 

Similar to Filter Designing

Ct2 2013 14
Ct2 2013 14Ct2 2013 14
Ct2 2013 14dana53
 
Matlab 3
Matlab 3Matlab 3
Matlab 3asguna
 
Decimation and Interpolation
Decimation and InterpolationDecimation and Interpolation
Decimation and InterpolationFernando Ojeda
 
Chapter 6 Balagurusamy Programming ANSI in c
Chapter 6  Balagurusamy Programming ANSI  in cChapter 6  Balagurusamy Programming ANSI  in c
Chapter 6 Balagurusamy Programming ANSI in cBUBT
 
Skiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reductionSkiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reductionzukun
 
BALLANDBEAM_GROUP7.pptx
BALLANDBEAM_GROUP7.pptxBALLANDBEAM_GROUP7.pptx
BALLANDBEAM_GROUP7.pptxOthmanBensaoud
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxSALU18
 
Frequency Response with MATLAB Examples.pdf
Frequency Response with MATLAB Examples.pdfFrequency Response with MATLAB Examples.pdf
Frequency Response with MATLAB Examples.pdfSunil Manjani
 
Recursion vs. Iteration: Code Efficiency & Structure
Recursion vs. Iteration: Code Efficiency & StructureRecursion vs. Iteration: Code Efficiency & Structure
Recursion vs. Iteration: Code Efficiency & Structurecogaxor346
 

Similar to Filter Designing (20)

Reconstruction
ReconstructionReconstruction
Reconstruction
 
Ct2 2013 14
Ct2 2013 14Ct2 2013 14
Ct2 2013 14
 
Matlab 3
Matlab 3Matlab 3
Matlab 3
 
Decimation and Interpolation
Decimation and InterpolationDecimation and Interpolation
Decimation and Interpolation
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 
Dsp manual
Dsp manualDsp manual
Dsp manual
 
Mlab i
Mlab iMlab i
Mlab i
 
Chapter 6 Balagurusamy Programming ANSI in c
Chapter 6  Balagurusamy Programming ANSI  in cChapter 6  Balagurusamy Programming ANSI  in c
Chapter 6 Balagurusamy Programming ANSI in c
 
Programming Exam Help
 Programming Exam Help Programming Exam Help
Programming Exam Help
 
Error analysis
Error analysisError analysis
Error analysis
 
ilovepdf_merged
ilovepdf_mergedilovepdf_merged
ilovepdf_merged
 
Signals and Systems Homework Help.pptx
Signals and Systems Homework Help.pptxSignals and Systems Homework Help.pptx
Signals and Systems Homework Help.pptx
 
Chapter 10-pid-1
Chapter 10-pid-1Chapter 10-pid-1
Chapter 10-pid-1
 
Skiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reductionSkiena algorithm 2007 lecture21 other reduction
Skiena algorithm 2007 lecture21 other reduction
 
Lead-lag controller
Lead-lag controllerLead-lag controller
Lead-lag controller
 
BALLANDBEAM_GROUP7.pptx
BALLANDBEAM_GROUP7.pptxBALLANDBEAM_GROUP7.pptx
BALLANDBEAM_GROUP7.pptx
 
Matlab Homework Help
Matlab Homework HelpMatlab Homework Help
Matlab Homework Help
 
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docxerror 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
error 2.pdf101316, 6(46 PM01_errorPage 1 of 5http.docx
 
Frequency Response with MATLAB Examples.pdf
Frequency Response with MATLAB Examples.pdfFrequency Response with MATLAB Examples.pdf
Frequency Response with MATLAB Examples.pdf
 
Recursion vs. Iteration: Code Efficiency & Structure
Recursion vs. Iteration: Code Efficiency & StructureRecursion vs. Iteration: Code Efficiency & Structure
Recursion vs. Iteration: Code Efficiency & Structure
 

More from COMSATS Abbottabad

Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemCOMSATS Abbottabad
 
coding and burning program in FPGA
coding and burning program in FPGAcoding and burning program in FPGA
coding and burning program in FPGACOMSATS Abbottabad
 
Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)COMSATS Abbottabad
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086COMSATS Abbottabad
 
implementation of data instrucions in emu8086
implementation of data instrucions in emu8086implementation of data instrucions in emu8086
implementation of data instrucions in emu8086COMSATS Abbottabad
 
Addition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageAddition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageCOMSATS Abbottabad
 
Mathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabMathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabCOMSATS Abbottabad
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABCOMSATS Abbottabad
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacingCOMSATS Abbottabad
 
Transformer Interfacing with Laptop
Transformer Interfacing with LaptopTransformer Interfacing with Laptop
Transformer Interfacing with LaptopCOMSATS Abbottabad
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By LedCOMSATS Abbottabad
 

More from COMSATS Abbottabad (20)

Kalman filter
Kalman filterKalman filter
Kalman filter
 
Enterpreneurship
EnterpreneurshipEnterpreneurship
Enterpreneurship
 
Sine wave inverter
Sine wave inverterSine wave inverter
Sine wave inverter
 
Light Tracking Solar Panel
Light Tracking Solar PanelLight Tracking Solar Panel
Light Tracking Solar Panel
 
Analysis of Electro-Mechanical System
Analysis of Electro-Mechanical SystemAnalysis of Electro-Mechanical System
Analysis of Electro-Mechanical System
 
coding and burning program in FPGA
coding and burning program in FPGAcoding and burning program in FPGA
coding and burning program in FPGA
 
8 bit full adder
8 bit full adder8 bit full adder
8 bit full adder
 
Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)Fabrication process of Integrated Circuit (IC's)
Fabrication process of Integrated Circuit (IC's)
 
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
IMPLEMENTING ARITHMETIC INSTRUCTIONS IN EMU 8086
 
implementation of data instrucions in emu8086
implementation of data instrucions in emu8086implementation of data instrucions in emu8086
implementation of data instrucions in emu8086
 
Addition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly languageAddition, subtraction and multiplication in assembly language
Addition, subtraction and multiplication in assembly language
 
Mathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in MatlabMathematical Modelling of Electro-Mechanical System in Matlab
Mathematical Modelling of Electro-Mechanical System in Matlab
 
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLABMathematical Modelling of Electrical/Mechanical modellinng in MATLAB
Mathematical Modelling of Electrical/Mechanical modellinng in MATLAB
 
Introduction to MATLAB
Introduction to MATLAB Introduction to MATLAB
Introduction to MATLAB
 
Encoder + decoder
Encoder + decoderEncoder + decoder
Encoder + decoder
 
Principles of Communication
Principles of CommunicationPrinciples of Communication
Principles of Communication
 
Aurduino coding for transformer interfacing
Aurduino coding for transformer interfacingAurduino coding for transformer interfacing
Aurduino coding for transformer interfacing
 
Transformer Interfacing with Laptop
Transformer Interfacing with LaptopTransformer Interfacing with Laptop
Transformer Interfacing with Laptop
 
Temperature control Switch and Display By Led
Temperature control Switch and Display By LedTemperature control Switch and Display By Led
Temperature control Switch and Display By Led
 
stress and strain
stress and strainstress and strain
stress and strain
 

Recently uploaded

UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...Call Girls in Nagpur High Profile
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 

Recently uploaded (20)

UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 

Filter Designing

  • 1. Digital Signal Processing Lab report 09 Submitted By: Syed Abuzar Reg Number: SP15-BEE-096 Submitted To: Sir Usman BEE-5A Date: 12/06/2017
  • 2. Filter Design and Gibb’s Phenomenon Objective: In today’s Lab we will use different versions of sinc function to design Low-pass, High-pass, Band-pass, and band-stop filters. We will also analyze the effect of length of h[n] on frequency response and understand Gibb’s phenomenon. Procedure: 1. Open M-file or M-Book 2. Save it by any useful name but remember not to start the name by any numeric digit, do not use any special character other than under-the-score ( _ ) and also remember not to give any space in the name. Gibb’s phenomenon occurs near a jump discontinuity in the signal. It says that no matter how many terms you include in your Fourier series there will always be an error in the form of an overshoot near the discontinuity. The overshoot always be about 9% of the size of the jump. Task I: 3. Generate a sinc function with a zero crossing frequency of 100 Hz and simulated sampling frequency of 2500 Hz keeping index n=-100:100. 4. Analyze the Fourier transform of the signal from step one using code from Lab2. 5. Now change the length of index to n=-200:200 and later to n=-1000:1000. While changing the length continuously observe the effect on magnitude of fft.
  • 3. 6. You can also observe the wrapped and unwrapped phase of the sinc function using angle and phase command, respectively. 7. For calculating group delay take negative derivative of the unwrapped phase, which shall be approximate to 0.  Matlab Code:  Index =-100:100:  clc close all clear all %Index n=input('Index = '); %Zero Crossing frequency fc=input('Zero Crossing Frequency ='); %simulated frequency fs=input('Simulated Frequency = '); %size N=input('Size in fourier transform = '); %sinc function h=sinc(2*fc/fs*n); %plot the sinc function subplot(221); plot(n,h); title('h_[n]'); grid on ylabel 'Amplitude' xlabel 'T(msec)' %Omega Axis w=linspace(-fs/2,fs/2,N); %fourier transform H=fftshift(fft(h,N)); %plot of Magnitude subplot(222); plot(w,abs(H)); title 'Magnitude of fourier transform' ylabel 'Amplitude' xlabel 'W rad/sec' %plot Phase response subplot(223); plot(w,angle(H));
  • 4. title 'Phase Response' ylabel 'Amplitude' xlabel 'w rad/sec' %plot group delay subplot(224); plot(w(1:4999),-diff(phase(H))); title 'Phase Response of group delay' ylabel 'Amplitude' xlabel 'w rad/sec' Output:  Index= -100:100: o Input Command Window: Simulated frequency and size of fourier transform. Index is taken as -100:100. o Graph:
  • 5. In the above output, we see that when the index is -100:100 then the there is little jumps in the sinc function fourier transform  Index -1000:1000: o Input Command Window: o Graph:
  • 6. In the above graph, index is given as -1000:1000 and then there is a more error in the distortion nut there are ignore because more term are added then the gibb’s phenomenon is understand.  Index -200:200: o Input Command Window: o Graph:
  • 7. In the above graph we clearly see that the jump near the discontinuity is that when the more term are accommodated in the fourier transform then there will be error never the over shoot. Task II: 8. Now multiply with the sinc function and repeat step 4 to 7. 9. Now multiply (where fs/2 can be mapped to π) with the sinc function and repeat step 4 to 7. 10. Add signals from step 3 and 8, forming a new impulse response and repeat step 4 to 7. Multiply :  Matlab Code: clc close all clear all %Index n=input('Index = '); %Zero Crossing frequency fc=input('Zero Crossing Frequency =');
  • 8. %simulated frequency fs=input('Simulated Frequency = '); %size N=input('Size in fourier transform = '); %sinc function h=sinc(2*fc/fs*n).*exp(-1i*pi*n); %plot the sinc function subplot(221); plot(n,h); title('h[n]'); grid on ylabel 'Amplitude' xlabel 'T(msec)' %Omega Axis w=linspace(-fs/2,fs/2,N); %fourier transform H=fftshift(fft(h,N)); %plot of Magnitude subplot(222); plot(w,abs(H)); title 'Magnitude of fourier transform' ylabel 'Amplitude' xlabel 'W rad/sec' %plot Phase response subplot(223); plot(w,angle(H)); title 'Phase Response' ylabel 'Amplitude' xlabel 'w rad/sec' %plot group delay subplot(224); plot(w(1:4999),-diff(phase(H))); title 'Phase Response of group delay' ylabel 'Amplitude' xlabel 'w rad/sec' Output:  Index =-100:100: o Input Comand Window:
  • 9. o Graph: In the above graph, we take the index as -100:100 then the transform is shifted to the pi & it is repeated on the pi and –pi.  Index =-200:200: o Graph:
  • 10. In the above graph ,we take more term in as increases the index mean by choosing -200:200 and then repeated the sinc function transform along pi and –pi .  Index =-1000:1000: o Graph: In this graph, we take index -1000:1000 mean more term are includes in it means that
  • 11. exponential is shifting in the fourier transform and more jums are occur and error are increasing. Multiply Cos(2*pi/2*n):  Matlab Code: clc close all clear all %Index n=input('Index = '); %Zero Crossing frequency fc=input('Zero Crossing Frequency ='); %simulated frequency fs=input('Simulated Frequency = '); %size N=input('Size in fourier transform = '); %sinc function h=sinc(2*fc/fs*n).*cos(2*(pi/2)*n); %plot the sinc function subplot(221); plot(n,h); title('h[n]'); grid on ylabel 'Amplitude' xlabel 'T(msec)' %Omega Axis w=linspace(-fs/2,fs/2,N); %fourier transform H=fftshift(fft(h,N)); %plot of Magnitude subplot(222); plot(w,abs(H)); title 'Magnitude of fourier transform' ylabel 'Amplitude' xlabel 'W rad/sec' %plot Phase response subplot(223); plot(w,angle(H)); title 'Phase Response' ylabel 'Amplitude' xlabel 'w rad/sec' %plot group delay subplot(224); plot(w(1:4999),-diff(phase(H))); title 'Phase Response of group delay' ylabel 'Amplitude' xlabel 'w rad/sec'
  • 12. Output:  Graph: o Index -100:100: In the above graph, the fourier is similar to that of the exponential shift and also the distortion is increases.  Index -200:200: o Graph:
  • 13. In the above graph, Gibb’s Phenomenon is tell that when the term or the index number is increases then the distortion is also increases.  Index =-1000:1000: o Graph: In the above graph, when the index is increases to -1000:1000 then distortion is also increases mean the following filter will be the clearly established.
  • 14. Question and Answers: Q.No.01: If all above four versions of sinc act as impulse response of a system describe a detail of all four systems. Answer: In the given below the impulse response of the four system are described as System 1: In the above system response we take index - 100:100 then there is less distortion and as the number of index is increasing then the distortion is also increasing. System 2:
  • 15. In the above system, cos is given multiply and give the above system response and also the distortion is kept lesser. System 3: According to the given above system gibbs phenomenon tells us that distortion is increases when the number of terms are increases mean the index number is increases. System 4:
  • 16. In the above graph, it is clearly shown that when the number of terms are increases when the index number is increases. Q.No.02: If a shift of n0 is given in the sinc function what will be the effect on group delay? Provide justification of your answer with the help of plots. Answer: In the above graph ,it is clearly observe that when the exponential is multiply with that of the sinc function is basically shifted the given fourier transform to that of it repeatedly on the pi to –pi. Q.No.03: What do you understand by Gibb’s phenomenon? Answer: The given group delay responses of the given phase is given as
  • 17. In the given above different types of the magnitude responses is given that Gibb’s Phenomenon means that when the number of term is increases then the error is increases when the jump of the distortion is producing the discontinuity. Conclusion: In this lab,I learnt about the gibb’s phenomenon and also means that increasing the number of term is increasing the errors and also the jumps discontinuity which increases the errors.