Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

low pass filter (matlab)

Status
Not open for further replies.

sherifelian

Newbie level 3
Joined
Dec 8, 2005
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,315
fir1 matlab

hi all ,
i am supposed to implement an Am modulator and demodulator using Matlab

i have finished the modulator already

but i have a problems in the demodulator
i make an envelope detector ( i make it manually )

but then i want to make low pass filter and i don't know how

i know fir1() and filter() but i don't know how to use them
so anybody can help ???

thanks alot
 

mro83

Member level 5
Joined
Oct 6, 2004
Messages
86
Helped
11
Reputation
22
Reaction score
4
Trophy points
1,288
Location
Mashad
Activity points
758
matlab fir1

Hi
the best way is to read Matlab help. see the matlab entries for commands:
"butter" that u can set it as a LPF .
"filter".
a glance will guide u through.
 

b.pricope

Junior Member level 2
Joined
Oct 27, 2005
Messages
21
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,487
low pass filter matlab

Hi,

[num,den] = butter(2, .8 ) ;
FilteredOutput = filter(num,den,DeAmpMod);

where DeAmpMod is the Demodulated AM modulated signal you want to filter.

Good luck!
 

sherifelian

Newbie level 3
Joined
Dec 8, 2005
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,315
matlab lpf

thanks very much for your replies
but
butter(2, .8 )
can you tell me what is the 2 and what is the .8

, another thing , i prefere to work with fir1
as my professor told me to use

so if you can explain to me its parameters
fir1(n,Wn) it will help alot

if no , then butter will do the job

thanks very much you are really saving me :D
 

claudiocamera

Full Member level 4
Joined
Aug 19, 2005
Messages
225
Helped
27
Reputation
54
Reaction score
6
Trophy points
1,298
Location
Salvador-BA-Brazil
Activity points
4,282
lowpass filter matlab

The command fir1 in matlab implements digital filters based on the window methods , as you indicated the comand h=fir1(n,wn) returns the nth +1 coeficients of a Hamming window lowpass linear filter, the vector h is the coeficients of the filter from wich you will convolve the sample demodulated signal. If you want to use other window than hamming, for instance if you need a attenuation in the stopband higher than 44 db you can use h = fir1(n,Wn,window) where widow should be a colum vector resulted from a desired window see blackman and kaiser in the matlab help.

Dont forget that Wn is the normalised frequency i.e the desired cut off frequency over Sampling frequency.

n is the number of coeficient of the filter, it depends of the transition width ( normalized) and the window used, for a hamming window n=3.3/( transition width). Remember to normalize the transition width related to the sampling frequency and that transition width = stopband - passband

After find h from fir1 you can peform as the pall b.pricope suggested :

FilteredOutput = filter(h,1,DeAmpMod);

where DeAmpMod is the Demodulated AM modulated signal you want to filter.

I hope have helped
 

sherifelian

Newbie level 3
Joined
Dec 8, 2005
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,315
fir1 filter

THNKS ALOT

that really helped me alot , i finished the AM , i hope FM became more Simpler
 

xuedashun

Member level 1
Joined
Aug 30, 2005
Messages
39
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,286
Activity points
1,582
digital low pass filter matlab

who can recommend book related lpf by matlab ? thanks
 

b.pricope

Junior Member level 2
Joined
Oct 27, 2005
Messages
21
Helped
2
Reputation
4
Reaction score
0
Trophy points
1,281
Activity points
1,487
lpf matlab

Digital Signal Processing using MATLAB by Proakis is one of the very good books.
You can find it here on the server.
 

nagacnu

Junior Member level 2
Joined
Sep 8, 2005
Messages
21
Helped
4
Reputation
8
Reaction score
0
Trophy points
1,281
Activity points
1,435
matlab low pass filter butter

here is your req feel free to contact me
cut_of_freq =0.2; %normalised frequency f/fs

N = 11 %order of the filter
h = fir1 (N-1, cut_of_freq, hamming(N));
Y =filter(h,x); % here x is our in put signal
for more about the fir1 go to command window and type help fir1 u can get good information how to use it
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top