Welcome Guest ( Log In | Register )

Mixing Mono Samples with Stereo Samples, Audio DSP using C#
post Apr 19 2012, 06:18
Post #1

Group: Members
Posts: 5
Joined: 19-April 12
Member No.: 98974


I've got two streams of audio sample that are stored in arrays, one mono and one stereo. I'd like to mix the mono into the stereo stream and output as stereo. Any known examples to accomplish?

Thanks in advance.........Mick
Go to the top of the page
+Quote Post
Start new topic
post Apr 19 2012, 19:26
Post #2

Group: Members
Posts: 1853
Joined: 24-June 02
From: Catalunya(Spain)
Member No.: 2383

Could I ask which is your background? I don't want to assume too much (or to little).

Like they said, when having the same sample rate and the same bit depth, Mixing equals to the sum of the values. Doing a division is not a requirement but it might be needed depending on the goal.*

Likewise, changing the number of channels of a signal is also quite straightforward:

Mono to "N" is just using the same stream for the other channels
"N" to mono is mixing the streams into a single one.

Since this can cause changes in the volume, a "channel matrix" is applied.
Channel matrix is just doing a multiplication before doing the addition, in order to change the amplitude of the signal in that channel. In 5.1 to stereo matrixes, generally the different channels reduce their volume in different amounts before being mixed together. (In a matrix, one source channel can go to more than one destination channel, like when converting stereo to 5.1).

Depending on your background you could take a look at http://www.dspguide.com/ . It talks about digital signal processing, and might be helpful for you in the future. (Obviously, if you have just started, most of that will be clueless math and strange words).

* Concretely, if you sum the same signal twice, its peak will double and that could cause clipping. Said that, if one mixes 32 streams, it is not wise to have a division by 32 (this would lower the peak of one stream by 30dB. Think that the mute of some car radios is only 20dBs).

This post has been edited by [JAZ]: Apr 19 2012, 19:28
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 29th November 2015 - 12:17