How to write codes for bandpass filter using Matlab?

Status
Not open for further replies.

nnm

Junior Member level 3
Joined
Aug 28, 2007
Messages
28
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Activity points
1,438
how do i write codes for bandpass filter using matlab
wb = sin(2*pi*3500*t);
wc = sin(2*pi*8000*t);
tx = wb.*wc;
 

Re: Plz Help me ....

here is an example how to build BPF in Matlab.


fs=100e6; % frequncy sample
s_filter=cfirpm(15,[0 0.3 0.5 0.6 0.8 1],@bandpass); % return filter
h=fvtool(dist_filter,1); % plot the filter
set(h,'NormalizedFrequency','off'); % turn off normalize
set(h,'Fs',fs);

if you want to pass signal thru the filter you need to convulate it.

output=conv(signal_in,s_filter); % it's in time domain
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…