Low Pass Filter to filter out harmonics from a signal. (MATLAB CODE)

Status
Not open for further replies.

Prosenjit101

Newbie level 5
Joined
Apr 18, 2013
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Dhaka, Bangladesh
Visit site
Activity points
1,349
I need a MATLAB code to
promt the user to enter a sinusoid signal
ex: x= 3*sin(2*pi*50*t) + 3*sin(2*pi*100*t) + 3*sin(2*pi*200*t) + 3*sin(2*pi*400*t)
and if any other variables are needed from the user.
then display the signal in time domain and frequency domain.
and then apply a low pass filter,
to filter out the harmonics from the signal and then display the signal with the fundamental frequency.
 

but keep in mind that the filter is designed for cut off frequency equal to 50 Hz
 

Attachments

  • filter_harmonics1.txt
    770 bytes · Views: 105

very useful. But in a situation where you have your data already and you want to filter the noise, is the same code applicable??. because this seems to generate its own data and then apply the filter.
 

you can reference this code
 

Attachments

  • abc.txt
    923 bytes · Views: 117

Thanks so much sir, I was still a little bit confused being a new learner of matlab. Attached are my data and image I got from the Oscilloscope. From the code you sent sir, I couldnt see where to enter my data. kindly give me a little guidiance. thanks so much for taking your time sir.
,
How do I highlight the fundamental frequency and remove all the harmonics. In my result, I am surpose to only present the fundamental frequency and eliminate the harmonic by using filter.
 

in signal processing, y= x* h.
using fft : Y(f) = X(f) x H(f). LPF is a filter where H(f)=1 for =-fc < f < fc. anh H(f)=0 if otherwise.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…