audiosignal-processingwavaudacity

Interpretation of .wav samples


I am trying to interpret a .wav file in order to analyze different aspects of an audio file, but I can't quite seem to get the data sampling portion correct.
I have an audio file (Me holding middle c on a piano) as follows (written in hex to be dissected)

52 49 46 46 A4 64 17 00 57 41 56 45 66 6D 74 20  
10 00 00 00 01 00 02 00 44 AC 00 00 10 B1 02 00  
04 00 10 00 64 61 74 61 80 64 17 00 20 00 14 00  
A2 FF 31 00 D2 FF 34 00 9C FF 28 00 0A 00 34 00

From this I have interpreted it to the following:

ChunkID = 52 49 46 46 (RIFF)
ChunkSize = A4 64 17 00 (little endian = 1,533,092 bytes)
Format = 57 41 56 45 (WAVE)
Subchunk1ID = 66 6D 74 20 (fmt )
Subchunk1Size = 10 00 00 00 (little endian = 16 bytes)
AudioFormat = 01 00 (little endian = 1 --> PCM)
NumChannels = 02 00 (little endian = 2)
SampleRate = 44 AC 00 00 (little endian = 44,100 Hz)
ByteRate = 10 B1 02 00 (little endian = 176,400)
BlockAlign = 04 00 (little endian = 4 bytes/sample)
BitsPerSample = 10 00 (little endian = 16 bits)
Subchunk2ID = 64 61 74 61 (data)
Subchunk2Size = 80 64 17 00 (little endian = 1,533,056)

All samples are little endian split into the left channel (2 bytes) and right channel (2 bytes)

Sample1 = 20 00 14 00 = (32, 20)
Sample2 = A2 FF 31 00 = (-94, 49)
Sample3 = D2 FF 34 00 = (-46, 52)
Sample4 = 9C FF 28 00 = (-100, 40)
Sample5 = 0A 00 34 00 = (10, 52)

My question is specifically about the sample interpretation. I think that I'm doing this correct, but when I graph a good amount of channel 1's data I end up with the following image.

(This image is only the first 750 samples) enter image description here

When opening the same .wav file in audacity, I get the following image.

enter image description here

How does audacity turn the data I collected into the image that it shows as opposed to the image I graphed? I have looked and tried to interpret this, but there isn't a lot of information that I could find about the bit by bit interpretation of audio files. Any help or articles that could point me in the right direction would be greatly appreciated!


Solution

  • I figured it out, I wasn't graphing far enough into the file. The first little bit was just blank noise that didn't do much. Once I graphed past the first 750 samples I got the same image Audacity did.