Wireless and cellular telecommunications
1. Unit Ramp Signal: r(t) = t·u(t)
clc;
clear all;
close all;
t = -2:0.01:3; % Time vector
u = t >= 0; % Unit step signal
r = t .* u; % Unit ramp signal
subplot(2,1,1);
plot(t, r, 'b', 'LineWidth', 2);
title('Unit Ramp Signal - Plot');
xlabel('Time (t)');
ylabel('r(t)');
grid on;
subplot(2,1,2);
stem(t, r, 'r', 'filled');
title('Unit Ramp Signal - Stem');
xlabel('Time (t)');
ylabel('r(t)');
grid on;
2. Shifted Ramp Signal: r(t − 2) = (t − 2)·u(t − 2)
clc;
clear all;
close all;
t = -2:0.01:6;
r = (t - 2) .* (t >= 2); % Shifted unit ramp
plot(t, r, 'm', 'LineWidth', 2);
title('Shifted Ramp Signal: r(t - 2)');
xlabel('Time (t)');
ylabel('r(t - 2)');
grid on;
3. Custom Signal: r(t) = u(t) − 2·u(t + 1)
clc;
clear all;
close all;
t = -5:0.01:5;
u1 = heaviside(t); % u(t)
u2 = 2 * heaviside(t + 1); % 2·u(t+1)
r = u1 - u2; % Resulting signal
plot(t, r, 'k', 'LineWidth', 2);
title('r(t) = u(t) - 2·u(t + 1)');
xlabel('Time (t)');
ylabel('Amplitude');
grid on;
4. Constant Signal: x(t) = 1 for t ≤ 2
clc;
clear all;
close all;
t = -1:0.01:4;
x = t <= 2;
plot(t, x, 'g', 'LineWidth', 2);
title('Signal x(t) = 1 for t ≤ 2');
xlabel('Time (t)');
ylabel('x(t)');
axis([-1 4 -0.2 1.2]);
grid on;
0 Comments