Square wave using simple harmonics

Status
Not open for further replies.

Blimpy325

Newbie level 1
Joined
Mar 7, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,289
how to plot square wave using harmonics in matlab

Hello, I need some help on this problem.

A square wave has an amplitude of 10 and a fundamental frequency of 50 Hz. First, plot the frequency spectrum of this wave. Use Matlab or Excel to construct the wave usind the cosines that form its basis. To start, assume it is made up of the fundamental, 3rd, 5th, 7th. and 9th harmonics. Plot the resulting waveform. Next, extend the number of cosine terms to the 29th harmonic. Plot the resulting waveform.

That is the problem that I was given. It has been a while since I have used MATLAB and I was wondering if someone could give me some general instructions as to what I should do in order to get a plot of the wave. Thank you.
 

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