SlideShare a Scribd company logo
1 of 3
w_w0=0:0.02:3;
Aw2k1=sqrt(1./(w_w0.^2+1));
Aw2k2=sqrt(1./(w_w0.^4+1));
Aw2k4=sqrt(1./(w_w0.^8+1));
Aw2k8=sqrt(1./(w_w0.^16+1));
plot(w_w0,Aw2k1,w_w0,Aw2k2,w_w0,Aw2k4,w_w0,Aw2k8);
Grid
f=1:10:5000;
R1=11300;
R2=22600; R3=68100;
R4=R3;
C1=10^(-8);
C2=C1;
a=sqrt(2); b=1; w=2*pi*f; fc=sqrt(1/(b*R1*R2*C1*C2))/(2*pi);
wc=2*pi*fc;
K=1+R3/R4; s=w*j; Gw=(K.*b.*wc.^2)./(s.^2+a.*wc.*s+b.*wc.^2);
magGw=abs(Gw);
semilogx(f,magGw);
grid;
hold on;
xlabel ('Frequency Hz'); ylabel('|Vout/Vin|');
title ('2nd Order Butterworth Low-Pass Filter Response')
a=sqrt(2); b =1; C1=10^(-8); C2=C1; fc=1000; wc=2*pi*fc; K=2;
R2=(4*b)/(C1*sqrt(a^2+8*b*(K-1))*wc);
R1=b/(C1^2*R2*wc^2); R3=(K*R2)/(K-1); R4=K*R2; fprintf(' n');
fprintf('R1 = %5.0f Ohms t',R1); fprintf('R2 = %5.0f Ohms t',R2);
fprintf('R3 = %5.0f Ohms t',R3); fprintf('R4 = %5.0f Ohms t',R4)
f=10:10:20000; w=2*pi*f; R1=12700; R2=20000; R3=40200; R4=R3; K=1+R4/R3;
wc=(4*b)/(C1*sqrt(a^2+8*b*(K-1))*R2);
s=w*j;
Gw=(K.*s.^2)./(s.^2+a.*wc.*s./b+wc.^2./b);
semilogx(f,abs(Gw)); grid; hold on;
xlabel('Frequency, Hz'), ylabel('|Vout/Vin|');
title('2nd Order Butterworth High-Pass Filter Response')
fplot('cos(x)',[-2*pi 2*pi -1.2 1.2])
fplot('sin(x)./x',[-20 20 -0.4 1.2])
fplot(@(x)cos(x)), [-2*pi 2*pi -1.2 1.2]
fplot(@(x)sin(x)./x)), [-20 20 -0.4 1.2]
Wp=10; Ws=16.5; r=2;Gs=-20;
[n,Wp]=chebylord (Wp,Ws,r,-Gs, 's');
[num, den]=chebyl (n ,r, Wp, 's' );
%%%%%%%%%%%%%%%%%%%
% Example 6.8 -- Filtering with Butterworth filter
%%%%%%%%%%%%%%%%%%%
clear all; clf
syms t w
x = cos(10 * t) - 2 * cos(5 * t) + 4 * sin(20 * t);% input signal
X = fourier(x);
N = 3; Whp = 5; % filter parameters
[b, a] = butter(N, Whp, ’s’); % filter design
W = 0:0.01:30; Hm = abs(freqs(b, a, W)); % magnitude responsein W
% filter output
n = N:-1:0; U = ( j * w).ˆn
num = b - conj(U’); den = a - conj(U’);H = num/den; % frequency response
Y = X * H; % convolution property
y = ifourier(Y, t); % inverse Fourier
%%%%%%%%%%%%%%%%%%%
% Example 6.9 -- Filtering with Butterworth and Chebyshev filters
%%%%%%%%%%%%%%%%%%%
clear all;clf
syms t w
x = cos(10 ∗ t) - 2 ∗ cos(5 ∗ t) + 4 ∗ sin(20 ∗ t); X = fourier(x)
wp = 5;ws = 10;alphamax = 0.1;alphamin = 15; % filter parameters
% butterworth filter
[N, whp] = buttord(wp, ws, alphamax, alphamin, ’s’)
[b, a] = butter(N, whp, ’s’)
% cheby1 filter
epsi= sqrt(10ˆ(alphamax/10) -1)
wp = whp/cosh(acosh(1/epsi)/N) % recomputing wp to get same whp
[N1, wn] = cheb1ord(wp, ws, alphamax, alphamin, ’s’);
[b1, a1] = cheby1(N1, alphamax, wn, ’s’);
% frequency responses
W = 0:0.01:30;
Hm = abs(freqs(b, a, W));
Hm1 = abs(freqs(b1, a1, W));
% generation of frequency responsefrom coefficients
n = N:-1:0; n1 = N1:-1:0;
U = ( j * w).^n; U1 = ( j *w).^n1
num = b .*conj(U’); den = a .* conj(U’);
num1 = b1 conj(U1’); den1 = a1 ∗ conj(U1’)
H = num/den; % Butterworth LPF
H1 = num1/den1; % Chebyshev LPF
% output of filter
Y = X ∗ H;
Y1 = X ∗ H1;
y = ifourier(Y, t)
y1 = ifourier(Y1, t

More Related Content

What's hot (20)

Carry save adder Type 2
Carry save adder Type 2Carry save adder Type 2
Carry save adder Type 2
 
Carry save adder vhdl
Carry save adder vhdlCarry save adder vhdl
Carry save adder vhdl
 
Metnum
MetnumMetnum
Metnum
 
Plsql
PlsqlPlsql
Plsql
 
Bisection methode alternate
Bisection methode alternateBisection methode alternate
Bisection methode alternate
 
Simple Calculator Flowchart
Simple Calculator FlowchartSimple Calculator Flowchart
Simple Calculator Flowchart
 
Cuarto Punto Parte A
Cuarto Punto Parte ACuarto Punto Parte A
Cuarto Punto Parte A
 
week-2x
week-2xweek-2x
week-2x
 
Kika
KikaKika
Kika
 
Session07 recursion
Session07 recursionSession07 recursion
Session07 recursion
 
Es84
Es84Es84
Es84
 
Closures
ClosuresClosures
Closures
 
week-10x
week-10xweek-10x
week-10x
 
week-18x
week-18xweek-18x
week-18x
 
6 pointers functions
6 pointers functions6 pointers functions
6 pointers functions
 
VTU Network lab programs
VTU Network lab   programsVTU Network lab   programs
VTU Network lab programs
 
week-1x
week-1xweek-1x
week-1x
 
Intro to c programming
Intro to c programmingIntro to c programming
Intro to c programming
 
When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)When RV Meets CEP (RV 2016 Tutorial)
When RV Meets CEP (RV 2016 Tutorial)
 
Kika2
Kika2Kika2
Kika2
 

Similar to Project filter matlab

Fourier series example
Fourier series exampleFourier series example
Fourier series exampleAbi finni
 
DIGITAL SIGNAL PROCESSING BASED ON MATLAB
DIGITAL SIGNAL PROCESSING BASED ON MATLABDIGITAL SIGNAL PROCESSING BASED ON MATLAB
DIGITAL SIGNAL PROCESSING BASED ON MATLABPrashant Srivastav
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfWaleedHussain30
 
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeA Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeChung Hua Universit
 
Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)asghar123456
 
Matlab codes for Sizing and Calculating the Aircraft Stability & Performance
Matlab codes for Sizing and Calculating the Aircraft Stability & PerformanceMatlab codes for Sizing and Calculating the Aircraft Stability & Performance
Matlab codes for Sizing and Calculating the Aircraft Stability & PerformanceAhmed Momtaz Hosny, PhD
 
Algorithm Design and Complexity - Course 12
Algorithm Design and Complexity - Course 12Algorithm Design and Complexity - Course 12
Algorithm Design and Complexity - Course 12Traian Rebedea
 
Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For GoogleEleanor McHugh
 
[112] 모바일 환경에서 실시간 Portrait Segmentation 구현하기
[112] 모바일 환경에서 실시간 Portrait Segmentation 구현하기[112] 모바일 환경에서 실시간 Portrait Segmentation 구현하기
[112] 모바일 환경에서 실시간 Portrait Segmentation 구현하기NAVER D2
 
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdfreservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdfRTEFGDFGJU
 
Operational management of a centrifugal slurry pump
Operational management of a centrifugal slurry pumpOperational management of a centrifugal slurry pump
Operational management of a centrifugal slurry pumpDr. Bikram Jit Singh
 
Polygraph
PolygraphPolygraph
Polygraphyuyabu
 

Similar to Project filter matlab (20)

Fourier series example
Fourier series exampleFourier series example
Fourier series example
 
DIGITAL SIGNAL PROCESSING BASED ON MATLAB
DIGITAL SIGNAL PROCESSING BASED ON MATLABDIGITAL SIGNAL PROCESSING BASED ON MATLAB
DIGITAL SIGNAL PROCESSING BASED ON MATLAB
 
Solutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdfSolutions_Manual_to_accompany_Applied_Nu.pdf
Solutions_Manual_to_accompany_Applied_Nu.pdf
 
Surface rendering
Surface renderingSurface rendering
Surface rendering
 
A Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter ThreeA Course in Fuzzy Systems and Control Matlab Chapter Three
A Course in Fuzzy Systems and Control Matlab Chapter Three
 
Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)Amth250 octave matlab some solutions (4)
Amth250 octave matlab some solutions (4)
 
Matlab codes for Sizing and Calculating the Aircraft Stability & Performance
Matlab codes for Sizing and Calculating the Aircraft Stability & PerformanceMatlab codes for Sizing and Calculating the Aircraft Stability & Performance
Matlab codes for Sizing and Calculating the Aircraft Stability & Performance
 
Voltage sags evaluation studies
Voltage sags evaluation studiesVoltage sags evaluation studies
Voltage sags evaluation studies
 
flows.ppt
flows.pptflows.ppt
flows.ppt
 
vertical-curves
vertical-curvesvertical-curves
vertical-curves
 
Algorithm Design and Complexity - Course 12
Algorithm Design and Complexity - Course 12Algorithm Design and Complexity - Course 12
Algorithm Design and Complexity - Course 12
 
Go: It's Not Just For Google
Go: It's Not Just For GoogleGo: It's Not Just For Google
Go: It's Not Just For Google
 
Ch4
Ch4Ch4
Ch4
 
Ch06p
Ch06pCh06p
Ch06p
 
[112] 모바일 환경에서 실시간 Portrait Segmentation 구현하기
[112] 모바일 환경에서 실시간 Portrait Segmentation 구현하기[112] 모바일 환경에서 실시간 Portrait Segmentation 구현하기
[112] 모바일 환경에서 실시간 Portrait Segmentation 구현하기
 
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdfreservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
reservoir-modeling-using-matlab-the-matalb-reservoir-simulation-toolbox-mrst.pdf
 
Operational management of a centrifugal slurry pump
Operational management of a centrifugal slurry pumpOperational management of a centrifugal slurry pump
Operational management of a centrifugal slurry pump
 
Polygraph
PolygraphPolygraph
Polygraph
 
Ch15p
Ch15pCh15p
Ch15p
 
DA-40 MATLAB results
DA-40 MATLAB resultsDA-40 MATLAB results
DA-40 MATLAB results
 

Recently uploaded

the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
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
 
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
 
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
 
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
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
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
 
(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
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(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
 
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
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
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
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 

Recently uploaded (20)

the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
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
 
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...
 
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
 
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
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
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
 
(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...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(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...
 
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...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
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...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 

Project filter matlab

  • 1. w_w0=0:0.02:3; Aw2k1=sqrt(1./(w_w0.^2+1)); Aw2k2=sqrt(1./(w_w0.^4+1)); Aw2k4=sqrt(1./(w_w0.^8+1)); Aw2k8=sqrt(1./(w_w0.^16+1)); plot(w_w0,Aw2k1,w_w0,Aw2k2,w_w0,Aw2k4,w_w0,Aw2k8); Grid f=1:10:5000; R1=11300; R2=22600; R3=68100; R4=R3; C1=10^(-8); C2=C1; a=sqrt(2); b=1; w=2*pi*f; fc=sqrt(1/(b*R1*R2*C1*C2))/(2*pi); wc=2*pi*fc; K=1+R3/R4; s=w*j; Gw=(K.*b.*wc.^2)./(s.^2+a.*wc.*s+b.*wc.^2); magGw=abs(Gw); semilogx(f,magGw); grid; hold on; xlabel ('Frequency Hz'); ylabel('|Vout/Vin|'); title ('2nd Order Butterworth Low-Pass Filter Response')
  • 2. a=sqrt(2); b =1; C1=10^(-8); C2=C1; fc=1000; wc=2*pi*fc; K=2; R2=(4*b)/(C1*sqrt(a^2+8*b*(K-1))*wc); R1=b/(C1^2*R2*wc^2); R3=(K*R2)/(K-1); R4=K*R2; fprintf(' n'); fprintf('R1 = %5.0f Ohms t',R1); fprintf('R2 = %5.0f Ohms t',R2); fprintf('R3 = %5.0f Ohms t',R3); fprintf('R4 = %5.0f Ohms t',R4) f=10:10:20000; w=2*pi*f; R1=12700; R2=20000; R3=40200; R4=R3; K=1+R4/R3; wc=(4*b)/(C1*sqrt(a^2+8*b*(K-1))*R2); s=w*j; Gw=(K.*s.^2)./(s.^2+a.*wc.*s./b+wc.^2./b); semilogx(f,abs(Gw)); grid; hold on; xlabel('Frequency, Hz'), ylabel('|Vout/Vin|'); title('2nd Order Butterworth High-Pass Filter Response') fplot('cos(x)',[-2*pi 2*pi -1.2 1.2]) fplot('sin(x)./x',[-20 20 -0.4 1.2]) fplot(@(x)cos(x)), [-2*pi 2*pi -1.2 1.2] fplot(@(x)sin(x)./x)), [-20 20 -0.4 1.2] Wp=10; Ws=16.5; r=2;Gs=-20; [n,Wp]=chebylord (Wp,Ws,r,-Gs, 's'); [num, den]=chebyl (n ,r, Wp, 's' );
  • 3. %%%%%%%%%%%%%%%%%%% % Example 6.8 -- Filtering with Butterworth filter %%%%%%%%%%%%%%%%%%% clear all; clf syms t w x = cos(10 * t) - 2 * cos(5 * t) + 4 * sin(20 * t);% input signal X = fourier(x); N = 3; Whp = 5; % filter parameters [b, a] = butter(N, Whp, ’s’); % filter design W = 0:0.01:30; Hm = abs(freqs(b, a, W)); % magnitude responsein W % filter output n = N:-1:0; U = ( j * w).ˆn num = b - conj(U’); den = a - conj(U’);H = num/den; % frequency response Y = X * H; % convolution property y = ifourier(Y, t); % inverse Fourier %%%%%%%%%%%%%%%%%%% % Example 6.9 -- Filtering with Butterworth and Chebyshev filters %%%%%%%%%%%%%%%%%%% clear all;clf syms t w x = cos(10 ∗ t) - 2 ∗ cos(5 ∗ t) + 4 ∗ sin(20 ∗ t); X = fourier(x) wp = 5;ws = 10;alphamax = 0.1;alphamin = 15; % filter parameters % butterworth filter [N, whp] = buttord(wp, ws, alphamax, alphamin, ’s’) [b, a] = butter(N, whp, ’s’) % cheby1 filter epsi= sqrt(10ˆ(alphamax/10) -1) wp = whp/cosh(acosh(1/epsi)/N) % recomputing wp to get same whp [N1, wn] = cheb1ord(wp, ws, alphamax, alphamin, ’s’); [b1, a1] = cheby1(N1, alphamax, wn, ’s’); % frequency responses W = 0:0.01:30; Hm = abs(freqs(b, a, W)); Hm1 = abs(freqs(b1, a1, W)); % generation of frequency responsefrom coefficients n = N:-1:0; n1 = N1:-1:0; U = ( j * w).^n; U1 = ( j *w).^n1 num = b .*conj(U’); den = a .* conj(U’); num1 = b1 conj(U1’); den1 = a1 ∗ conj(U1’) H = num/den; % Butterworth LPF H1 = num1/den1; % Chebyshev LPF % output of filter Y = X ∗ H; Y1 = X ∗ H1; y = ifourier(Y, t) y1 = ifourier(Y1, t