Continue to Site

Welcome to EDAboard.com

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

MATLAB program simulation of a square wave using harmonic

Status
Not open for further replies.

edirraa

Newbie level 1
Joined
Aug 29, 2009
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,293
square wave matlab

Hi,

Please can you help me, I need to write a few simple programs. I do not have a lot of experience in Matlab and will appreciate your help:

Write a MATLAB program to create a simulation of a square wave using
harmonically related sine waves. The square wave will have a 50% duty cycle and will have negative values i.e. it is a zero mean wave. The Fourier series of a square wave is given by:
S(t) = sin(t) + 1/3 sin(3t) + 1/5 sin(5t) + 1/7 sin (7t) + ……

Your final program should display the square wave starting with only the first
Fourier component and adding additional components after a pause. Add enough components to see the square wave being formed, say 7 components.
Hint: Display the wave over only one period. Repeat this exercise with:
a) A zero mean triangular wave with period 2π.
S(t)= 1- (2/π) sin(πt) – (2/2π) sin( 2πt) – (2/3π) sin(3πt) – (2/4π) sin(4πt) -….

b) Any signal of your choice.
 

generate square wave matlab

see this link to a post in the edaboard.com it has a matlab program as i think will help you
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top