P3.19 An analog signal xa (t) sin (1000?) ?s sampled using the following samplin
ID: 2291250 • Letter: P
Question
P3.19 An analog signal xa (t) sin (1000?) ?s sampled using the following sampling intervals. 1, T, = 0.1 ms: MATLAB script: sin ( 1000*pjtt); % P0319a: x-a(t) clc; close all; T-s 0.1 = = ms; Ts-0.0001; n- [-250:250] x- sin(1000*pi*n*Ts)linspace (-pi,pi,501); X = dtft(x,n,w); magk = abs (X) ; phaX = angle (X) ; Hf_1 -figure; set (Hf_1, 'NumberTitle''off' , 'Name', 'PO319a') subplot (2,1,1); plot (w/pi,magX, 'LineWidth',1.5); axis([-1 1 0 300]); wtick [-1:0.2:1]; magtick = [0:100 : 300]; set (gca ,,XTick',wtick); x1abel ( ,omega / pi , , , FontSize, ,LFS) ; ylabel ( , I ? , , , FontSize' ,LFS) ; title("Magnitude response x-1(n) = sin(1000 pi n T-s), T-s = 0.1 msec, , 'FontSize' ,TFS); set(gca, 'YTick' ,magtick) subplot (2,1,2); plot (w/pi,phaX*180/pi, 'LineWidth',1.5); axis([-1 1 -180 180]); wtick = [-1:0. 2:11; magtick = [-180:60: 180]; xlabel('omega/pi', 'FontSize' ,LFS); ylabel('Degrees', 'FontSize',LFS); title(phase response x-1(n) sin ( 1000 pi n T-s), T-s 0.1 msec, , 'FontSize' ,TFS); set (gca, 'XTick',wtick); set (gca, 'YTick',magtick); print -deps2 /EPSFILES/P0319a;Explanation / Answer
Note that in that code you have given a particular range of n from -250 to 250, but you are not incrementing n value.
You have to increment n value with a specific number.
Example:
n=[-250:1:250] %increments n value by 1 from -250 to -249 then -248 like wise upto 250
n=[-250:5:250]%increments n value by 5
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.