Rowan-Classes/6th-Semester-Spring-2024/DSP/Labs/Lab-02/Lab2Question4.m
2024-02-23 21:42:45 -05:00

23 lines
389 B
Matlab

% 4a
% % Define the signal
% n = 0:50;
% a = pi/4;
% a^2
% x = 5*cos(a^2 * n).*heaviside(n);
%
% % Plot
% stem(n, x);
% xlabel('n');
% ylabel('x(n)');
% title('Signal x(n) = 5cos(\pi^2n/16)u(n)');
% 4b
% Define the signal
A = 5;
b = (1 + 1j) / 2;
x = A * abs(b).^n .* heaviside(n);
% Plot
stem(n, x);
xlabel('n');
ylabel('x(n)');
title('Signal x(n) = 5|b|^n u(n)');