The version of Aften I use is a gui called "Wav to AC3 Encoder". Do a search for that and you should find it no problem. There is a command line version also but I've never really got the hang of how to do stuff like that. The gui contains numerous options for improving the sound within a given bitrate--I set them all to their maximum quality level. It gives explanations for what they all do. For a straight mono or stereo encode, you can load the source file directly, but for a greater number of channels, I select "multiple mono input" and load them individually, because I find opening enormous multichannel wavs to be problematic for my system memory. To do that you'll need to create a separate mono file for each channel. You can select either wav channel mapping or AC3 mapping. Wav order is Left, Center, Right, LFE, Left Surround, Right Surround; while AC3 order is Left, Right, Center, Left Surround, Right Surround, LFE. You'll want to use 448 kbps for your bitrate, as it is the highest permitted by DVD spec. If you have a player that can do 640, by all means do that (I imagine most Bluray players wouldn't have any problem with it, but I don't know for sure).
I'm fortunate that the Aften gui works on my Mac--if it didn't I'd be out of luck because there don't seem to be any AC3 encoders that aren't outrageously expensive. I tried to use a DTS encoder, but it always quit after I clicked the encode button--no idea why. Not compatible with WINE, I guess.