Menu

Resample 8k pcm-encoded audio to 16k, got pulse-like sound in the output file

zhaihm
2014-11-27
2015-03-03
  • zhaihm

    zhaihm - 2014-11-27

    Hi all,
    I'm working on a project of resampling audio. I wrote a program based on SoXR, to read 8k audio stream from a pcm file, resample it to 16k, and write output to another file. Then I wrote another program to transfer pcm file to wav format.

    Here is my question:
    In my output wav file, there is a pulse-like sound. I don't know why. I tried all the quality parameters, such as SOXR_QQ, SOXR_HQ.. No one worked fine. (I posted the wav file as attachment.)
    I found that, on 32bit system, my program worked just fine. No pulse-like sound. But on 64bit system, I couldn't get rid the pulse sound.

    Does anyone has any idea why the sound file is like this? Anything is appreciated!

    The audio wave graph is listed below (first image is the pulse-like version, and second image is normal version):
    Audio Graph

    Thank you!

     

    Last edit: zhaihm 2014-11-27
    • farski

      farski - 2015-01-06

      I don't have an answer, but I think I'm experiencing a very similar problem. I don't have a good way of testing my app on a 32 bit system, so I don't know if that would also eliminate the problem for me.

       
  • a88301000

    a88301000 - 2015-03-03

    i could't found parameter of soxr_datatype_t for 8bit.i have need of converting 8bit 8k pcm data to 18bit 8k ,can u give me some idea about it?

     
  • a88301000

    a88301000 - 2015-03-03

    sorry,the need is to convert 8bit 8k data to 16bit 8k.

     
  • robs

    robs - 2015-03-03

    If the input and output sample rates are both 8k, then you don't really need a resampler (i.e. a sample-rate-converter).

    Converting from 8 bit to 16 bit is often done as follows:

    unsigned char const * input;
    unsigned short * output;
    size_t length, i;
    
    for (i=0; i<length; ++i)
      output(i) = (input[i]-128) << 8;
    
     

Log in to post a comment.