C - 2205551121 - Adriant Satrio Putra 1
C - 2205551121 - Adriant Satrio Putra 1
C - 2205551121 - Adriant Satrio Putra 1
NIM : 2205551121
Kelas :C
TRANSFORMASI CITRA
SOAL
1. Buatlah transformasi walsh dan hadamart untuk citra dengan ukuran 4x4 dengan range
nilai dari 80-200 untuk citra rgb 8 bit.
2. Buatlah transformasi fourier 2 dimensi dengan ukuran citra 2x2 dengan nilai warna acak,
hitung magnitude nya atau spektrum fouriernya
JAWABAN
1. Walsh dan Hadamard
Citra 4x4
80 160 190 100
Walsh
W(0,0) = 80 + 160 + 190 + 100 + 100 + 140 + 200 + 170 + 120 + 110 + 120 + 200 + 150 + 180 +
130 + 150/4
W(0,0) = 2300/4
W(0,0) = 575
W(0,1) = 80 + 160 + 100 + 140 + 120 + 110 + 150 + 180 – 190 -100 – 200 – 170 – 120 – 200 –
130 – 150/4
W(0,1) = -220/4
W(0,1) = -55
W(0,2) = 80 + 100 + 120 + 150 – 160 – 140 – 110 – 180 + 190 + 200 + 120 + 130 – 100 – 170 –
200 – 150/4
W(0,2) = -120/4
W(0,2) = -30
W(0,3) = 80 + 100 + 120 + 150 – 160 – 140 – 110 – 180 – 190 – 200 – 120 – 130 + 100 + 170 +
200 + 150/4
W(0,3) = -160/4
W(0,3) = -40
W(1,0) = 80 + 160 + 190 + 100 + 100 + 140 + 200 + 170 – 120 – 110 – 120 – 200 - 150 – 180 –
130 – 150/3
W(1,1) = -20/4
W(1,1) = -5
W(1,1) = 80 + 160 + 100 + 140 – 190 – 100 – 200 – 170 - 120 + 110 + 150 + 180 – 120 – 200 –
130 – 150/4
W(1,1) = -460/4
W(1,1) = -115
W(1,2) = 80 + 100 – 160 – 140 + 190 + 200 – 100 – 170 – 120 – 150 + 110 + 180 – 120 – 130 +
200 + 150/4
W(1,2) = 120/4
W(1,2) = 30
W(1,3) = 80 + 100 – 160 – 140 – 190 – 200 + 100 + 170 + 120 + 150 – 110 – 180 – 120 – 130 +
200 + 150/4
W(1,3) = -160/4
W(1,3) = - 40
W(2,0) = 80 + 160 + 190 + 100 – 100 – 140 – 200 – 170 + 120 + 110 + 120 + 200 – 150 – 180 –
130 – 150/4
W(2,0) = -140/4
W(2,0) = -35
W(2,1) = 80 + 160 + 190 – 100 – 100 – 140 + 200 + 170 + 120 + 110 – 120 – 200 – 150 – 180 –
130 – 150/4
W(2,1) = -240/4
W(2,1) = -60
W(2,2) = 80 – 160 + 190 – 100 – 100 + 140 – 200 + 170 + 120 – 110 + 120 – 200 – 150 + 180 –
130 + 150/4
W(2,2) = 0/4
W(2,2) = 0
W(2,3) = 80 – 160 – 190 + 100 – 100 + 140 + 200 – 170 – 120 + 110 + 120 – 200 + 150 + 180 +
130 – 150/4
W(2,3) = 140/4
W(2,3) = 35
W(3,0) = 80 + 160 + 190 + 100 – 100 – 140 – 200 – 170 + 120 + 110 + 120 + 200 – 150 – 180 –
130 – 150/4
W(3,0) = -140/4
W(3,0) = -35
W(3,1) = 80 + 160 + 190 – 100 – 100 – 140 + 200 + 170 – 120 – 110 + 120 + 200 + 150 + 180 –
130 – 150/4
W(3,1) = 620/4
W(3,1) = 155
W(3,2) = 80 – 160 + 190 – 100 – 100 + 140 – 200 + 170 – 120 + 110 – 120 + 200 + 150 – 180 +
130 – 150/4
W(3,2) = 40/4
W(3,2) = 10
W(3,3) = 80 – 160 – 190 + 100 -100 + 140 + 200 – 170 – 120 + 110 + 120 – 200 + 150 – 180 –
130 + 150/4
W(3,3) = -200/4
W(3,3) = -50
Hasil Transformasi Walsh :
578 -55 -30 -40
-5 -115 30 -40
-35 -60 0 35
-35 155 10 -50
Citra 4x4
90 160 190 100
100 140 200 170
120 110 120 200
150 180 130 150
H(0,0) = 90 + 160 + 190 + 100 + 100 + 140 + 200 + 170 + 120 + 110 + 120 + 200 + 150 + 180 +
130 + 150/4
H(0,0) = 2310/4
H(0,0) = 578
H(0,1) = 90 + 160 + 100 + 140 + 120 + 110 + 150 + 180 – 190 -100 – 200 – 170 – 120 – 200 –
130 – 150/4
H(0,1) = -210/4
H(0,1) = -53
H(0,2) = 90 + 100 + 120 + 150 – 160 – 140 – 110 – 180 – 190 – 200 – 120 – 130 + 100 + 170 +
200 + 150/4
H(0,2) = -150/4
H(0,2) = -38
H(0,3) = 90 + 100 + 120 + 150 – 160 – 140 – 110 – 180 + 190 + 200 + 120 + 130 – 100 – 170 –
200 – 150/4
H(0,3) = -110/4
H(0,3) = -28
H(1,0) = 90 + 160 + 190 + 100 + 100 + 140 + 200 + 170 – 120 – 110 – 120 – 200 - 150 – 180 –
130 – 150/4
H(1,0) = -10/4
H(1,0) = -3
H(1,1) = 90 + 160 + 100 + 140 – 190 – 100 – 200 – 170 – 120 + 110 + 150 + 180 – 120 – 200 –
130 – 150/4
H(1,1) = -450/4
H(1,1) = -113
H(1,2) = 90 + 100 – 160 – 140 – 190 – 200 + 100 + 170 + 120 + 150 -110 – 180 -120 – 130 + 200
+ 150/4
H(1,2) = -150/4
H(1,2) = -38
H(1,3) = 90 + 100 – 160 – 140 + 190 + 200 – 100 – 170 – 120 – 150 + 110 + 180 – 120 – 130 +
200 + 150/4
H(1,3) = 130/4
H(1,3) = 33
H(2,0) = 90 + 160 + 190 + 100 – 100 – 140 – 200 – 170 + 120 + 110 + 120 + 200 – 150 -180 –
130 – 150/4
H(2,0) = -130/4
H(2,0) = -33
H(2,1) = 90 + 160 + 190 – 100 – 100 – 140 + 200 + 170 – 120 – 110 + 120 + 200 + 150 -180 –
130 – 150/4
H(2,1) = 250/4
H(2,1) = 63
H(2,2) = 90 - 160 - 190 + 100 – 100 + 140 + 200 - 170 – 120 + 110 + 120 - 200 + 150 -180 - 130
+ 150/4
H(2,2) = -190/4
H(2,2) = -48
H(2,3) = 90 - 160 + 190 – 100 – 100 + 140 - 200 + 170 – 120 + 110 - 120 + 200 + 150 -180 + 130
– 150/4
H(2,3) = 50/4
H(2,3) = 13
H(3,0) = 90 + 160 + 190 + 100 – 100 – 140 - 200 - 170 + 120 + 110 + 120 + 200 - 150 -180 – 130
– 150/4
H(3,0) = -130/4
H(3,0) = -33
H(3,1) = 90 + 160 + 190 – 100 – 100 – 140 + 200 + 170 + 120 + 110 - 120 - 200 - 150 -180 – 130
– 150/4
H(3,1) = -230/4
H(3,1) = -58
H(3,2) = 90 - 160 - 190 + 100 – 100 + 140 + 200 - 170 – 120 + 110 + 120 - 200 + 150 +180 + 130
– 150/4
H(3,2) = 130/4
H(3,2) = 33
H(3,3) = 90 - 160 + 190 – 100 – 100 + 140 - 200 + 170 + 120 – 110 + 120 - 200 - 150 + 180 – 130
+ 150/4
H(3,3) = 10/4
H(3,3) = 3
Hasil Transformasi Hadamart :
575 -53 -38 -28
-3 -113 -38 33
-33 63 -48 13
-33 -58 33 3
Menghitung F(u,v) :
1 1 uX Vy
j2𝜋 ( +
)
F(u, v) = ∑ = 0 ∑ = 0 F(x, y). e 2 2
X y
0 0
F(0,0) = 60.e-j2𝜋 (0 + 0 ) = 60
2 2
0 1 1
F(0,1) = 60.e-j2𝜋 (0 + 0 ) + 80. e -j2𝜋 (0 0 + 1 ) = 60 - 80j
2 2 2 2
1 0 0
F(1,0) = 60.e-j2𝜋 (1 + 0 ) + 140. e -j2𝜋 (1 1 + 0 ) = 60 + 140j
2 2 2 2
1 1 1 1
F(1,1) = 60.e-j2𝜋 (1 + 1 ) + 80. e -j2𝜋 (1 1 + 1 ) + 140. e -j2𝜋 (1 1 + 1 ) + 180. e -j2𝜋
2 2 2 2 2 2
1 1
(1 + 1 )=0
2 2
Perhitungan Spektrum :