DSPRelated.com
Forums

WAV Data

Started by kash...@gmail.com April 14, 2009
Hi

I am new to this so any help would be highly appreciated.

I would like to know how to calculate SNR for a wave file.

The following are the wav properties:

Version : libsndfile-1.0.19

=======================================File : 1.wav
Length : 108336780
RIFF : 108336772
WAVE
bext : 602
fmt : 16
Format : 0x1 => WAVE_FORMAT_PCM
Channels : 1
Sample Rate : 48000
Block Align : 2
Bit Width : 16
Bytes/sec : 96000
*** minf : 16 (unknown marker)
*** elm1 : 338 (unknown marker)
data : 107914048
*** regn : 92 (unknown marker)
*** ovwf : 421568 (unknown marker)
*** umid : 24 (unknown marker)
End

----
Sample Rate : 48000
Frames : 53957024
Channels : 1
Format : 0x00010002
Sections : 1
Seekable : TRUE
Duration : 00:18:44.105
Signal Max : 25577 (-2.15 dB)
Also when i print the data all i get is a bunch of zeros
I am using an integer array in C++ compiling using gcc

When i use char array it cannot print anything.

Basically i want to know the datatype of the wav data as i am
reading the file in binary mode.

What i want to do is scan through the data for any silence and
human voice? For this i will have to calculate the energy but how would
i do this? What's the formula for calculating energy,zero crossing rate, and any other methods for voice activity detection ?