Need help with the question being ask for this MATLAB practice. Using version R2021b.  Question/request is in the image for the following code.  Need help with only 1a and 1b.  I do not know how to type it out into matlab. Please help.

icon
Related questions
Question

Need help with the question being ask for this MATLAB practice. Using version R2021b. 

Question/request is in the image for the following code. 

Need help with only 1a and 1b. 

I do not know how to type it out into matlab. Please help.

clear;
close all
fe = 2000; % signal freq. 2 kHz
T = 1/f0;
tmin = 0;
tmax = 5*T;
%%
%670
dt = 1/200000;
t = tmin:dt: tmax; % for continuous signal
fs1 = 10000; % sampling exmple1 = 10kHz
t1 = tmin: (1/fs1): tmax; %
x1 = sin(2*pi*f*t1);
X = sin(2*pi*fø*t); % continuous signal
%% Nyquist rate
% Problem to solove
% fs_Ny =
% t_Ny = tmin: (1/fs_Ny): tmax; %
% x _Ny = sin(2*pi*f*t_Ny);
%%
subplot (2,1,1)
plot(t,x);
hold on
stem (t1, x1);
title('10kHz sampling frequency')
% Problem to solove
% subplot (2,1,2)
% plot(t,x);
% hold on
% stem(t_Ny, x_Ny);
Open with
% continuous signal
% 10 kHz sampling
Page 2 / 2
Q +
Transcribed Image Text:clear; close all fe = 2000; % signal freq. 2 kHz T = 1/f0; tmin = 0; tmax = 5*T; %% %670 dt = 1/200000; t = tmin:dt: tmax; % for continuous signal fs1 = 10000; % sampling exmple1 = 10kHz t1 = tmin: (1/fs1): tmax; % x1 = sin(2*pi*f*t1); X = sin(2*pi*fø*t); % continuous signal %% Nyquist rate % Problem to solove % fs_Ny = % t_Ny = tmin: (1/fs_Ny): tmax; % % x _Ny = sin(2*pi*f*t_Ny); %% subplot (2,1,1) plot(t,x); hold on stem (t1, x1); title('10kHz sampling frequency') % Problem to solove % subplot (2,1,2) % plot(t,x); % hold on % stem(t_Ny, x_Ny); Open with % continuous signal % 10 kHz sampling Page 2 / 2 Q +
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.
(b)
x(n) = n[u(n)-u(n-10)]
0 ≤ n ≤ 20.
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.
Transcribed Image Text: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. (b) x(n) = n[u(n)-u(n-10)] 0 ≤ n ≤ 20. 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.
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer