Anda di halaman 1dari 31

Bab 2a

Sinyal-sinyal Waktu Diskrit


Kuliah PSD 01 (MFS4617)
agfi@ugm.ac.id

Sinyal Waktu Diskrit


Kategori sinyal:
Sinyal analog xa(t)
t bisa sembarang besaran fisik apapun
untuk PSD dianggap sebagai besaran waktu (detik);
Sinyal digital x(n)
n merupakan bilangan bulat yang
menyatakan instan diskrit dalam waktu
sinyal waktu-diskrit;

Tanda panah ke-atas

agfi@ugm.ac.id

cuplikan saat n=0;

II.A. Sinyal-sinyal Waktu Diskrit

Macam-macam Deret:
1. Deret Cuplik satuan unit sample
Fungsi zeros(1,N)
digunakan untuk
menghasilkan sebuah
vektor baris dengan
data nol (0)
sebanyak N;

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

Macam-macam Deret:
1. Deret Cuplik satuan unit sample

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

Macam-macam Deret:
2. Deret Langkah Satuan unit step
Fungsi ones(1,N)
digunakan untuk
menghasilkan sebuah
vektor baris dengan
data satu (1)
sebanyak N;

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

Macam-macam Deret:
2. Deret Langkah Satuan unit step

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

Macam-macam Deret:
3. Deret Eksponensial Nilai-Real Realvalued exponential

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

Macam-macam Deret:
3. Deret Eksponensial Nilai-Real Realvalued exponential

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

Macam-macam Deret:
4. Deret Eksponensial Nilai-Kompleks
Complex-valued exponential

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

Macam-macam Deret:
4. Deret Eksponensial Nilai-Kompleks
Complex-valued exponential

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

10

Macam-macam Deret:
5. Deret Sinusoidal
: merupakan fase
dalam radian;
Untuk implementasi
deret
(untuk 0 = n = 10)
x (n) = 3 cos(0.1 n + / 3) + 2 sin(0.5 n)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

11

Macam-macam Deret:
5. Deret Sinusoidal

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

12

Macam-macam Deret:
6. Deret Acak
Dicirikan dengan PDF Probability
Density Function;
Menggunakan rand(1,N):
Deret acak dengan panjang N terdistribusi
merata (uniformly distributed) antara 0-1;

Menggunakan randn(1,N):
Deret acak Gaussian dengan rerata 0 dan
varians 1;
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

13

Macam-macam Deret:
6. Deret Acak

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

14

Macam-macam Deret:
7. Deret Periodik
Sebuah deret
dikatakan periodik jika

x (n) = x (n + N ), n

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

15

Macam-macam Deret:
7. Deret Periodik

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

16

Operasi Deret:
1-Penjumlahan sinyal

function [y,n] = sigadd(x1,n1,x2,n2)


% implements y(n) = x1(n)+x2(n)
% ----------------------------% [y,n] = sigadd(x1,n1,x2,n2)
%
y = sum sequence over n, which includes n1 and n2
% x1 = first sequence over n1
% x2 = second sequence over n2 (n2 can be different from n1)
%
n = min(min(n1),min(n2)):max(max(n1),max(n2)); % duration of y(n)
y1 = zeros(1,length(n)); y2 = y1;
% initialization
y1(find((n>=min(n1))&(n<=max(n1))==1))=x1;
% x1 with duration of y
y2(find((n>=min(n2))&(n<=max(n2))==1))=x2;
% x2 with duration of y
y = y1+y2;
% sequence addition

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

17

Operasi Deret:
2-Perkalian sinyal

function [y,n] = sigmult(x1,n1,x2,n2)


% implements y(n) = x1(n)*x2(n)
% ----------------------------% [y,n] = sigmult(x1,n1,x2,n2)
%
y = product sequence over n, which includes n1 and n2
% x1 = first sequence over n1
% x2 = second sequence over n2 (n2 can be different from n1)
%
n = min(min(n1),min(n2)):max(max(n1),max(n2)); % duration of y(n)
y1 = zeros(1,length(n)); y2 = y1;
%
y1(find((n>=min(n1))&(n<=max(n1))==1))=x1;
% x1 with duration of y
y2(find((n>=min(n2))&(n<=max(n2))==1))=x2;
% x2 with duration of y
y = y1 .* y2;
% sequence multiplication

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

18

Operasi Deret:
3-Penskalaan sinyal

Masing-masing cuplikan dikalikan dengan suatu


konstanta;
Menggunakan operator * pada MATLAB;

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

19

Operasi Deret:
4-Penggeseran sinyal
Masing-masing cuplikan x(n) digeser sebanyak k
sehingga dihasilkan y(n)
y(n)={x(n-k)};
Jika m=n-k n=m+k
y(m+k)={x(m)};
Dengan demikian, operasi tidak berpengaruh pada
vektor x, tetapi vektor n berubah dengan menambahkan
nilai k pada masing-masing elemen:
function [y,n] = sigshift(x,m,n0)
% implements y(n) = x(n-n0)
% ------------------------% [y,n] = sigshift(x,m,n0)
%
n = m+n0; y = x;
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

20

Operasi Deret:
5-Pelipatan sinyal
Pada operasi ini, tiap-tiap cuplikan dari x(n)
dilipat pada n=0
y(n) = {x(-n)};
Untuk MATLAB digunakan bantuan fungsi
fliplr untuk melipat x dan fliplr untuk
melipat indeks-nya:
function [y,n] = sigfold(x,n)
% implements y(n) = x(-n)
% ----------------------% [y,n] = sigfold(x,n)
%
y = fliplr(x); n = -fliplr(n);
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

21

Operasi Deret:
6-Penjumlahan cuplikan

Operasi ini berbeda dengan penjumlahan sinyal,


karena yang dijumlahkan adalah tiap-tiap
elemen dalam x(n) (semuanya)
y(n):
Gunakan sum(x(n1:n2)); dalam MATLAB;
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

22

Operasi Deret:
7-Perkalian cuplikan

Operasi ini berbeda dengan perkalian sinyal,


karena yang dikalikan adalah tiap-tiap elemen
dalam x(n) (semuanya)
y(n):
Gunakan prod(x(n1:n2)); dalam MATLAB;
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

23

Operasi Deret:
8-Energi Sinyal

Tanda bintang pada x(n) merupakan tanda konjugasi


kompleks
perhatikan penempatan tandanya
x*(n)
konjugasi (superscript), MATLAB-nya:
Ex = sum(x .* conj(x)); % suatu pendekatan
Ex = sum(abs(x).^2);
% pendekatan lain
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

24

Operasi Deret:
9-Daya Sinyal

Daya rerata dari suatu sinyal periodik dengan


periode dasar N

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

25

Contoh 2.1: Pertanyaan

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

26

Contoh 2.1: Jawaban (a)


n = [-5:5];
x = 2*impseq(-2,-5,5)-impseq(4,-5,5);
stem(n,x);
title('Sequence in Example 2.1a');
xlabel('n');
ylabel('x(n)');
axis([-5,5,-2,3])

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

27

Contoh 2.1: Jawaban (a)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

28

Contoh 2.1: Jawaban (b)


n = [0:20];
x1 = n.*(stepseq(0,0,20)-stepseq(10,0,20));
x2 = 10*exp(-0.3*(n-10)).*(stepseq(10,0,20)stepseq(20,0,20));
x = x1+x2;
stem(n,x);
title('Sequence in Example 2.1b');
xlabel('n');
ylabel('x(n)');
axis([0,20,-1,11])

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

29

Contoh 2.1: Jawaban (b)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

30

10

Contoh 2.1: Jawaban (c)


n = [0:50];
x = cos(0.04*pi*n)+0.2*randn(size(n));
stem(n,x);
title('Sequence in Example 2.1c');
xlabel('n');
ylabel('x(n)');
axis([0,50,-1.4,1.4])

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

31

Contoh 2.1: Jawaban (c)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

32

Contoh 2.1: Jawaban (d)


n=[-10:9];
x=[5,4,3,2,1];
xtilde=x' * ones(1,4);
xtilde=(xtilde(:))';
stem(n,xtilde);
title('Sequence in Example 2.1d')
xlabel('n');ylabel('xtilde(n)');
axis([-10,9,-1,6])
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

33

11

Contoh 2.1: Jawaban (d)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

34

Contoh 2.1: Jawaban (a,b,c dan d)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

35

Contoh 2.2: Pertanyaan

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

36

12

Contoh 2.2: Jawaban (a)


[x11,n11] = sigshift(x,n,5);
[x12,n12] = sigshift(x,n,-4);
[x1,n1] = sigadd(2*x11,n11,-3*x12,n12);
stem(n1,x1);
title('Sequence in Example 2.2a')
xlabel('n');
ylabel('x1(n)');
axis([min(n1)-1,max(n1)+1,min(x1)-1,max(x1)+1])
set(gca,'XTickMode','manual','XTick',[min(n1),0,max(
n1)])

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

37

Contoh 2.2: Jawaban (a)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

38

Contoh 2.2: Jawaban (b)


[x21,n21] = sigfold(x,n);
[x21,n21] = sigshift(x21,n21,3);
[x22,n22] = sigshift(x,n,2);
[x22,n22] = sigmult(x,n,x22,n22);
[x2,n2] = sigadd(x21,n21,x22,n22);
stem(n2,x2);
title('Sequence in Example 2.2b')
xlabel('n'); ylabel('x2(n)');
axis([min(n2)-1,max(n2)+1,0,40])
set(gca,'XTickMode','manual','XTick',[min(n2),0,max(
n2)])

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

39

13

Contoh 2.2: Jawaban (b)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

40

Contoh 2.2: Jawaban (a dan b)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

41

Contoh 2.3: Pertanyaan

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

42

14

Contoh 2.3: Jawaban


n = [-10:1:10]; alpha = -0.1+0.3j;
x = exp(alpha*n);
subplot(2,2,1); stem(n,real(x));
title('real part');xlabel('n')
subplot(2,2,2); stem(n,imag(x));
title('imaginary part');xlabel('n')
subplot(2,2,3); stem(n,abs(x));
title('magnitude part');xlabel('n')
subplot(2,2,4); stem(n,(180/pi)*angle(x));
title('phase part');xlabel('n')
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

43

Contoh 2.3: Jawaban

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

44

Beberapa hasil Penting

Sintesa cuplikan satuan (unit


sample synthesis)
sembarang deret x(n) dapat
disintesa sebagai jumlahan
deret cuplik satuan berbobot,
tertunda dan terskala
Sintesa ganjil & genap (even
& odd synthesis)
deret
bilangan-nyata x(n) dinamakan
genap (even) jika:
xe(-n) = xe(n)
Dinamakan ganjil (odd) jika:
xo(-n) = -xo(n)

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

45

15

Beberapa hasil Penting


Dengan demikian sembarang deret x(n)
dapat di-dekomposisi menjadi komponen
genap dan ganjil:
x(n) = xe(n) + xo(n)
dengan bagian genap dan ganjilnya:
xe(n) = [x(n)+x(-n)]
xo(n) = [x(n)-x(-n)]
Matlabnya
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

46

Beberapa hasil Penting


function [xe, xo, m] = evenodd(x,n)
% Real signal decomposition into even and odd parts
% ------------------------------------------------% [xe, xo, m] = evenodd(x,n)
%
if any(imag(x) ~= 0)
error('x is not a real sequence')
end
m = -fliplr(n);
m1 = min([m,n]); m2 = max([m,n]); m = m1:m2;
nm = n(1)-m(1); n1 = 1:length(n);
x1 = zeros(1,length(m));
x1(n1+nm) = x; x = x1;
xe = 0.5*(x + fliplr(x));
xo = 0.5*(x - fliplr(x));
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

47

Contoh 2.4: Pertanyaan

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

48

16

Contoh 2.4: Jawaban


n = [0:10];
x = stepseq(0,0,10)-stepseq(10,0,10);
[xe,xo,m] = evenodd(x,n);
subplot(1,1,1)
subplot(2,2,1); stem(n,x);
title('Rectangular pulse')
xlabel('n'); ylabel('x(n)'); axis([-10,10,0,1.2])
subplot(2,2,2); stem(m,xe); title('Even Part')
xlabel('n'); ylabel('xe(n)'); axis([-10,10,0,1.2])
subplot(2,2,4); stem(m,xo); title('Odd Part')
xlabel('n'); ylabel('xe(n)');
axis([-10,10,-0.6,0.6])

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

49

Contoh 2.4: Jawaban

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

50

Beberapa hasil Penting


Deret Geometrik
(Geometric Series)
deret eksponensial
satu-sisi dalam
bentuk {Jn, n K 0},
dengan J merupakan
konstanta
sembarang;
Deret akan konvergen
|J| < 1;
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

51

17

Beberapa hasil Penting


Korelasi Deret
(correlations of
sequences)
mengukur derajat
kesamaan dua deret;
Definisi
kroskorelasi
Definisi
autokorelasi
Akan dibahas nanti
agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

52

Bersambung...
Berikutnya...
2B: Sistem-sistem Waktu Diskrit, Konvolusi dan
Persamaan Beda!

agfi@ugm.ac.id

II.A. Sinyal-sinyal Waktu Diskrit

53

18

Bab 2b
Sistem-sistem Waktu Diskrit,
Konvolusi dan Persamaan Beda
Kuliah PSD 01 (MFS4617)
agfi@ugm.ac.id

Pendahuluan
Sistem diskrit
dinyatakan dengan
operator T[.] yang membawa deret x(n)
(eksitasi) menjadi deret lain y(n) (tanggap
atau response)
y(n) = T[x(n)];
Sistem diskrit
sinyal masukan menjadi
sinyal keluaran;
Sistem diskrit:
Linear, dan
Non-inear
agfi@ugm.ac.id

prinsip
superposisi

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Sistem Linear

tanggap impuls
agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Sistem Linear Time-Invariant

Linear Time-Invariant (LTI)


sistem yang pasangan masukan dan
keluarannya, x(n) dan y(n), tidak berubah terhadap penggeseran n:

Bisa juga dituliskan sebagai:

Tanggap impuls sistem dinyatakan oleh h(n)


konvolusi linear:

penjumlahan

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Linear Time-Invariant

Dengan demikian
sistem LTI dinyatakan dalam ranah waktu
melalui tanggap impuls-nya h(n):

Stabilitas
output):

atau jika tanggap impuls-nya dapat dijumlah secara absolut:

Kausalitas

agfi@ugm.ac.id

dikatakan stabil BIBO (Bounded-input Bounded-

untuk memastikan sistem dapat dibuat:

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Konvolusi

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Solusi Contoh 2.5

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Solusi Contoh 2.5

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Solusi Contoh 2.5


n = -5:50;
u1 = stepseq(0,-5,50); u2=stepseq(10,-5,50);
% input x(n)
x = u1-u2;
% impulse response h(n)
h = ((0.9).^n).*u1;
subplot(1,1,1)
subplot(2,1,1); stem(n,x); axis([-5,50,0,2])
title('Input Sequence')
xlabel('n'), ylabel('x(n)')
subplot(2,1,2); stem(n,h); axis([-5,50,0,2])
title('Impulse Response')
xlabel('n'), ylabel('h(n)'); pause
% output response
y = (10*(1-(0.9).^(n+1))).*(u1-u2)+(10*(1-(0.9)^10)*(0.9).^(n-9)).*u2;
subplot(1,1,1)
subplot(2,1,2); stem(n,y); axis([-5,50,0,8])
title('Output Sequence')
xlabel('n'), ylabel('y(n)')

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Solusi Contoh 2.5


Input Sequence
2

x(n)

1.5

0.5

0
-5

10

15

20

25

30

35

40

45

50

30

35

40

45

50

n
Impulse Response
2

h(n)

1.5

0.5

0
-5

10

15

20

25
n

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

10

Solusi Contoh 2.5

Output Sequence
8

y(n)

0
-5

10

15

20

25

30

35

40

45

50

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

11

Konvolusi Grafis

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

12

Konvolusi Grafis
% input x(n)
x = [3,11,7,0,-1,4,2]; nx = [-3:3];
% impulse response h(n)
h = [2,3,0,-5,2,1]; nh = [-1:4];
subplot(1,1,1)
% plot x(k) and h(k)
subplot(2,2,1); stem(nx-0.05,x); axis([-5,5,-6,12]);
hold on; stem(nh+0.05,h,':')
title('x(k) and h(k)');xlabel('k');
text(-0.5,11,'solid: x
dashed: h'); hold off
% plot x(k) and h(-k)
subplot(2,2,2); stem(nx-0.05,x); axis([-5,5,-6,12]);
hold on; stem(-fliplr(nh)+0.05,fliplr(h),':')
title('x(k) and h(-k)');xlabel('k');
text(-0.5,-1,'n=0')
text(-0.5,11,'solid: x
dashed: h'); hold off
agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

13

Konvolusi Grafis
% plot x(k) and h(-1-k)
subplot(2,2,3); stem(nx-0.05,x); axis([-5,5,-6,12]);
hold on; stem(-fliplr(nh)+0.05-1,fliplr(h),':')
title('x(k) and h(-1-k)');xlabel('k');
text(-1.5,-1,'n=-1')
text(-0.5,11,'solid: x
dashed: h'); hold off
% plot x(k) and h(2-k)
subplot(2,2,4); stem(nx-0.05,x); axis([-5,5,-6,12]);
hold on; stem(-fliplr(nh)+0.05+2,fliplr(h),':')
title('x(k) and h(2-k)');xlabel('k');
text(2-0.5,-1,'n=2')
text(-0.5,11,'solid: x
dashed: h'); hold off

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

14

Solusi Contoh 2.6


x(k) and h(k)
10

solid: x

x(k) and h(-k)


dashed: h

10

-5

-5

-5

0
k

-5

x(k) and h(-1-k)


solid: x

dashed: h

10

-5

0
k

solid: x

dashed: h

n=-1

-5

agfi@ugm.ac.id

n=0

x(k) and h(2-k)

dashed: h

10

solid: x

n=2

-5
0
k

-5

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

0
k

15

Konvolusi: Implementasi MATLAB


Menggunakan fungsi conv();
y = conv(x,h);
Merujuk contoh 2.3:
x = [3, 11, 7, 0, -1, 4, 2];
h = [2, 3, 0, -5, 2, 1];
y = conv(x,h);

Perhatikan hasilnya!
Agar diperoleh informasi waktu (diskrit):
Sehingga:
agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

16

Konvolusi: Implementasi MATLAB


function [y,ny] = conv_m(x,nx,h,nh)
% Modified convolution routine for signal processing
% -------------------------------------------------% [y,ny] = conv_m(x,nx,h,nh)
% y = convolution result
% ny = support of y
% x = first signal on support nx
% nx = support of x
% h = second signal on support nh
% nh = support of h
%
nyb = nx(1)+nh(1); nye = nx(length(x)) + nh(length(h));
ny = [nyb:nye];
y = conv(x,h);

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

17

Contoh 2.7: Penggunaan conv_m()


untuk contoh 2.6
>> x = [3, 11, 7, 0, -1, 4, 2]; nx = [-3:
3];
>> h = [2, 3, 0, -5, 2, 1]; nh = [-1: 4];
>> [y,ny] = conv_m(x,nx,h,nh)
y =
6

31

47

-51

-5

41

18

-22

-3

-4

-3

-2

-1

ny =

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

18

Korelasi: ditinjau kembali


Kroskorelasi ryx(l) menggunakan
persamaan:
rxy(l) = y(l) * x(-l)
Sedangkan autokorelasi rxx(l)
menggunakan persamaan:
rxx(l) = x(l) * x(-l)
Perhatikan contoh 2.8 berikut
agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

19

Contoh 2.8

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

20

Solusi Contoh 2.8


>> x = [3, 11, 7, 0, -1, 4, 2]';
>> h = [2, 3, 0, -5, 2, 1]';
>> [y,H] = conv_tp(h,x)
y =
6
31
47
6
-51
-5
41
18
-22
-3
8
2
agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

21

Solusi Contoh 2.8


H =
2
3
0
-5
2
1
0
0
0
0
0
0
agfi@ugm.ac.id

0
2
3
0
-5
2
1
0
0
0
0
0

0
0
2
3
0
-5
2
1
0
0
0
0

0
0
0
2
3
0
-5
2
1
0
0
0

0
0
0
0
2
3
0
-5
2
1
0
0

0
0
0
0
0
2
3
0
-5
2
1
0

0
0
0
0
0
0
2
3
0
-5
2
1

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

22

Persamaan Beda
Sebuah sistem LTI bisa dinyatakan melalui persamaan
beda:

Jika an # 0 maka persamaan bedanya ordenya N;


Praktisnya dihitung secara maju (dari n=-T hingga +T),
sehingga:

Penyelesaian persamaan ini dalam bentuk:

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

23

Persamaan Beda
Bagian homogen dinyatakan dengan:

Dengan zk, k=1,,N merupakan N akar dari persamaan


karakteristik:
Persamaan karakteristik ini penting untuk menentukan
stabilitas sistem. Jika akara-akar zk memeuhi kondisi
berikut ini, maka sebuah sistem kausal yang dinyatakan
oleh persamaan 2.19 adalah stabil:

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

24

Pers. Beda: Implementasi MATLAB


Menggunakan fungsi filter();
y = filter(b,a,x);

dengan
b = [ b0, b1, , bM];
a = [a0, a1, , aN];

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

25

Contoh 2.9

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

26

Solusi Contoh 2.9


% noise sequence 1
x = [3, 11, 7, 0, -1, 4, 2]; nx=[-3:3]; % given signal x(n)
[y,ny] = sigshift(x,nx,2);
% obtain x(n-2)
w = randn(1,length(y)); nw = ny;
% generate w(n)
[y,ny] = sigadd(y,ny,w,nw);
% obtain y(n)=x(n-2)+w(n)
[x,nx] = sigfold(x,nx);
% obtain x(-n)
[rxy,nrxy] = conv_m(y,ny,x,nx);
% cross-corrlation
subplot(1,1,1)
subplot(2,1,1);stem(nrxy,rxy)
axis([-4,8,-50,250]);xlabel('lag variable l')
ylabel('rxy');title('Crosscorrelation: noise sequence 1')
gtext('Maximum')

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

27

Solusi Contoh 2.9


% noise sequence 2
x = [3, 11, 7, 0, -1, 4, 2]; nx=[-3:3]; % given signal x(n)
[y,ny] = sigshift(x,nx,2);
% obtain x(n-2)
% generate w(n)
w = randn(1,length(y)); nw = ny;
% obtain y(n)=x(n-2)+w(n)
[y,ny] = sigadd(y,ny,w,nw);
[x,nx] = sigfold(x,nx);
% obtain x(-n)
% cross-corrlation
[rxy,nrxy] = conv_m(y,ny,x,nx);
subplot(2,1,2);stem(nrxy,rxy)
gtext('Maximum')
axis([-4,8,-50,250]);xlabel('lag variable l')
ylabel('rxy');title('Crosscorrelation: noise sequence 2')

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

28

Solusi Contoh 2.9


Crosscorrelation: noise sequence 1
250
Maximum

200

rxy

150
100
50
0
-50
-4

-2

2
lag variable l

Crosscorrelation: noise sequence 2


250
Maximum

200

rxy

150
100
50
0
-50
-4

agfi@ugm.ac.id

-2

2
lag variable l

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

29

Contoh 2.10

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

30

10

Contoh 2.10

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

31

Solusi Contoh 2.10


a=[1,-1,0.9];b=1;
% Part a)
x=impseq(0,-20,120);n=[-20:120];
h=filter(b,a,x);
subplot(2,1,1);stem(n,h)
axis([-20,120,-1.1,1.1])
title('Impulse Response');xlabel('n');ylabel('h(n)')
%
% Part b)
x=stepseq(0,-20,120);
s=filter(b,a,x);
subplot(2,1,2);stem(n,s)
axis([-20,120,-.5,2.5])
title('Step Response');xlabel('n');ylabel('s(n)')
%
%print -deps2 ex021000.eps
%
% Part c)
sum(abs(h))
z=roots(a);
magz=abs(z)
subplot
agfi@ugm.ac.id
II.B. Sistem Waktu Diskrit,
Konvolusi dan PB

32

Solusi Contoh 2.10


Impulse Response
1

h(n)

0.5
0
-0.5
-1
-20

20

40

60

80

100

120

80

100

120

n
Step Response
2.5
2

s(n)

1.5
1
0.5
0
-0.5
-20

20

40

60
n

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

33

11

Solusi Contoh 2.10


ans =
14.8785

magz =
0.9487
0.9487
agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

34

Tanggap Masukan-Nol dan


Kondisi-Nol
Karena penyelesaian persamaan beda mulai dari n=0
(forward), maka diperlukan kondisi awal untuk x(n) dan
y(n) untuk menentukan keluaran untuk n K 0, sehingga
persamaan beda dituliskan menjadi:

dengan kondisi awal:

Solusi persamaan (2.21) diperoleh dalam bentuk:


Zero-Input
solution
agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

Zero-State
solution x(n)

35

Penapis Digital
Penapis FIR (Finite Impulse Response) juga dinamakan
non-rekursif atau moving average (MA)
jika tanggap
impuls-nya berhingga, atau h(n)=0 untuk n < n1 dan n>
n2 (filter(b,1,x)):

Penapis IIR (Infinite Impulse Response) juga dinamakan


rekursif (menggunakan keluaran sebelumnya) atau
autoregressive (AR) (filter(b,a,x)):

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

36

12

Terima Kasih!
Sinyal-Sinyal dan Sistem-sistem Diskrit
selesai...
Berikutnya:
3A: Transformasi Fourier Waktu-Diskrit!

agfi@ugm.ac.id

II.B. Sistem Waktu Diskrit,


Konvolusi dan PB

37

13

Anda mungkin juga menyukai