Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link

Technology: C++, CodeBlocks IDE.

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    WavAnalysis wav_analyse;
    static const uint16_t BUFFER_SIZE = 1024;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    fseek(wavFile, 44, SEEK_SET); // skip header data
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        wav_analyse.FFT(buffer); // currently shows data only
    }

Wav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

In next step I'm normalising values to the range of [-1;1) with function:

float WavAnalysis::normaliseValuetoFloat(uint8_t value){
    float normalisedValue = (float)value;
    normalisedValue -= 128;
    normalisedValue /= 128;
    return normalisedValue;
}

My goal is to create my own library for voice activity detection, now I'm working on FFT module. I need this data to calculate signal energy and its entropy in chosen signal parts.


updates:

After reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two).

Question now: FFT changes signal domain from time (real values) to frequency (which contains complex numbers). Why does available sources populates the FFT algorithm with complex array? Ex.: http://stackoverflow.com/questions/10121574/safe-and-fast-ffthttps://stackoverflow.com/questions/10121574/safe-and-fast-fft

Technology: C++, CodeBlocks IDE.

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    WavAnalysis wav_analyse;
    static const uint16_t BUFFER_SIZE = 1024;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    fseek(wavFile, 44, SEEK_SET); // skip header data
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        wav_analyse.FFT(buffer); // currently shows data only
    }

Wav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

In next step I'm normalising values to the range of [-1;1) with function:

float WavAnalysis::normaliseValuetoFloat(uint8_t value){
    float normalisedValue = (float)value;
    normalisedValue -= 128;
    normalisedValue /= 128;
    return normalisedValue;
}

My goal is to create my own library for voice activity detection, now I'm working on FFT module. I need this data to calculate signal energy and its entropy in chosen signal parts.


updates:

After reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two).

Question now: FFT changes signal domain from time (real values) to frequency (which contains complex numbers). Why does available sources populates the FFT algorithm with complex array? Ex.: http://stackoverflow.com/questions/10121574/safe-and-fast-fft

Technology: C++, CodeBlocks IDE.

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    WavAnalysis wav_analyse;
    static const uint16_t BUFFER_SIZE = 1024;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    fseek(wavFile, 44, SEEK_SET); // skip header data
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        wav_analyse.FFT(buffer); // currently shows data only
    }

Wav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

In next step I'm normalising values to the range of [-1;1) with function:

float WavAnalysis::normaliseValuetoFloat(uint8_t value){
    float normalisedValue = (float)value;
    normalisedValue -= 128;
    normalisedValue /= 128;
    return normalisedValue;
}

My goal is to create my own library for voice activity detection, now I'm working on FFT module. I need this data to calculate signal energy and its entropy in chosen signal parts.


updates:

After reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two).

Question now: FFT changes signal domain from time (real values) to frequency (which contains complex numbers). Why does available sources populates the FFT algorithm with complex array? Ex.: https://stackoverflow.com/questions/10121574/safe-and-fast-fft

Technology: C++, CodeBlocks IDE.

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    WavAnalysis wav_analyse;
    static const uint16_t BUFFER_SIZE = 2;1024;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    fseek(wavFile, 44, SEEK_SET); // skip header data
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        for (int i = 0; i < sizeofwav_analyse.FFT(buffer); i+=1){
            int amp = buffer[i];
            fprintf(pFile, "%d", amp);
            fprintf(pFile, "\r\n");
    // currently shows data }only
    }

but now I some trouble with understanding how should I populate FFT algorithm with this data. WavWav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

Technology I usedIn next step I'm normalising values to the range of [-1;1) with function: C++, CodeBlocks IDE.

float WavAnalysis::normaliseValuetoFloat(uint8_t value){
    float normalisedValue = (float)value;
    normalisedValue -= 128;
    normalisedValue /= 128;
    return normalisedValue;
}

My goal is to create my own library for voice activity detection, now I'm working on FFT module. I need this data to calculate signal energy and its entropy in chosen signal parts.

 

Ok, so afterupdates:

After reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two). And, for normalisation purpose, I should change samples value to float values

Question now: FFT changes signal domain from time (in range of [-1;1real values) to frequency (which contains complex numbers) - is it right and enough preperation before feeding. Why does available sources populates the FFT algorithm with complex array? I need this data to calculate signal energy and its entropy in chosen signal parts Ex.: http://stackoverflow.com/questions/10121574/safe-and-fast-fft

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    static const uint16_t BUFFER_SIZE = 2;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        for (int i = 0; i < sizeof(buffer); i+=1){
            int amp = buffer[i];
            fprintf(pFile, "%d", amp);
            fprintf(pFile, "\r\n");
        }
    }

but now I some trouble with understanding how should I populate FFT algorithm with this data. Wav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

Technology I used: C++, CodeBlocks IDE.

My goal is to create my own library for voice activity detection, now I'm working on FFT module.

Ok, so after reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two). And, for normalisation purpose, I should change samples value to float values (in range of [-1;1) ) - is it right and enough preperation before feeding FFT algorithm? I need this data to calculate signal energy and its entropy in chosen signal parts.

Technology: C++, CodeBlocks IDE.

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    WavAnalysis wav_analyse;
    static const uint16_t BUFFER_SIZE = 1024;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    fseek(wavFile, 44, SEEK_SET); // skip header data
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        wav_analyse.FFT(buffer); // currently shows data only
    }

Wav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

In next step I'm normalising values to the range of [-1;1) with function:

float WavAnalysis::normaliseValuetoFloat(uint8_t value){
    float normalisedValue = (float)value;
    normalisedValue -= 128;
    normalisedValue /= 128;
    return normalisedValue;
}

My goal is to create my own library for voice activity detection, now I'm working on FFT module. I need this data to calculate signal energy and its entropy in chosen signal parts.

 

updates:

After reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two).

Question now: FFT changes signal domain from time (real values) to frequency (which contains complex numbers). Why does available sources populates the FFT algorithm with complex array? Ex.: http://stackoverflow.com/questions/10121574/safe-and-fast-fft

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    static const uint16_t BUFFER_SIZE = 2;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        for (int i = 0; i < sizeof(buffer); i+=1){
            int amp = buffer[i];
            fprintf(pFile, "%d", amp);
            fprintf(pFile, "\r\n");
        }
    }

but now I some trouble with understanding how should I populate FFT algorithm with this data. Wav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

Technology I used: C++, CodeBlocks IDE.

My goal is to create my own library for voice activity detection, now I'm working on FFT module.

Ok, so after reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two). And, for normalisation purpose, I should change samples value to float values (in range of [-1;1) ) - is it right and enough preperation before feeding FFT algorithm? I need this data to calculate signal energy and its entropy in chosen signal parts.

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), but now I some trouble with understanding how should I populate FFT algorithm with this data. Wav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

I've just read sample wav file (source - http://www.wavsource.com/snds_2015-12-13_4694675918641206/movies/2001/daisy.wav ) with an txt output (https://paste.ee/p/pXGvm), which i get from using this code:

    static const uint16_t BUFFER_SIZE = 2;
    uint8_t* buffer = new uint8_t[BUFFER_SIZE];
    std::cout << "Buffering data... " << std::endl;
    while ((bytesRead = fread(buffer, sizeof buffer[0], BUFFER_SIZE / (sizeof buffer[0]), wavFile)) > 0)
    {
        //do sth with buffer data
        for (int i = 0; i < sizeof(buffer); i+=1){
            int amp = buffer[i];
            fprintf(pFile, "%d", amp);
            fprintf(pFile, "\r\n");
        }
    }

but now I some trouble with understanding how should I populate FFT algorithm with this data. Wav file header informations:

  • 1 channel PCM,

  • 8 bits per sample,

  • sampling rate is 11025Hz.

Technology I used: C++, CodeBlocks IDE.

My goal is to create my own library for voice activity detection, now I'm working on FFT module.

Ok, so after reading commented sources, I've learned that average and sufficient length of data for feeding FFT algorythm is 1024 (or any other that is equal to power of two). And, for normalisation purpose, I should change samples value to float values (in range of [-1;1) ) - is it right and enough preperation before feeding FFT algorithm? I need this data to calculate signal energy and its entropy in chosen signal parts.

Source Link
Loading