Disecting Wave File Hex Editor
Disecting Wave File Hex Editor
Disecting Wave File Hex Editor
wav)
The aim of this project was to create a “nice” sine wave as a test signal
to trace the function of the electronic circuit of a tube amplifier by
oscilloscope:
By adding two simple sine waves (red and green) a more complex test
sine curve is calculated (violet).
The plan was to reach this goal with a computer sound card equipment
and a Microsoft wave file, without the need of buying expensive wave
form generator hardware equipment. To be able to create my own
custom wave file containing a test signal, I had to understand how a
windows wave file is built. In this document I disassemble a sine tone
wave file and match the findings with a wave file documentation from the
web.
https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
http://www.rme-audio.de/old/download/audtest.htm
Before starting with this project I wasn’t very familiar with the terms little
and big endian. A good introduction about “endianess” is the
corresponding wikipedia article. Besides I can recommend to have a look
at the very entertaining, initially not quite seriously meant, 1980 first of
April rfc article of Danny Cohen that inadvertedly introduced the usage of
the terms „big / little endian“ to informatics. It is funny !
The first four hex figures designate the file container format used, which
was termed RIFF (Resource Interchange File Format) by Microsoft, this
field is called „ChunkID“ and it is four bytes long
RIFF
“ The ChunkID is followed by the ChunkSize field, this field indicates the
size of the following file in bytes. The field has a size of 4 bytes. It does
not includes the size of the two trailing fields ChunkID and ChunkSize,
thus the size it indicates is:
field ChunkSize)
ASCII form
W A V E ASCII representation
form
66 6D 74 20 Hex Numbers
16 (dec) = 10 (hex)
16 decimal representation
AudioFormat: little endian field of 2 Bytes, for PCM the value is 1 (i.e.
form of compression
1 (dec) = 1 (hex)
1 decimal representation
2 (dec) = 2 (hex)
2 decimal representation
== NumChannels * BitsPerSample/8
== 2 * 16 / 8 = 4
4 (dec) = 4 (hex)
4 decimal representation
16 (dec) = 10 (hex)
16 decimal representation
d a t a ASCII Representation
you can also think of this as the size of the read of the
= 44100 * 2 * 16 / 8 = 176400
RawData: in case of 16 bit Stereo PCM this is a field of 4 bytes, the field
contain the sample for the left channel, the second 2 bytes
contain the sample for the right cannel, each byte pair is in
0 to 65535
DB 9F 25 60 D8 AC 28 53 86 BB Hex Numbers (little endian)