Question

Problem 4 a) Determine the periods of the following two signals. b) Plot the signals between 0 program). sec and ST (T is period) using computer (attach your plot and 10 15 -15A-10 Please slove using MATLAB
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The square wave repeats at each 10s hence the period of the square wave is T=10s.

The sawtooth wave repeats at each 10s hence the period of the sawtooth wave is T=10s.

%%----------------------------------------MATLAB CODES----------------------------------------------%%

%%-------------------------Square Wave-------------------------------%%
T=10; %time periof T=10s
t=0:0.01:5*T;                     %plot upto 5*T
x=square(2*pi*0.1*t);    % 2*pi*f*t where f(frequency)=1/T =0.1
plot(t,x,'r') %plotting the curve
axis ([0 5*T -2 2])              % determining the ploting range
xlabel('time'),ylabel('y') %label teh axis
title('Square wave')          %give it a name

%%------------------------------------------------------------------------------%%save it with square

%%----------------------------Sawtooth Wave-----------------------------%%
T=10;                                         %time periof T=10s
t=0:0.01:5*T;                             %plot upto 5*T
x=sawtooth(2*pi*0.1*(t-5));   % 2*pi*f*t where f(frequency)=1/T =0.1,with a shift of 5s (delay)
plot(t,x,'r')                                %plotting the curve
axis ([0 5*T -2 2])                     % determining the ploting range
xlabel('time'),ylabel('y')          %label teh axis
title('Sawtooth wave')             %give it a name​

%%-----------------------------------------------------------------------------------%% save it with name sawtooth

Please note for proper execution of the code save each of the code in different mfile and run the simulation.

Plots obtained from the codes:

SQUARE WAVE :

   Square wave 0.5 0.5 0 51015 2025 30 354045 50 time

SAWTOOTH WAVE:

Add a comment
Know the answer?
Add Answer to:
Please slove using MATLAB Problem 4 a) Determine the periods of the following two signals. b)...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT