How can I do audio compression using Huffman encoding?

3 次查看(过去 30 天)
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 个评论
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