Thread: Who could help me about compressing voice?

  1. #1
    Registered User
    Join Date
    Jun 2011
    Posts
    50

    Who could help me about compressing voice?

    I want to compress voice data for transfer over
    network,who could tell me about algorithm?

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User gardhr's Avatar
    Join Date
    Apr 2011
    Posts
    151
    Quote Originally Posted by leetow2003 View Post
    I want to compress voice data for transfer over
    network,who could tell me about algorithm?
    The simplest approach would be to use an existing compression library (one that does MP3, for example). A decent "home-grown" method is to do an FFT on the data and filter out non-essential frequencies (outside of the range of voice, that is). I did that a while back and got pretty good results.

  4. #4
    Registered User
    Join Date
    Jun 2011
    Posts
    50
    Quote Originally Posted by gardhr View Post
    The simplest approach would be to use an existing compression library (one that does MP3, for example). A decent "home-grown" method is to do an FFT on the data and filter out non-essential frequencies (outside of the range of voice, that is). I did that a while back and got pretty good results.
    Could you tell me in detail?or some codes?Thank you.

  5. #5
    Registered User gardhr's Avatar
    Join Date
    Apr 2011
    Posts
    151
    Basically, what I did was take the FFT of a 16-bit audio stream and discarded non-voice frequencies, as well as frequencies with small amplitudes. Then I mapped the three components (frequency, amplitude, and phase) to 8-bit representations (so 3 bytes per spectral component). Finally, I compressed the result using arithmetic coding. The last step helped, but wasn't domain-specific enough to produce really spectacular compression; the correlation between each frame within the sample wasn't really exploited properly. For example, consider the ZIP archive format. It works really well with text because there is a direct correlation between each byte of data. But if you apply it to a buffer of 32-bit data, the efficiency typically goes down because the relationship between the data on a byte level is somewhat artificial. The key to achieving really good compression, then, is to model those inter-relationships as faithfully as possible. That said, the result was definitely satisfactory. Compression levels averaged out to roughly 10% - 33% of the uncompressed size, and the voice quality was decent. Had the second step been better modeled, I imagine those figures would have been half as much.
    Last edited by gardhr; 12-23-2011 at 08:59 PM.

  6. #6
    Registered User
    Join Date
    Jun 2011
    Posts
    50
    If I use 8-bit or 16-bit, what is the range about non-voice frequencies?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compressing a file, then uncompressing
    By dsured in forum C Programming
    Replies: 2
    Last Post: 03-08-2011, 11:47 AM
  2. Compressing problem
    By Stenland in forum C Programming
    Replies: 7
    Last Post: 10-22-2009, 05:02 PM
  3. Compressing
    By C_ntua in forum C Programming
    Replies: 2
    Last Post: 07-17-2008, 06:01 AM
  4. compressing a buffer
    By steve1_rm in forum C Programming
    Replies: 5
    Last Post: 02-29-2008, 02:19 PM
  5. help with compressing images
    By dragunov in forum C Programming
    Replies: 8
    Last Post: 08-31-2007, 05:52 AM