| 1 |
<html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 |
<title>MixingMatrix</title> |
| 3 |
<style> |
| 4 |
td { padding-left: 5pt; padding-right: 5pt; } |
| 5 |
th { padding-left: 5pt; padding-right: 5pt; } |
| 6 |
code { white-space: pre-wrap; } |
| 7 |
dd { white-space: pre-wrap; } |
| 8 |
</style> |
| 9 |
</head><body bgcolor="#FFFFFF"> |
| 10 |
|
| 11 |
<table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b> |
| 12 |
MixingMatrix |
| 13 |
</b></font></table></table> |
| 14 |
<p>One of the <a href="Types_of_objects.html">type of Objects</a> in Praat. A <b>MixingMatrix</b> shows a mapping of the channels of an input <a href="Sound.html">Sound</a> to the channels of an output Sound. A channel in the input sound is called an <i>input</i> channel. Each output channel is a linear combination of input channels. </p> |
| 15 |
<p>The mixing of input channels can be written as the matrix multiplication <b>R=M·S</b>. Here <b>S</b> is the matrix that represents the input sound, with <i>numberOfInputs</i><i></i> rows and <i>numberOfSamples</i> columns. Each row in <b>S</b> corresponds to one input channel. <b>M</b> is the <i>numberOfOutputChannels</i>× <i>numberOfInputs</i> MixingMatrix and <b>R</b> is the <i>numberOfOutputChannels</i>× <i>numberOfSamples</i> matrix that is the result of the mixing.</p> |
| 16 |
<p>Row <i>i</i> in the MixingMatrix <b>M</b> therefore represents the weights <i>m</i><sub><i>ij</i></sub> of the different input channels <i>j</i> in output channel <i>i</i>, the number of rows of <b>M</b> determines the number of output channels in the resulting <b>R</b>. Column <i>j</i> in <b>M</b> represents the weight factors <i>m</i><sub><i>ij</i></sub> of input <i>j</i> in the different output channels <i>i</i>.</p> |
| 17 |
<h2>Examples</h2> |
| 18 |
<p>Given the following stereo Sound with a tone of 300 Hz in channel 1 and a tone of 600 Hz in channel two: </p> |
| 19 |
<code> stereo = Create Sound from formula: "s", 2, 0, 1, 44100, "sin(2*pi*row*300*x)"<br></code> |
| 20 |
<dl> |
| 21 |
<dt>Example 1 |
| 22 |
</dl> |
| 23 |
<code> mm1 = Create simple MixingMatrix: "mm1", 2, 1, "1 0"<br></code> |
| 24 |
<code> selectObject: mm1, stereo<br></code> |
| 25 |
<code> Mix<br></code> |
| 26 |
<dl> |
| 27 |
<dd>will produce a new <i>mono</i> Sound object that shows a tone with a frequency of 300 Hz.</dd> |
| 28 |
<dd>The example creates a Mixing matrix with one row and two columns. The resulting new Sound object will have only one channel which is the result of adding the two channels from the stereo sound with weights of 1.0 and 0.0, respectively.</dd> |
| 29 |
<dt>Example 2 |
| 30 |
</dl> |
| 31 |
<code> mm2 = Create simple MixingMatrix: "mm2", 2, 1, "0 1"<br></code> |
| 32 |
<code> selectObject: mm2, stereo<br></code> |
| 33 |
<code> Mix<br></code> |
| 34 |
<dl> |
| 35 |
<dd>will produce a new mono Sound object that shows a tone with a frequency of 600 Hz.</dd> |
| 36 |
<dt>Example 3 |
| 37 |
</dl> |
| 38 |
<code> mm3 = Create simple MixingMatrix: "mm3", 2, 1, "1 1"<br></code> |
| 39 |
<code> selectObject: mm3, stereo<br></code> |
| 40 |
<code> Mix<br></code> |
| 41 |
<dl> |
| 42 |
<dd>will produce a new mono Sound object that shows a complex tone composed of frequencies 300 and 600 Hz. The amplitude of the output sound will be larger than 1</dd> |
| 43 |
<dt>Example 4 |
| 44 |
</dl> |
| 45 |
<code> mm4 = Create simple MixingMatrix: "mm4", 2, 2, "1 0 1 0"<br></code> |
| 46 |
<code> selectObject: mm4, stereo<br></code> |
| 47 |
<code> Mix<br></code> |
| 48 |
<dl> |
| 49 |
<dd>will produce a new stereo Sound object that shows a tone of frequency 300 Hz in both channels.</dd> |
| 50 |
<dt>Example 5 |
| 51 |
</dl> |
| 52 |
<code> mm5 = Create simple MixingMatrix: "mm5", 2, 1, "0.5 0.5"<br></code> |
| 53 |
<code> selectObject: mm5, stereo<br></code> |
| 54 |
<code> Mix<br></code> |
| 55 |
<dl> |
| 56 |
<dd>will produce a new mono Sound object that shows a complex tone composed of frequencies 300 and 600 Hz. The amplitudes of the output sound are now half the amplitude of the output sound of example 3.</dd> |
| 57 |
<dt>Example 6 |
| 58 |
</dl> |
| 59 |
<code> mono = Create Sound from formula: "s", 1, 0, 1, 44100, "sin(2*pi*300*x)"<br></code> |
| 60 |
<code> mm6 = Create simple MixingMatrix: "mm6", 1, 2, "1 1"<br></code> |
| 61 |
<code> selectObject: mm6, mono<br></code> |
| 62 |
<code> Mix<br></code> |
| 63 |
<dl> |
| 64 |
<dd>will produce from the mono input sound a stereo output sound that shows a tone of frequency 300 Hz in both channels.</dd> |
| 65 |
<dt>Example 7 |
| 66 |
</dl> |
| 67 |
<code> mm7 = Create simple MixingMatrix: "mm7", 2, 2, "0 1 1 0"<br></code> |
| 68 |
<code> selectObject: mm7, stereo<br></code> |
| 69 |
<code> Mix<br></code> |
| 70 |
<dl> |
| 71 |
<dd>will interchange the channels.</dd> |
| 72 |
<dt>Example 8 |
| 73 |
</dl> |
| 74 |
<h3>Links to this page</h3> |
| 75 |
<ul> |
| 76 |
<li><a href="Create_simple_MixingMatrix___.html">Create simple MixingMatrix...</a> |
| 77 |
<li><a href="Independent_Component_Analysis_on_EEG.html">Independent Component Analysis on EEG</a> |
| 78 |
<li><a href="MixingMatrix__Multiply_input_channel___.html">MixingMatrix: Multiply input channel...</a> |
| 79 |
</ul> |
| 80 |
<hr> |
| 81 |
<address> |
| 82 |
<p>© djmw 20170907</p> |
| 83 |
</address> |
| 84 |
</body> |
| 85 |
</html> |