How can I do audio compression using Huffman encoding?

조회 수: 3 (최근 30일)
Saurabh Parkar
Saurabh Parkar 2018년 4월 30일
댓글: Walter Roberson 2023년 10월 16일
I know the concept of Huffman encoding and how to implement it on MATLAB. My question here is what will i be using as symbols in this case? Will it be the samples that i get after reading the audio(audioread())? Do i need to process my audio first( quantization / downsample / fft )?
  댓글 수: 7
Mittal
Mittal 2023년 10월 16일
can you provide the code
Walter Roberson
Walter Roberson 2023년 10월 16일
Yes, I could provide the code... but I am not going to write people's homework assignments for them. I already provided a somewhat detailed outline of the steps that need to be taken.

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2018년 4월 30일
When you read from the audio file, use the 'native' option. The result is quite likely to be integer valued. You can use the integers as the symbols.
You will likely find, though, that you can get better compression by using the difference between adjacent integers as the symbols.
  댓글 수: 4
Walter Roberson
Walter Roberson 2018년 5월 4일
Saurabh Parkar had used huffmandict() on the samples to build the encoding tables, and then used huffmanenco() to perform the encoding to a stream of 0 and 1 values.
Saurabh Parkar
Saurabh Parkar 2018년 5월 7일
Thank you so much Walter! I was stuck on this since a long time.
This was really very helpful.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Source Coding에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by