SlideShare a Scribd company logo
1 of 6
Download to read offline
ECE324: DIGITAL SIGNAL PROCESSING LABORATORY
Practical No.: 6
Roll No.:B-54 Registration No.: 11205816 Name: Shyamveer Singh
Aim: Design a FIR filter
1. Low pass filter
Mathematical Expressions Required:
Wc = 2π(fc / fs)
Hd(w) =
Inputs :
wc=pi/2
m=7
Program Code:
function[]=lpfshyam(wc,N)
i=(N-1)/2;
wn=wc/pi;
syms w
for n=-i:i
y(n+i+1)=(int(exp(w*n*j),-wc,wc))*1/(2*pi);
end
y=sym2poly(y)
for n=0:N-1
w(n+1)=0.54-0.46*cos(2*pi*n/(N-1));
h(n+1)=y(n+1).*w(n+1);
end
h=sym2poly(h)
fir1(N-1,wn)
end
Aim: Design a FIR filter
1. Low pass filter
Output:
>> lpfshyam((pi/2),7)
y =
-0.1061 0 0.3183 0.5000 0.3183 0 -0.1061
h =
-0.0085 0 0.2451 0.5000 0.2451 0 -0.0085
ans =
-0.0087 0.0000 0.2518 0.5138 0.2518 0.0000 -0.0087
Analysis/ Learning outcomes
This experiment give me a better understanding of low pass filter and
helps me to understand its working graphically.
Aim: Design a FIR filter
2. High pass filter
Mathematical Expressions Required:
Wc = 2π(fc / fs)
Hd(w) =
Inputs:
Wc=pi/2
m=7
Program Codes:
function[]=hpfshyam(wc,N)
i=(N-1)/2;
wn=wc/pi;
syms w
for n=-i:i
y(n+i+1)=(1/2*pi)*(int(exp(j*w*n),-pi,-wc)+int(exp(j*w*n),wc,pi));
end
y=sym2poly(y)
for n=0:N-1
w(n+1)=0.54-0.46*cos(2*pi*n/(N-1));
h(n+1)=y(n+1).*w(n+1);
end
h=sym2poly(h)
fir1(N-1,wn)
end
Output:
>> hpfshyam((pi/2),7)
y =
1.0472 0 -3.1416 4.9348 -3.1416 0 1.0472
h =
0.0838 0 -2.4190 4.9348 -2.4190 0 0.0838
ans =
-0.0087 0.0000 0.2518 0.5138 0.2518 0.0000 -0.0087
Aim: Design a FIR filter
3. Band pass filter
Mathematical Expressions Required:
Wc = 2π(fc / fs)
Hd(w) =
Inputs:
Wc1=pi/4 ,wc2=pi/6
m=7
Program Codes:
function[]=bpfshyam(wc1,wc2,N)
i=(N-1)/2;
wn1=wc1/pi;
wn2=wc2/pi;
syms w
for n=-i:i
y(n+i+1)=(1/2*pi)*(int(exp(j*w*n),-wc2,-wc1)+int(exp(j*w*n),wc1,wc2));
end
y=sym2poly(y)
for n=0:N-1
w(n+1)=0.54-0.46*cos(2*pi*n/(N-1));
h(n+1)=y(n+1).*w(n+1);
end
h=sym2poly(h)
fir1(N-1,wn1)
end
Analysis/ Learning outcomes
This experiment give me a better understanding of High pass filter and
helps me to understand its working graphically
Outputs/ Graphs/ Plots:
>> bpfshyam((pi/4),(pi/6),7)
y =
0.3067 -0.2104 -0.6506 -0.8225 -0.6506 -0.2104 0.3067
h =
0.0245 -0.0652 -0.5010 -0.8225 -0.5010 -0.0652 0.0245
Aim: Design a FIR filter
4. Band stop filter
Mathematical Expressions Required:
Wc = 2π(fc / fs)
Hd(w) =
Inputs:
Wc1=pi/4 , wc2=pi/6
m=7
Analysis/ Learning outcomes
This experiment give me a better understanding of band pass filter and
helps me to understand its working graphically
Program Codes:
function[]=bsfshyam(wc1,wc2,N)
i=(N-1)/2;
wn1=wc1/pi;
wn2=wc2/pi;
syms w
for n=-i:i
y(n+i+1)=(1/2*pi)*(int(exp(j*w*n),-pi,-wc2)+int(exp(j*w*n),-
wc1,wc1)+int(exp(j*w*n),wc2,pi));
end
y=sym2poly(y)
for n=0:N-1
w(n+1)=0.54-0.46*cos(2*pi*n/(N-1));
h(n+1)=y(n+1).*w(n+1);
end
h=sym2poly(h)
fir1(N-1,wn1)
end
Outputs/ Graphs/ Plots:
>> bsfshyam(pi/4,pi/6,7)
y =
-0.3067 0.2104 0.6506 10.6921 0.6506 0.2104 -0.3067
h =
-0.0245 0.0652 0.5010 10.6921 0.5010 0.0652 -0.0245
Analysis/ Learning outcomes
This experiment give me a better understanding of band stop filter and
helps me to understand its working graphically

More Related Content

What's hot

Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequencySARITHA REDDY
 
Performance Analysis (BER vs Eb/N0) of BPSK,QPSK, DPSK and M-PSK
Performance Analysis (BER vs Eb/N0) of BPSK,QPSK, DPSK and M-PSKPerformance Analysis (BER vs Eb/N0) of BPSK,QPSK, DPSK and M-PSK
Performance Analysis (BER vs Eb/N0) of BPSK,QPSK, DPSK and M-PSKIlyas Majeed
 
IIR filter realization using direct form I & II
IIR filter realization using direct form I & IIIIR filter realization using direct form I & II
IIR filter realization using direct form I & IISarang Joshi
 
SAMPLING & RECONSTRUCTION OF DISCRETE TIME SIGNAL
SAMPLING & RECONSTRUCTION  OF DISCRETE TIME SIGNALSAMPLING & RECONSTRUCTION  OF DISCRETE TIME SIGNAL
SAMPLING & RECONSTRUCTION OF DISCRETE TIME SIGNALkaran sati
 
Properties of fourier transform
Properties of fourier transformProperties of fourier transform
Properties of fourier transformNisarg Amin
 
Amplitude modulation
Amplitude modulationAmplitude modulation
Amplitude modulationavocado1111
 
Sequential multiplication
Sequential multiplicationSequential multiplication
Sequential multiplicationTaqwa It Center
 
Fm transmitter and receivers
Fm transmitter and receiversFm transmitter and receivers
Fm transmitter and receiversYogesh Bhargawa
 
FIR Filter Design.pptx
FIR Filter Design.pptxFIR Filter Design.pptx
FIR Filter Design.pptxCShiva
 
Simulation power analysis low power vlsi
Simulation power analysis   low power vlsiSimulation power analysis   low power vlsi
Simulation power analysis low power vlsiGargiKhanna1
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller Gaurav Verma
 
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time SignalsDSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time SignalsAmr E. Mohamed
 

What's hot (20)

Class b amplifier
Class b amplifierClass b amplifier
Class b amplifier
 
Decimation in time and frequency
Decimation in time and frequencyDecimation in time and frequency
Decimation in time and frequency
 
Performance Analysis (BER vs Eb/N0) of BPSK,QPSK, DPSK and M-PSK
Performance Analysis (BER vs Eb/N0) of BPSK,QPSK, DPSK and M-PSKPerformance Analysis (BER vs Eb/N0) of BPSK,QPSK, DPSK and M-PSK
Performance Analysis (BER vs Eb/N0) of BPSK,QPSK, DPSK and M-PSK
 
Fir filter_utkarsh_kulshrestha
Fir filter_utkarsh_kulshresthaFir filter_utkarsh_kulshrestha
Fir filter_utkarsh_kulshrestha
 
IIR filter realization using direct form I & II
IIR filter realization using direct form I & IIIIR filter realization using direct form I & II
IIR filter realization using direct form I & II
 
Fft
FftFft
Fft
 
SAMPLING & RECONSTRUCTION OF DISCRETE TIME SIGNAL
SAMPLING & RECONSTRUCTION  OF DISCRETE TIME SIGNALSAMPLING & RECONSTRUCTION  OF DISCRETE TIME SIGNAL
SAMPLING & RECONSTRUCTION OF DISCRETE TIME SIGNAL
 
Properties of fourier transform
Properties of fourier transformProperties of fourier transform
Properties of fourier transform
 
Amplitude modulation
Amplitude modulationAmplitude modulation
Amplitude modulation
 
Digital communication unit II
Digital communication unit IIDigital communication unit II
Digital communication unit II
 
quantization
quantizationquantization
quantization
 
Sequential multiplication
Sequential multiplicationSequential multiplication
Sequential multiplication
 
Fm transmitter and receivers
Fm transmitter and receiversFm transmitter and receivers
Fm transmitter and receivers
 
ADC & DAC
ADC & DACADC & DAC
ADC & DAC
 
Windowing ofdm
Windowing ofdmWindowing ofdm
Windowing ofdm
 
FIR Filter Design.pptx
FIR Filter Design.pptxFIR Filter Design.pptx
FIR Filter Design.pptx
 
Simulation power analysis low power vlsi
Simulation power analysis   low power vlsiSimulation power analysis   low power vlsi
Simulation power analysis low power vlsi
 
8051 microcontroller
8051 microcontroller 8051 microcontroller
8051 microcontroller
 
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time SignalsDSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
DSP_2018_FOEHU - Lec 02 - Sampling of Continuous Time Signals
 
Dif fft
Dif fftDif fft
Dif fft
 

Similar to MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF

Matlab fair-record-model
Matlab fair-record-modelMatlab fair-record-model
Matlab fair-record-modelajaydev1111
 
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-ToolA Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-ToolMCI
 
Digital image processing using matlab: filters (detail)
Digital image processing using matlab: filters (detail)Digital image processing using matlab: filters (detail)
Digital image processing using matlab: filters (detail)thanh nguyen
 
Forward & Backward Differenece Table
Forward & Backward Differenece TableForward & Backward Differenece Table
Forward & Backward Differenece TableSaloni Singhal
 

Similar to MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF (6)

DFT and IDFT Matlab Code
DFT and IDFT Matlab CodeDFT and IDFT Matlab Code
DFT and IDFT Matlab Code
 
Matlab fair-record-model
Matlab fair-record-modelMatlab fair-record-model
Matlab fair-record-model
 
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-ToolA Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
A Simulation Training for Sigma-Delta Modulators by Matlab CAD-Tool
 
Digital image processing using matlab: filters (detail)
Digital image processing using matlab: filters (detail)Digital image processing using matlab: filters (detail)
Digital image processing using matlab: filters (detail)
 
C questions
C questionsC questions
C questions
 
Forward & Backward Differenece Table
Forward & Backward Differenece TableForward & Backward Differenece Table
Forward & Backward Differenece Table
 

More from Bharti Airtel Ltd.

C bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationC bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationBharti Airtel Ltd.
 
Mcq4 ac-operational-amplifiers
Mcq4 ac-operational-amplifiersMcq4 ac-operational-amplifiers
Mcq4 ac-operational-amplifiersBharti Airtel Ltd.
 
C bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationC bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationBharti Airtel Ltd.
 
A bjt-operating-modes-configurations
A bjt-operating-modes-configurationsA bjt-operating-modes-configurations
A bjt-operating-modes-configurationsBharti Airtel Ltd.
 
Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Bharti Airtel Ltd.
 
Sequence detector Verilog Code
Sequence detector Verilog CodeSequence detector Verilog Code
Sequence detector Verilog CodeBharti Airtel Ltd.
 
To designing counters using verilog code
To designing counters using verilog codeTo designing counters using verilog code
To designing counters using verilog codeBharti Airtel Ltd.
 
Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer Bharti Airtel Ltd.
 

More from Bharti Airtel Ltd. (20)

Resume Shyamveer
Resume ShyamveerResume Shyamveer
Resume Shyamveer
 
BHEL Final Report
BHEL Final ReportBHEL Final Report
BHEL Final Report
 
BHEL PPT
BHEL PPTBHEL PPT
BHEL PPT
 
Amplitude modulated-systmes
Amplitude modulated-systmesAmplitude modulated-systmes
Amplitude modulated-systmes
 
Amplitude modulated-systems
Amplitude modulated-systemsAmplitude modulated-systems
Amplitude modulated-systems
 
Mcq5 ac-fet-amplifiers
Mcq5 ac-fet-amplifiersMcq5 ac-fet-amplifiers
Mcq5 ac-fet-amplifiers
 
Mcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifierMcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifier
 
C bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationC bjt-biasing-and-stabilization
C bjt-biasing-and-stabilization
 
Mcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifierMcq6 ac-mosfet-amplifier
Mcq6 ac-mosfet-amplifier
 
Mcq4 ac-operational-amplifiers
Mcq4 ac-operational-amplifiersMcq4 ac-operational-amplifiers
Mcq4 ac-operational-amplifiers
 
Logic gates-notesdc-iii
Logic gates-notesdc-iiiLogic gates-notesdc-iii
Logic gates-notesdc-iii
 
C bjt-biasing-and-stabilization
C bjt-biasing-and-stabilizationC bjt-biasing-and-stabilization
C bjt-biasing-and-stabilization
 
B bjt-characteristics
B bjt-characteristicsB bjt-characteristics
B bjt-characteristics
 
A bjt-operating-modes-configurations
A bjt-operating-modes-configurationsA bjt-operating-modes-configurations
A bjt-operating-modes-configurations
 
Resume shyam final
Resume shyam finalResume shyam final
Resume shyam final
 
Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis Noise detection from the signal matlab code, Signal Diagnosis
Noise detection from the signal matlab code, Signal Diagnosis
 
Sequence detector Verilog Code
Sequence detector Verilog CodeSequence detector Verilog Code
Sequence detector Verilog Code
 
Divine inspiration
Divine inspirationDivine inspiration
Divine inspiration
 
To designing counters using verilog code
To designing counters using verilog codeTo designing counters using verilog code
To designing counters using verilog code
 
Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer Verilog VHDL code Multiplexer and De Multiplexer
Verilog VHDL code Multiplexer and De Multiplexer
 

Recently uploaded

(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
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park 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
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
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
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

(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...
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
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
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park 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
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
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
 
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 

MATLAB CODE OF FIR Filter Designing LPF HPF BPF BSF

  • 1. ECE324: DIGITAL SIGNAL PROCESSING LABORATORY Practical No.: 6 Roll No.:B-54 Registration No.: 11205816 Name: Shyamveer Singh Aim: Design a FIR filter 1. Low pass filter Mathematical Expressions Required: Wc = 2π(fc / fs) Hd(w) = Inputs : wc=pi/2 m=7 Program Code: function[]=lpfshyam(wc,N) i=(N-1)/2; wn=wc/pi; syms w for n=-i:i y(n+i+1)=(int(exp(w*n*j),-wc,wc))*1/(2*pi); end y=sym2poly(y) for n=0:N-1 w(n+1)=0.54-0.46*cos(2*pi*n/(N-1)); h(n+1)=y(n+1).*w(n+1); end h=sym2poly(h) fir1(N-1,wn) end
  • 2. Aim: Design a FIR filter 1. Low pass filter Output: >> lpfshyam((pi/2),7) y = -0.1061 0 0.3183 0.5000 0.3183 0 -0.1061 h = -0.0085 0 0.2451 0.5000 0.2451 0 -0.0085 ans = -0.0087 0.0000 0.2518 0.5138 0.2518 0.0000 -0.0087 Analysis/ Learning outcomes This experiment give me a better understanding of low pass filter and helps me to understand its working graphically. Aim: Design a FIR filter 2. High pass filter Mathematical Expressions Required: Wc = 2π(fc / fs) Hd(w) =
  • 3. Inputs: Wc=pi/2 m=7 Program Codes: function[]=hpfshyam(wc,N) i=(N-1)/2; wn=wc/pi; syms w for n=-i:i y(n+i+1)=(1/2*pi)*(int(exp(j*w*n),-pi,-wc)+int(exp(j*w*n),wc,pi)); end y=sym2poly(y) for n=0:N-1 w(n+1)=0.54-0.46*cos(2*pi*n/(N-1)); h(n+1)=y(n+1).*w(n+1); end h=sym2poly(h) fir1(N-1,wn) end Output: >> hpfshyam((pi/2),7) y = 1.0472 0 -3.1416 4.9348 -3.1416 0 1.0472 h = 0.0838 0 -2.4190 4.9348 -2.4190 0 0.0838 ans = -0.0087 0.0000 0.2518 0.5138 0.2518 0.0000 -0.0087
  • 4. Aim: Design a FIR filter 3. Band pass filter Mathematical Expressions Required: Wc = 2π(fc / fs) Hd(w) = Inputs: Wc1=pi/4 ,wc2=pi/6 m=7 Program Codes: function[]=bpfshyam(wc1,wc2,N) i=(N-1)/2; wn1=wc1/pi; wn2=wc2/pi; syms w for n=-i:i y(n+i+1)=(1/2*pi)*(int(exp(j*w*n),-wc2,-wc1)+int(exp(j*w*n),wc1,wc2)); end y=sym2poly(y) for n=0:N-1 w(n+1)=0.54-0.46*cos(2*pi*n/(N-1)); h(n+1)=y(n+1).*w(n+1); end h=sym2poly(h) fir1(N-1,wn1) end Analysis/ Learning outcomes This experiment give me a better understanding of High pass filter and helps me to understand its working graphically
  • 5. Outputs/ Graphs/ Plots: >> bpfshyam((pi/4),(pi/6),7) y = 0.3067 -0.2104 -0.6506 -0.8225 -0.6506 -0.2104 0.3067 h = 0.0245 -0.0652 -0.5010 -0.8225 -0.5010 -0.0652 0.0245 Aim: Design a FIR filter 4. Band stop filter Mathematical Expressions Required: Wc = 2π(fc / fs) Hd(w) = Inputs: Wc1=pi/4 , wc2=pi/6 m=7 Analysis/ Learning outcomes This experiment give me a better understanding of band pass filter and helps me to understand its working graphically
  • 6. Program Codes: function[]=bsfshyam(wc1,wc2,N) i=(N-1)/2; wn1=wc1/pi; wn2=wc2/pi; syms w for n=-i:i y(n+i+1)=(1/2*pi)*(int(exp(j*w*n),-pi,-wc2)+int(exp(j*w*n),- wc1,wc1)+int(exp(j*w*n),wc2,pi)); end y=sym2poly(y) for n=0:N-1 w(n+1)=0.54-0.46*cos(2*pi*n/(N-1)); h(n+1)=y(n+1).*w(n+1); end h=sym2poly(h) fir1(N-1,wn1) end Outputs/ Graphs/ Plots: >> bsfshyam(pi/4,pi/6,7) y = -0.3067 0.2104 0.6506 10.6921 0.6506 0.2104 -0.3067 h = -0.0245 0.0652 0.5010 10.6921 0.5010 0.0652 -0.0245 Analysis/ Learning outcomes This experiment give me a better understanding of band stop filter and helps me to understand its working graphically