design LPF given i/p signal its sampling freq, req o/p

Status
Not open for further replies.

rramya

Member level 4
Joined
Dec 14, 2008
Messages
76
Helped
23
Reputation
46
Reaction score
4
Trophy points
1,288
Activity points
2,062
Hai everyone,
I have an i/p signal x = 1 +0.5* sin(pi*t) where t = [0:0.01:5], basically a signal sampled at 100 Hz. I need to filter out the d.c. component i.e. get 1 as a constant output so for which I have to design a low pass filter.
can any one tel me how to design low pass filter in MATLAB
Thank you
 

Hi freind

u can search in the help of matlab you will findout many examples
 

hai every one,
First of all thanks for all your quick response

t=0:0.05:5;X=1+sin(pi*t); plot(t,X)
Since ,the required o/p is 1(in time domain).
I thought if i should get the o/p as 1, the LP filter coefficients had to be designed
in such a way so as to get the reqiured o/p as 1.
i multiplied with x(t) and y(t) with u(t) [step function]
x(t)=[1+sin(pi*t)]u(t) ; y(t)=u(t)
I took Laplace transform to get Transfer functionto obtain the transfer function in MATLAB
>> H=tf([1 0 pi.*pi],[1 pi pi.*pi])

Transfer function:
s^2 + 9.87
--------------------
s^2 + 3.142 s + 9.87

>> [B,A]=tfdata(H,'v')B = 1.0000 0 9.8696
A = 1.0000 3.1416 9.8696>> Y=filter(B,A,X);plot(t,Y)i didn't get the required o/p which is 1. instead Y is obtained a constant 0 and at the near end of 5 some fluctuations are also seen.Can anybody give any hint and correct me if i am wrong.
 

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