Teknik Pengkodean Kode Konvolusi Menggunakan Metode Hard Dan Soft Decision [PDF]

  • 0 0 0
  • Suka dengan makalah ini dan mengunduhnya? Anda bisa menerbitkan file PDF Anda sendiri secara online secara gratis dalam beberapa menit saja! Sign Up
File loading please wait...
Citation preview

LAPORAN SEMENTARA TEKNIK PENGKODEAN KODE KONVOLUSI HARD DAN SOFT DECISION



Nama NRP/Kelas



: Muhamad Fathur Rohman : 1210151036/3D4TB



Program Matlat (prak6.m) clc clear all close all pesan_kirim=randint(20,1) figure(1) stem(pesan_kirim,'r') title('Pesan Yang Dikirim') xlabel('Bit-bit Pesan Dikirim') ylabel('Amplitudo Pesan Yang Dikirim') t=poly2trellis([3 3],[5 4 0;0 4 5]); codeword=convenc(pesan_kirim,t) tb=2; pesan_terima=vitdec(codeword,t,tb,'trunc','hard') cek=[pesan_kirim pesan_terima] figure(2) subplot(3,1,1); stem(pesan_kirim,'r') title('Pesan Yang Dikirim') subplot(3,1,2); stem(codeword,'b') ylabel('Codeword') subplot(3,1,3); stem(pesan_terima,'m') xlabel('Pesan Yang Diterima') [number,ratio]=biterr(pesan_kirim,pesan_terima) info_kirim=randint(20,1) trellis=poly2trellis(4,[11 15]) ns=64; code=convenc(info_kirim,trellis) tb=4; delay=tb; N=length(code); noise=zeros(N,1); noise([3,5],1)=1 ncoden=xor(code,noise); noise_code=fix(ncoden); quan_code=quantiz(noise_code,[0.01,0.1,0.3,0.5,0.7,0.9,0.999]); infoterima_hard=vitdec(noise_code,trellis,tb,'term','hard'); infoterima_soft=vitdec(quan_code,trellis,tb,'trunc','soft',tb-1); [numberhard,ratiohard]=biterr(infoterima_hard,info_kirim) [numbersoft,ratiosoft]=biterr(infoterima_soft,info_kirim) figure(3) subplot(2,1,1); stem(info_kirim,'r'); title('Soft Decision') xlabel('Pesan Kirim') subplot(2,1,2); stem(infoterima_hard,'b') xlabel('Pesan Terima')



LAPORAN SEMENTARA TEKNIK PENGKODEAN KODE KONVOLUSI HARD DAN SOFT DECISION



Nama NRP/Kelas



A. Pengkodean Tanpa Error 1. Masukan = Pesan = Informasi



: Muhamad Fathur Rohman : 1210151036/3D4TB



2. Proses Pengkodean (Encoder)



Amplitudo Pesan Yang Dikirim



Pesan Yang Dikirim 1 0.8 0.6 0.4 0.2 0



0



2



4



6



8 10 12 Bit-bit Pesan Dikirim



14



16



18



20



3. Dekoder (Pengkodean Kembali) Pesan Yang Dikirim 1



0.5



0



0



2



4



6



8



10



12



14



16



18



20



Codeword



1



0.5



0



0



5



10



15



20



25



30



1



0.5



0



0



2



4



6



8 10 12 Pesan Yang Diterima



14



16



18



20



B. Pengkodean Dengan Error 1. Mengkodekan informasi mejadi sebuah codeword menggunakan encoder seperti pada gambar 2.



2. Menambahkan Noise pada Codeword



3. Mengkodekan kembali codeword menjadi sebuah informasi asal menggunakan viterbi “hard decision” dan soft “soft decision”.



Soft Decision 1



4. Plot hasil pengkodean



0.5



0



0



2



4



6



8



10 12 Pesan Kirim



14



16



18



20



0



2



4



6



8 10 12 Pesan Terima



14



16



18



20



1



0.5



0



Tugas dalam praktikum A. Pesan Sama, Encoder Berbeda, Decoder sama “Hard Decision” (tanpa Error) clc; clear all; close all; % TUGAS 1 B // TANPA ERROR pesan_kirim1=randint(20,1) pesan_kirim2=pesan_kirim1; t1=poly2trellis(5,[17 33]) % PENULISAN DALAM OCTAL (5, [15 27]) t2=poly2trellis([5 4],[23 35 0;0 5 11]) % PENULISAN DALAM OCTAL codeword1=convenc(pesan_kirim1,t1) codeword2=convenc(pesan_kirim2,t2) tb=2; pesan_terima1=vitdec(codeword1,t1,tb,'trunc','hard') pesan_terima2=vitdec(codeword2,t2,tb,'trunc','hard') cek1=[pesan_kirim1 pesan_terima1] cek2=[pesan_kirim2 pesan_terima2] infoterima_hard1=vitdec(codeword1,t1,tb,'trunc','hard'); infoterima_hard2=vitdec(codeword2,t2,tb,'trunc','hard'); [numberhard1,ratiohard1]=biterr(infoterima_hard1,pesan_kirim1) [numberhard2,ratiohard2]=biterr(infoterima_hard2,pesan_kirim2) figure(1) subplot(3,1,1) stem(pesan_kirim1,'r') title('pesan yang dikirm ke trellis (5,[17 33])') subplot(3,1,2) stem(codeword1,'b') ylabel('codeword') subplot(3,1,3) stem(pesan_terima1,'m') xlabel('pesan yang diterima') figure (2) subplot(3,1,1) stem(pesan_kirim2,'r') title('pesan yang dikirm ke trellis ([5 4],[23 35 0;0 5 11])') subplot(3,1,2) stem(codeword2,'b') ylabel('codeword') subplot(3,1,3) stem(pesan_terima2,'m') xlabel('pesan yang diterima')



pesan yang dikirm ke trellis (5,[17 33]) 1 0.5 0



0



2



4



6



8



10



12



14



16



18



20



codeword



1 0.5 0



0



5



10



15



20



25



30



35



40



1 0.5 0



0



2



4



6



8 10 12 pesan yang diterima



14



16



18



20



18



20



pesan yang dikirm ke trellis ([5 4],[23 35 0;0 5 11]) 1 0.5 0



0



2



4



6



8



10



12



14



16



codeword



1 0.5 0



0



5



10



15



20



25



30



1 0.5 0



0



2



4



6



8 10 12 pesan yang diterima



14



16



18



20



B. Pesan Sama, Encoder Berbeda, Decoder berbeda “Hard Decision” dan “Soft Decision” (ditambah Error) clc; clear all; close all % tugas2prak6 dengan error tb1=4; info_kirim1=randint(40,1); trellis1=poly2trellis([3 3],[5 4 0;0 4 5]) ns=64; code1=convenc(info_kirim1,trellis1); N1=length(code1); noise1=zeros(N1,1); noise1([2,4,5],1)=1 ncoden=xor(code1,noise1); noise_code1=fix(ncoden); quan_code1=quantiz(noise_code1,[0.01,.1,.3,.5,.7,.9,.999]); infoterima_hard1=vitdec(noise_code1,trellis1,tb1,'cont','hard'); infoterima_soft1=vitdec(quan_code1,trellis1,tb1,'trunc','soft',tb1-1); [numberhard1,ratiohard1]=biterr(infoterima_hard1,info_kirim1) [numbersoft1,ratiosoft1]=biterr(infoterima_soft1,info_kirim1) cekhard=[info_kirim1 infoterima_hard1] ceksoft=[info_kirim1 infoterima_soft1] figure(3) subplot(4,1,1) stem(info_kirim1,'r') title('info kirim') xlabel('pesan dikirim') subplot(4,1,2) stem(code1,'b') xlabel('Codeword') subplot(4,1,3) stem(infoterima_hard1,'b') xlabel('pesan terima (Hard Decision)') subplot(4,1,4) stem(infoterima_soft1,'b') xlabel('pesan terima (Soft Decision)')



info kirim 1 0.5 0



0



5



10



15



20 pesan dikirim



25



30



35



40



1 0.5 0



0



10



20



30 Codeword



40



50



60



1 0.5 0



0



5



10



15 20 25 pesan terima (Hard Decision)



30



35



40



0



5



10



15 20 25 pesan terima (Soft Decision)



30



35



40



1 0.5 0