How to make a 5.1 and a 7.1 surrond sound file
===

I'm trying to make/create a 5.1 and a 7.1 surround sound file but I'm having trouble finding a way to do it.  I'm using ubuntu 12.04 and I have access to octave / matlab / python.  I understand how to create an audio file in octave / matlab / python but not sure how to create the proper file format for a 5.1 and 7.1 surround file

Thanks 