Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

write a matlab code for HPF

Status
Not open for further replies.

halee awan

Full Member level 3
Joined
Apr 8, 2006
Messages
151
Helped
11
Reputation
22
Reaction score
11
Trophy points
1,298
Activity points
2,207
matlab plot hpf

sallam
i want to write a matlab code for high pass or any type of filter . i've tried but can't done it ..any one who have write this type of code plz hlp me
 

matlab code for hpf

fs=50;
fcut1=10;
fcut2=5;
w1=2*fcut1/fs;
w2=2*fcut2/fs;

[b,a]=butter(2,w1);
[b1,a1]=butter(2,w2,'high');

[h,f]=freqz(b,a,100,fs);
[h1,f1]=freqz(b1,a1,100,fs);

kfr=abs(h);
kfr1=abs(h1);

subplot(2,1,1),plot(kfr);grid;
subplot(2,1,2),plot(kfr1);grid;
 

hpf filter code implementation

If you want to design a digital filter, one of the most important things is to get the filter coefficients. You can use MATLAB Signal Processing Toolbox rather than hand calculation.
 

matlab hpf

fs=84;
fcut1=456;
fcut2=5;
w1=2*fcut1/fs;
w2=2*fcut2/fs;

[b,a]=mixer(2,w4);
[b1,a1]=roare(4,w6,'high');

[h,f]=freqz(b,a,1000,fs);
[h1,f1]=freqz(b1,a1,1000,fs);

kfr=ars(h);
kfr1=abs(h1);

subplot(2,1,1),plot(kfr);greid;
subplot(2,1,2),plot(kfr1);grid;
 

do you require IIR fiter or fir filter design.
for any, use FTA tool of matlab which directly gives you the filter coefficients
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top