Professional Documents
Culture Documents
lab2data
lab2data
signal x(t)=e^2t
t = -3:0.1:3;
t = -3:0.1:3;
x1 = exp(2*t);
x2 = exp(-2*t);
if(x1==x2)
disp('even signal')
elseif(x2==(-x1))
disp('odd signal')
else
end
subplot(2,2,1);
plot(t, x1);
xlabel('Time (t)');
ylabel('amplitude)');
subplot(2,2,2);
plot(t, x2);
xlabel('Time (t)');
ylabel('amplitude)');
subplot(2,2,3);
plot(t, x_e);
xlabel('Time (t)');
ylabel('x_e(t)');
subplot(2,2,4);
plot(t, x_o);
xlabel('Time (t)');
ylabel('x_o(t)');
write a matlab program to find to find the energy and power of the signal
x(t)=10sin(10pi*t)
t = -10:0.01:10;
T=10
x = 10 * sin(10 * pi * t);
x_sq=x.^2
output:
Energy of the signal: 1000joules
Power of the signal: 50watt
t = -3:0.1:5;
y0 = x(t);
y1 = 1.5*x(t);
y2 = 0.5*x(t);
y3 = x(2*t);
y4 = x(0.5*t);
y5 = x(t-2);
y6 = x(t+2);
subplot(4,2,1);
plot(t,y0);
xlabel('Time -t');
ylabel('Amplitude');
plot(t,y1);
xlabel('Time -t');
ylabel('Amplitude');
title('Amplification of x(t)');
subplot(4,2,3);
plot(t,y2);
xlabel('Time -t');
ylabel('Amplitude');
title('Attenuation of x(t)');
subplot(4,2,4);
plot(t,y3);
xlabel('Time -t');
ylabel('Amplitude');
title('compression of x(t)');
subplot(4,2,5);
plot(t,y4);
xlabel('Time -t');
ylabel('Amplitude');
title('Expansion x(t)');
subplot(4,2,6);
plot(t,y5);
xlabel('Time -t');
ylabel('Amplitude');
title('Delay of x(t)');
subplot(4,2,7);
plot(t,y6);
xlabel('Time -t');
ylabel('Amplitude');
title('Advance of x(t)');
% = 2: 1<t<2
% = 1: 2<t<3
%x2(t) = t: 0<t<1
% = 1: 1<t<2
% = 3-t: 2<t<3
t= tmin:dt:tmax;
x1 = 1;
x2 = 2;
x3 = 3 - t;
xadd = xa + xb;
xmul = xa .* xb;
xsub = xa - xb;
xdiv = xa ./ xb;
xlabel('t');ylabel('xa(t)');title('Signal xa(t)');
xlabel('t');ylabel('xb(t)');title('Signal xb(t)');
xlabel('t');ylabel('xmul(t)');title('Signal xmul(t)');
xlabel('t');ylabel('xsub(t)');title('Signal xsub(t)');
xlabel('t');ylabel('xdiv(t)');title('Signal xdiv(t)');