1. Submit MATLAB programs and their plots of the following sequences over the indicated interval. (a) x(n) = 28(n + 2)-8(n-4), -5 ≤ n ≤ 5. 0 ≤n ≤ 20. (b) x(n) = n[u(n)-u(n-10)] 2. It is useful to plot the continuous time signal on the same plot. All signals in MATLAB are discrete-time, but they will look like continuous-time signals if the sampling rate is much higher than the Nyquist rate. Please fill in the "Problem to solve" region below to show the Nyquist rate. Submit the final code and its graph.
Need help with the question being ask for this MATLAB practice. Using version R2021b.
Question/request is in the image for the following code.
clear;
close all
%%
f0 = 2000; % signal freq. = 2 kHz
T = 1/f0;
tmin = 0;
tmax = 5*T;
%%
dt = 1/200000;
t = tmin:dt:tmax; % for continuous signal
fs1 = 10000; % sampling exmple1 = 10kHz
t1 = tmin:(1/fs1):tmax; %
x1 = sin(2*pi*f0*t1);
x = sin(2*pi*f0*t); % continuous signal
%% Nyquist rate
% Problem to solove
% fs_Ny =
% t_Ny = tmin:(1/fs_Ny):tmax; %
% x_Ny = sin(2*pi*f0*t_Ny);
%%
subplot(2,1,1)
plot(t,x); % continuous signal
hold on
stem(t1,x1); % 10kHz sampling
title('10kHz sampling frequency')
% Problem to solove
% subplot(2,1,2)
% plot(t,x);
% hold on
% stem(t_Ny, x_Ny);
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 3 images