blob: e1ec469d385cba600f566ce94cc444a143b4d1f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
//Example 1.23
//Find the even and odd components of the signal x(t)=(e^-2t)*cos(t)
clc;
clear all;
t=-10:.1:10;
for j=1:length(t)
i=t(j);
x(j)=(exp(-2*i))*cos(i);
y(j)=(exp(2*i))*cos(i);
e(j)=(1/2)*(x(j)+y(j));
o(j)=(1/2)*(x(j)-y(j));
end
disp('In the plot even component is in red and odd component is in blue')
plot(t,e,'red')
plot(t,o,'blue')
|