Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 1

clc;close all; clear all;

t=[0:0.0001:2];
A=5;
f=2;
xt=A*sin(2*pi*f*t);

subplot(2,2,1);
plot(t,xt,'linewidth',2);
axis([0 4*(1/f) -A A])
xlabel('t(detik)');
ylabel('x(t)');
box('off');
grid('on');

n=[0:100];
fs=20;
Ts=1/fs;
nTs=n*Ts;
xn=A*sin(2*pi*f*nTs);

subplot(2,2,2);
h3=stem(n,xn,'.r','Linewidth',2);
axis([0 4*fs/f -A A])
xlabel('(sample ke n), Ts=1/20 detik');
ylabel('x(n)');
box('off');
grid('on');

5 5
x(n)
x(t)

0 0

-5 -5
0 0.5 1 1.5 2 0 10 20 30 40
t(detik) (sample ke n), Ts=1/20 detik

You might also like