kompresi data menggunakan algoritma huffman ahya rudin

advertisement
KOMPRESI DATA MENGGUNAKAN ALGORITMA HUFFMAN
AHYA RUDIN
41512110017
PROGRAM STUDI INFORMATIKA
FAKULTAS ILMU KOMPUTER
UNIVERSITAS MERCU BUANA
JAKARTA
2017
http://digilib.mercubuana.ac.id/
KOMPRESI DATA MENGGUNAKAN ALGORITMA HUFFMAN
Laporan Tugas Akhir
Diajukan Untuk Melengkapi Persyaratan
Menyelesaikan Gelar Sarjana Komputer
Disusun oleh :
AHYA RUDIN
41512110017
PROGRAM STUDI INFORMATIKA
FAKULTAS ILMU KOMPUTER
UNIVERSITAS MERCU BUANA
JAKARTA
2017
http://digilib.mercubuana.ac.id/
http://digilib.mercubuana.ac.id/
http://digilib.mercubuana.ac.id/
KATA PENGANTAR
Puji syukur Penulis panjatkan kehadirat Allah SWT atas Rahmat dan HidayahNya,
sehingga Penulis dapat menyelesaikan Tugas Akhir yang merupakan salah satu persyaratan
untuk menyelesaikan program studi stara satu (S1) pada jurusan Informatika Universitas
Mercu Buana.
Penulis menyadari bahwa laporan tugas akhir ini masih jauh dari kata sempurna. Karena itu,
kritik dan saran akan senantiasa penulis terima dengan senang hati.
Pada kesempatan ini Penulis mengucapkan terima kasih kepada semua pihak yang telah
membantu baik berupa pengetahuan, bimbingan, pengarahan dan memberikan dukungan,
ucapan terima kasih khusunya kepada :
1.
Ibu Dr Ir Eliyani selaku Dosen Pembimbing Tugas Akhir.
2.
Ibu Desi Ramayanti, S.Kom, MT, selaku Kaprodi pada Jurusan
Informatika
Unversitas Mercu Buana
3.
Bapak Diky Firdaus, S.Kom, MM, Koodinator Tugas Akhir pada Jurusan Informatika
Unversitas Mercu Buana
4.
Kedua
Orang
Tua
saya
yang
telah
memberikan
doa
dan
mendukung Penulis baik moral maupun materi.
5.
Terimakasih Ibu Desi Ramayanti S.Kom, MT, selaku Dosen Pembimbing
Akademik serta kepada saudara dan kawan – kawan UMB TI Angkatan 21
yang
telah
memberikan
semangat
serta
dukungan
moral
selama
menyelesaikan tugas akhir ini.
Semoga Allah SWT membalas kebaikan dan selalu mencurahkan hidayah serta taufik-Nya,
Aamin.
Jakarta, 29 Juli 2017
Ahya Rudin
iii
http://digilib.mercubuana.ac.id/
DAFTAR ISI
LEMBAR PERNYATAAN ........................................................................................................ i
LEMBAR PENGESA................................................................................................................ii
KATA PENGANTAR..............................................................................................................iii
ABSTRAK................................................................................................................................iv
ABSTRACT ............................................................................................................................... v
DAFTAR ISI............................................................................................................................. vi
DAFTAR GAMBAR ............................................................................................................. viii
BAB 1.
PENDAHULUAN ............................................................................................... 1-1
1.1.
Latar Belakang ........................................................................................................ 1-1
1.2.
Rumusan Permasalahan........................................................................................... 1-2
1.3.
Tujuan & Manfaat Penelitian .................................................................................. 1-2
1.3.1
Tujuan Penelitian ............................................................................................. 1-2
1.3.2
Manfaat Penelitian ........................................................................................... 1-3
1.4.
Ruang Lingkup & Batasan Penelitian ..................................................................... 1-3
1.5.
Metodologi Penelitian ............................................................................................. 1-3
1.6.
Sistematika Penulisan Laporan ............................................................................... 1-3
1.6.1
Pendahuluan ..................................................................................................... 1-4
1.6.2
Landasan Teori................................................................................................. 1-4
1.6.3
Analisa Sistem ................................................................................................. 1-4
1.6.4
Perancangan .................................................................................................... 1-4
1.6.5
Implementasi dan Pengujian ............................................................................ 1-5
1.6.6
Penutup ............................................................................................................ 1-5
BAB 2.
2.1.
LANDASAN TEORI .......................................................................................... 2-1
Algoritma Huffman ................................................................................................. 2-1
2.1.1
Pembentukan pohon Huffman ......................................................................... 2-1
2.1.2
Proses Encoding ............................................................................................... 2-3
2.1.3
Proses Decoding ................................................................................................. 2-5
2.1.4
Kompleksitas Algoritma Huffman....................................................................2-6
BAB 3.
ANALISA SISTEM ............................................................................................ 3-1
3.1.
Analisa Sistem ......................................................................................................... 3-1
3.1.1
Analisa Permasalahan ...................................................................................... 3-1
3.1.2
Analisa Sistem Berjalan ................................................................................... 3-1
3.1.3
Analisa Kebutuhan Perangkat Keras ............................................................... 3-2
BAB 4.
PERANCANGAN ............................................................................................... 4-1
4.1.
Use case Diagram .................................................................................................... 4-1
4.2.
Perancangan Flowchart ........................................................................................... 4-1
vi
http://digilib.mercubuana.ac.id/
4.1.1
4.2.
Flowchart Alur Kerja Aplikasi......................................................................... 4-2
Perancangan Aplikasi ................................................................................................. 4-3
4.2.1
Perancangan Tampilan Awal aplikasi .............................................................. 4-3
4.2.2
Perancangan Struktur Program ........................................................................ 4-3
4.2.2.1
Classhuffmancompression.java.............................................................. 4-4
4.2.2.2
ClassMainForm.java .............................................................................. 4-4
4.2.2.3 ClassHuffmanEncoder.java .................................................................... 4-5
4.2.2.4
BAB 5.
ClassHuffmanDecoder.java .................................................................... 4-6
IMPLEMENTASI DAN PENGUJIAN ............................................................... 5-1
5.1.
Implementasi Sistem ............................................................................................... 5-1
5.2.
Installasi Sistem....................................................................................................... 5-1
5.2.1
5.3.
Installasi NetBeans........................................................................................... 5-1
Pengujian ................................................................................................................. 5-6
5.3.1
Pengujian Pengujian hasil kompresi data ........................................................ 5-7
5.3.2
Pengujian Kecepatan kompres Data ................................................................ 5-7
BAB 6.
PENUTUP ........................................................................................................... 4-1
6.1.
Kesimpulan.............................................................................................................. 6-1
6.2.
Saran ........................................................................................................................ 6-1
DAFTAR PUSTAKA ........................................................................................................... 6-2
vii
http://digilib.mercubuana.ac.id/
DAFTAR GAMBAR
Gambar 1.1 Ilustrasi Permasalahan dan Solusi .................................................... 1-2
Gambar 2.1 Frekuensi Kemunculan .................................................................... 2-3
Gambar 2.2 Pohon Huffman untuk karakter “AUBCEMNR”............................. 2-4
Gambar 2.3 Jumlah Kemunculan bit” .................................................................. 2-5
Gambar 4.1 Use case Diagram............................................................................. 4-1
Gambar 4.2 Flowchart Kompresi atau Dekompresi ............................................ 4-2
Gambar 4.3 Tampilan awal Aplikasi ................................................................... 4-3
Gambar 4.4 Class huffmancompression.Java ...................................................... 4-4
Gambar 4.5 Class MainForm.Java ....................................................................... 4-5
Gambar 4.6 Class HuffmanEncoder.Java ............................................................ 4-5
Gambar 4.7 Class HuffmanDecoder.Java ............................................................ 4-6
Gambar 5.1 Install Java Development Kit (JDK) ................................................ 5-2
Gambar 5.2 Install Java Development Kit (JDK) ................................................ 5-2
Gambar 5.3 Install Java Runtime Environtment (JRE) ....................................... 5-3
Gambar 5.4 NetBeans IDE 8.0.2 ......................................................................... 5-3
Gambar 5.5 NetBeans IDE 8.0.2 ......................................................................... 5-4
Gambar 5.6 NetBeans IDE 8.0.2 ......................................................................... 5-4
Gambar 5.7 NetBeans IDE 8.0.2 ......................................................................... 5-5
Gambar 5.8 NetBeans IDE 8.0.2 ......................................................................... 5-5
Gambar 5.9 NetBeans IDE 8.0.2 ......................................................................... 5-5
Gambar 5.10 NetBeans IDE 8.0.2 ....................................................................... 5-6
Gambar 5.11 NetBeans IDE 8.0.2 ....................................................................... 5-6
DAFTAR TABEL
Tabel 3.1 Spesifikasi Laptop Hp G42 .................................................................. 3-2
Tabel 3.2 Spesifikasi Software Netbeans ............................................................ 3-2
Tabel 5.1 Hasil Kompresi ................................................................................... 5-7
Tabel 5.2 Perhitungan Bit Per Carakter .............................................................. 5-7
viii
http://digilib.mercubuana.ac.id/
Download