You are on page 1of 9

Name: Joevelle Zabate Baflor Instructor: Engr.

Joseph Manbert Mendez, REcE


Subject: ECE415 (SPECTRA) Date: July 08, 2017

t). A signal is odd if x(t) = -x(-t). An odd


signal must be 0 at t=0, in other words,
Activity#3 (Create a Continuous-Time
odd signal passes the origin.
Signal with EVEN & ODD) Using the definition of even and odd
signal, any signal may be decomposed
into a sum of its even part, xe(t), and its
odd part, xo(t), as follows:

1. Objectives:

To plot the even and the odd component of


a continuous-time signal.

2. Discussion (Manual Plotting):

A continuous signal or a continuous-


time signal is a varying quantity (a signal)
whose domain, which is often time, is a
continuum (e.g., a connected interval of

the reals). That is, the function's domain ( ) + ( )

is an uncountable set. The function itself (. )
need not be continuous. .
() =
( )

<
One of characteristics of signal is
( ) ( ) <
{
symmetry that may be useful for signal
analysis. Even signals are symmetric
around vertical axis, and Odd signals are This is my piecewise function to be graph in MatLab
symmetric about origin. A signal is
referred to as an even if it is identical to
its time-reversed counterparts; x(t) = x(-
Name: Joevelle Zabate Baflor Instructor: Engr. Joseph Manbert Mendez, REcE
Subject: ECE415 (SPECTRA) Date: July 08, 2017

3. Codes

% MY PIECEWISE FUNCTION ( ACTIVITY #3)


% CONTINUOUS-TIME SIGNAL (ODD & EVEN SIGNAL)
% MINIMUM OF 6 LIMITS

%% -cos (pi/6)t + (pi/6) -5 <= t <= -4


% (-2t^(1.25))-12 -4 <= t <= -3
% t^(1.5) -3 <= t <= 0
% 2 sin(pi/2)t 0 <= t <= 3
% -2 3 < t <= 4
% -cos (pi/6)t - (pi/6) 4 < t <= 5
%% =================================

x1=-5:.1:-4; % MY RANGE FOR THE 1st FUNCTION


y1=-cos(((pi/6)*x1)+(pi/6)); % THE EQUATION OF MY 1st LIMIT
x2=-4:.1:-3; % MY RANGE FOR THE 2nd FUNCTION
y2=(-2*x2*1.25-12); % THE EQUATION OF MY 2nd LIMIT
c1=[-4 -4]; % CONSTANTS
t1=[-2 0]; % CONSTANTS
x3=-3:.1:0; % MY RANGE FOR THE 3rd FUNCTION
y3=x3*1.5; % MY EQUATION OF MY 3rd LIMIT
x4=0:.1:3; % MY RANGE FOR THE 4th FUNCTION
y4=sin((pi/2)*x4); % MY EQUATION OF MY 4th LIMIT
x5=[3 3]; % CONSTANTS
y5=[-1 -2]; % CONSTANTS
x6=[3 4]; % MY LIMITS FOR THE 5th FUNCTION
y6=[-2 -2]; % x(t) = -2
x7=[4 4]; % CONSTANTS
y7=[-2 0]; % CONSTANTS
x10=4:.1:5; % MY FINAL LIMIT FOR THE 6th FUNCTION
y10=-cos(((pi/6)*x10)-(pi/6)); % MY LAST EQUATION
%% ===================================
% THIS SECTION WHERE I CREATE MY PLOTS FOR THE SPECIFIED WINDOW or FIGURE

subplot (3,1,1);
plot(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x10,y10,c1,t1,'LineWidth',2.5);

xlabel('time'); %% Label for X-Axis


ylabel('x(t)'); %% Label for Y-Axis
title ({'ACTIVITY #3','CONTINUOUS-TIME SIGNAL'}); % DISPLAYS TITLE

axis([-5.25 5.25 -5.25 2]) %% AXIS LIMITS


grid on; %% DISPLAY GRID
zoom on; %% USER CAN NAVIGATE BY ZOOMING-IN and OUT

hold on; %% HOLDS THE FIGURE

x8=[-6 6]; %% X-AXIS ORIGIN


y8=[0 0]; %% X-AXIS ORIGIN
x9=[0 0]; %% Y-AXIS ORIGIN
y9=[-4 4]; %% Y-AXIS ORIGIN

plot(x8,y8,x9,y9); %% DISPLAY X & Y AXES

hold off; %% STOP HOLD FOR ANY FUNCTION


Name: Joevelle Zabate Baflor Instructor: Engr. Joseph Manbert Mendez, REcE
Subject: ECE415 (SPECTRA) Date: July 08, 2017

%% =================================
% MY CODE FOR EVEN SIGNAL

%% x[n] at negative values of 0.5

% THE SECTION BELOW ARE MY SPECIFIED RANGE OF NEGATIVE 't'


xe1=-5:0.5:-4;
xe2=-4:0.5:-3;
xe3=-3:0.5:0;

%% x[n] at positive values of 0.5

% THE SECTION BELOW ARE MY SPECIFIED RANGE OF POSITIVE 't'


xe4=4:0.5:5;
xe5=3:0.5:4;
xe6=0:0.5:3;

%% Plugging in even function to MY PIECEWISE FUNCTION

x1a=-cos(((pi/6)*xe1)+(pi/6));
x1b=-cos(((pi/6)*xe4)-(pi/6));
x2a=(-2*xe2*1.25-12);
x2b=-2;
x3a=xe3*1.5;
x3b=sin((pi/2)*xe6);

%% Using the equation xe(t) = 1/2 (x(t) + x(-t))

e1=(1/2)*(x1a+x1b);
e2=(1/2)*(x2a+x2b);
e3=(1/2)*(x3a+x3b);
e4=(1/2)*(x1b+x1a);
e5=(1/2)*(x2b+x2a);
e6=(1/2)*(x3b+x3a);

%% PLOT FIGURE IN ROW 2 ( '-o' will be my indicator)

subplot(3,1,2);
plot(xe1,e1,'o',xe2,e2,'o',xe3,e3,'o',xe4,fliplr(e4),'o',xe5,fliplr(e5),'o',xe6,fliplr(e6),'o','Li
newidth',2);

xlabel ('time');
ylabel ('x(t)');
title ('EVEN -- CONTINUOUS-TIME SIGNAL');

axis([-5.25 5.25 -4 2])


grid on;
grid minor;
zoom on;

hold on;
%% DATAS FOR MY GRAPH

x8b=[-6 6]; %% X-AXIS ORIGIN


y8b=[0 0]; %% X-AXIS ORIGIN
x9b=[0 0]; %% Y-AXIS ORIGIN
Name: Joevelle Zabate Baflor Instructor: Engr. Joseph Manbert Mendez, REcE
Subject: ECE415 (SPECTRA) Date: July 08, 2017

y9b=[-4 4]; %% Y-AXIS ORIGIN

plot(x8b,y8b,x9b,y9b); %% DISPLAY X & Y AXES

hold off; %% STOP HOLD FOR ANY FUNCTION


%% END OF EVEN SIGNAL

%%%%%%%%%%%%
%%%%%%%%%%%%
%%%%%%%%%%%%

% MY CODE FOR THE ODD SIGNALS

% Xo = 1/2 (x(t) - x(-t))

%% Using the formula

e1b=(1/2)*(x1a-x1b);
e2b=(1/2)*(x2a-x2b);
e3b=(1/2)*(x3a-x3b);
e4b=(1/2)*(x1b-x1a);
e5b=(1/2)*(x2b-x2a);
e6b=(1/2)*(x3b-x3a);

%% PLOT FIGURE IN ROW 3 ( "o' will be my indicator)

subplot(3,1,3);
plot(xe1,e1b,'o',xe2,e2b,'o',xe3,e3b,'o',xe4,fliplr(e4b),'o',xe5,fliplr(e5b),'o',xe6,fliplr(e6b),'
o','Linewidth',2);

xlabel ('time');
ylabel ('x(t)');
title ('ODD -- CONTINUOUS-TIME SIGNAL');

axis([-5.25 5.25 -3 3])


grid on;
grid minor;
zoom on;

hold on;
%% DATA OF MY GRAPH

x8c=[-6 6]; %% X-AXIS ORIGIN


y8c=[0 0]; %% X-AXIS ORIGIN
x9c=[0 0]; %% Y-AXIS ORIGIN
y9c=[-4 4]; %% Y-AXIS ORIGIN

plot(x8c,y8c,x9c,y9c); %% DISPLAY X & Y AXES

hold off; %% STOP HOLD FOR ANY FUNCTION


%% END OF MY ODD SIGNAL
Name: Joevelle Zabate Baflor Instructor: Engr. Joseph Manbert Mendez, REcE
Subject: ECE415 (SPECTRA) Date: July 08, 2017

Functions

x1=-5:.1:-4; % MY RANGE FOR THE 1st FUNCTION


y1=-cos(((pi/6)*x1)+(pi/6)); % THE EQUATION OF MY 1st LIMIT

( ) + ( )

x2=-4:.1:-3; % MY RANGE FOR THE 2nd FUNCTION


y2=(-2*x2*1.25-12); % THE EQUATION OF MY 2nd LIMIT
c1=[-4 -4]; % CONSTANTS
t1=[-2 0]; % CONSTANTS
(. )
Name: Joevelle Zabate Baflor Instructor: Engr. Joseph Manbert Mendez, REcE
Subject: ECE415 (SPECTRA) Date: July 08, 2017

x3=-3:.1:0; % MY RANGE FOR THE 3rd FUNCTION


y3=x3*1.5; % MY EQUATION OF MY 3rd LIMIT
.

x4=0:.1:3; % MY RANGE FOR THE 4th FUNCTION


y4=sin((pi/2)*x4); % MY EQUATION OF MY 4th LIMIT
x5=[3 3]; % CONSTANTS
y5=[-1 -2]; % CONSTANTS

( )

Name: Joevelle Zabate Baflor Instructor: Engr. Joseph Manbert Mendez, REcE
Subject: ECE415 (SPECTRA) Date: July 08, 2017

x5=[3 3]; % CONSTANTS


y5=[-1 -2]; % CONSTANTS
x6=[3 4]; % MY LIMITS FOR THE 5th FUNCTION
y6=[-2 -2]; % x(t) = -2
x7=[4 4]; % CONSTANTS
y7=[-2 0]; % CONSTANTS
<

x10=4:.1:5; % MY FINAL LIMIT FOR THE 6th FUNCTION


y10=-cos(((pi/6)*x10)-(pi/6)); % MY LAST EQUATION

( ) ( ) <

Name: Joevelle Zabate Baflor Instructor: Engr. Joseph Manbert Mendez, REcE
Subject: ECE415 (SPECTRA) Date: July 08, 2017

Continuous-Time Signal

Even Function of our Continuous-Time Signal


Name: Joevelle Zabate Baflor Instructor: Engr. Joseph Manbert Mendez, REcE
Subject: ECE415 (SPECTRA) Date: July 08, 2017

Odd Function of our Continuous-Time Signal

FINAL OUTPUT WAVEFORM

You might also like