# Does Wav format supports writing complex values

I have a sine tone, doing some math, and finally gets an harmonically accumulated sine tone in complex numbers. I do want to preserve the phase information of imaginary part on the other end, which will continue processing the complex signal. So,

Is there any way i can safely pack the complex number into any of standard file formats, such as wav ?

Note : Currently I am writing this signal's byte values to a .bin file

## 1 Answer

You could create a standard 2 channel wav file. 1 channel for the real part and 1 for the imag. Wav files supports both 16bit integer, 32bit integer and 32bit floats etc. The channel data will be interleaved (I believed it's called). Meaning that your data will be written: [REAL][IMAG][REAL][IMAGE]... Prolly just like your own bin file.

Standard programs like Audacity will be able to read the file and make calculations on each (or both) channels.

• Thanks lllishar, Standard programs like Audacity will be able to read the file and make calculations on each (or both) channels is what i wanted. But my data is itself multi-channel. So any way to deal with source complex signal being multi-channel signal? – nmxprime Oct 14 '14 at 8:49
• Wav files can contain more than 2 channels also: msdn.microsoft.com/en-us/library/windows/hardware/…. So just double the number of channels. Hopefully it's no more than 6 channels. Otherwise I'd create separate wav files for each "channel". (Eg. make each wav file contain a real/imag channel.) – Illishar Oct 14 '14 at 10:08
• I've just checked, you prolly won't even need the extended format, to create a eg. 10 channel wav. It's a standard wav field feature. – Illishar Oct 14 '14 at 10:13