Problem 1 I asked a student to generate a discrete time signal, which is the sum
ID: 2248290 • Letter: P
Question
Problem 1 I asked a student to generate a discrete time signal, which is the sum of a I volt, 100 Hz, cosine with zero phase, and a 500 mV, 77.7 Hz sine wave with an phase of 10 degrees. The signal is to have a sampling rate of 8000 samples per second, start at 0 seconds and student submitted the code below. end at 1 msec. The Point out any errors, or unnecessary code the student used. Please consider the first line, that I call housekeeping, necessary. % Line 1 % Line 2 % Line 3 clear ; close all; clc; s000; % Line 4 % Line 5 Line 6 xi-coatew2d * 1 00 * t) +0 . 5 * s in (2*pi*77.7*t+10);%Explanation / Answer
Code:
clear *; close all; clc;
fs=8000;
t_start=0;
t_stop=1e-3;
t = [0:1/fs:1e-3]; % t is increased in steps of 1/fs
x = cos(2*pi*100*t)+0.5*sin(2*pi*77.7*t+(10*pi/180)); % phase should be mentioned in radians
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.