| 1 |
<html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 |
<title>Sound: To Sound (blind source separation)...</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 |
Sound: To Sound (blind source separation)... |
| 13 |
</b></font></table></table> |
| 14 |
<p>Analyze the selected multi-channel sound into its independent components by an iterative method.</p> |
| 15 |
<p>The <a href="blind_source_separation.html">blind source separation</a> method to find the independent components tries to simultaneously diagonalize a number of <a href="CrossCorrelationTable.html">CrossCorrelationTable</a>s that are calculated from the multi-channel sound at different lag times.</p> |
| 16 |
<h2>Settings</h2> |
| 17 |
<p align=middle><img height=380 width=540 src=Sound__To_Sound__blind_source_separation_____1.png></p><dl> |
| 18 |
<dt><b>Time range (s)</b> |
| 19 |
<dd>defines the time range over which the <b>CrossCorrelationTable</b>s of the sound will be calculated.</dd> |
| 20 |
<dt><b>Number of cross-correlations</b> |
| 21 |
<dd>defines the number of <b>CrossCorrelationTable</b>s to be calculated.</dd> |
| 22 |
<dt><b>Lag times</b> |
| 23 |
<dd>defines the lag time <i>τ</i><sub>0</sub> for the <b>CrossCorrelationTable</b>s. These tables are calculated at lag times <i>τ</i><sub>k</sub>=(<i>k</i> - 1)<i>τ</i><sub>0</sub>, where <i>k</i> runs from 1 to <i>numberOfCrosscorrelations</i>.</dd> |
| 24 |
<dt><b>Maximum number of iterations</b> |
| 25 |
<dd>defines a stopping criterion for the iteration. The iteration will stops when this number is reached.</dd> |
| 26 |
<dt><b>Tolerance</b> |
| 27 |
<dd>defines another stopping criterion that depends on the method used.</dd> |
| 28 |
<dt><b>Diagonalization method</b> |
| 29 |
<dd>defines the method to determine the independent components.</dd> |
| 30 |
</dl> |
| 31 |
<h2>Algorithm</h2> |
| 32 |
<p>This method tries to decompose the sound according to the <i>instantaneous</i> mixing model</p> |
| 33 |
<table width="100%" style="white-space:pre-wrap"><tr><td align=middle><b>Y</b>=<b>A</b>·<b>X</b>.</table> |
| 34 |
<p>In this model <b>Y</b> is a matrix with the selected multi-channel sound, <b>A</b> is a so-called <i>mixing matrix</i> and <b>X</b> is a matrix with the independent components. Essentially the model says that each channel in the multi-channel sound is a linear combination of the independent sound components in <b>X</b>. If we would know the mixing matrix <b>A</b> we could easily solve the model above for <b>X</b> by standard means. However, if we don't know <b>A</b> and we don't know <b>X</b>, the decomposition of <b>Y</b> is underdetermined. This means there are an infinite number of possible combinations of <b>A</b> and <b>X</b> that result in the same <b>Y</b>. </p> |
| 35 |
<p>One approach to solve the equation above is to make assumptions about the statistical properties of the components in the matrix <b>X</b>: it turns out that a sufficient assumption is to assume that the components in <b>X</b> at each time instant are <i>statistically independent</i>. This is not an unrealistic assumption in many cases, although in practice it need not be exactly the case. Another assumption is that the mixing matrix is constant, which means that the mixing conditions did not change during the recoding of the sound.</p> |
| 36 |
<p>The theory says that statistically independent signals are not correlated (although the reverse is not always true: signals that are not correlated don't have to be statistically independent). The methods implemented here all follow this lead as follows. If we calculate the <a href="CrossCorrelationTable.html">CrossCorrelationTable</a> for the left and the right side signals of the equation above, then, for the multi-channel sound <b>Y</b> this will result in a cross-correlation matrix <b>C</b>. For the right side we obtain <b>A</b>·<b>D</b>·<b>A</b>′, where <b>D</b> is a diagonal matrix because all the cross-correlations between different independent components are zero by definition. This results in the following identity: </p> |
| 37 |
<table width="100%" style="white-space:pre-wrap"><tr><td align=middle><b>C</b>(τ)=<b>A</b>·<b>D</b>(τ)·<b>A</b>′, for all values of the lag time τ.</table> |
| 38 |
<p>This equation says that, given the model, the cross-correlation matrix can be diagonalized for all values of the lag time <i>by the same transformation matrix</i> <b>A</b>.</p> |
| 39 |
<p>If we calculate the cross-correlation matrices for a number of different lag times, say 20, we then have to obtain the matrix <b>A</b> that diagonalizes them all. Unfortunately there is no closed form solution that diagonalizes more than two matrices at the same time and we have to resort to iterative algorithms for joint diagonalization. </p> |
| 40 |
<p>Two of these algorithms are the <b>qdiag</b> method as described in <a href="Vollgraf___Obermayer__2006_.html">Vollgraf & Obermayer (2006)</a> and the <b>ffdiag</b> method as described in <a href="Ziehe_et_al___2004_.html">Ziehe et al. (2004)</a>. </p> |
| 41 |
<p>Unfortunately the convergence criteria of these two algorithms cannot easily be compared as the criterion for the <b>ffdiag</b> algorithm is the relative change of the square root of the sum of the squared off-diagonal elements of the transformed cross-correlation matrices and the criterion for <b>qdiag</b> is the largest change in the eigenvectors norm during an iteration.</p> |
| 42 |
<h2>Example</h2> |
| 43 |
<p>We start by creating a speech synthesizer that need to create two sounds. We will mix the two sounds and finally our blind source separation software will try to undo our mixing by extracting the two original sounds as well as possible from the two mixtures.</p> |
| 44 |
<code> synth = Create SpeechSynthesizer: "English (Great Britain)", "Female1"<br></code> |
| 45 |
<code> s1 = To Sound: "This is some text", "no"<br></code> |
| 46 |
<p>The first speech sound was created from the text "This is some text" at a speed of 175 words per minute.</p> |
| 47 |
<code> selectObject: synth<br></code> |
| 48 |
<code> Speech output settings: 44100, 0.01, 1.2, 1.0, 145, "IPA"<br></code> |
| 49 |
<code> Estimate speech rate from speech: "no"<br></code> |
| 50 |
<code> s2 = To Sound.: "Abracadabra, abra", "no"<br></code> |
| 51 |
<p>The second sound "Abracadabra, abra" was synthesized at 145 words per minute with a somewhat larger pitch excursion (80) than the previous sound (50).</p> |
| 52 |
<code> plusObject: s1<br></code> |
| 53 |
<code> stereo = Combine to stereo<br></code> |
| 54 |
<p>We combine the two separate sounds into one stereo sound because our blind source separation works on multichannel sounds only.</p> |
| 55 |
<code> mm = Create simple MixingMatrix: "mm", 2, 2, "1.0 2.0 2.0 1.0"<br></code> |
| 56 |
<p>A two by two MixingMatrix is created.</p> |
| 57 |
<code> plusObject: stereo<br></code> |
| 58 |
<code> Mix<br></code> |
| 59 |
<p>The last command, Mix, creates a new two-channel sound where each channel is a linear mixture of the two channels in the stereo sound, i.e. channel 1 is the sum of s1 and s2 with mixture strengths of 1 and 2, respectively. The second channel is also the sum of s1 and s2 but now with mixture strengths 2 and 1, respectively.</p> |
| 60 |
<code> To Sound (blind source separation): 0.1, 1, 20, 0.0002, 100, 0.001, "ffdiag"<br></code> |
| 61 |
<p>The two channels in the new sound that results from this command contain a reasonable approximation of the two originating sounds.</p> |
| 62 |
<p>In the top panel the two speech sounds "This is some text" and "abracadabra, abra". The middle panel shows the two mixed sounds while the lower panel shows the two sounds after unmixing.</p> |
| 63 |
<p align=middle><img height=600 width=600 src=Sound__To_Sound__blind_source_separation_____2.png></p><p>The first two panels will not change between different sessions of praat. The last panel, which shows the result of the blind source separation, i.e. unmixing, will not always be the same because of two things. In the first place the unmixing always starts with an initialisation with random values of the parameters that we have to determine for the blind source separation. Therefore the iteration sequence will never be the same and the final outcomes might differ. In the second place, as was explained in the <a href="blind_source_separation.html">blind source separation</a> manual, the unmixing is only unique up to a scale factor and a permutation. Therefore the channels in the unmixed sound do not necessarily correspond to the corresponding channel in our "original" stereo sound.</p> |
| 64 |
<p>The complete script:</p> |
| 65 |
<code> syn = Create SpeechSynthesizer: "English (Great Britain)", "Female1"<br></code> |
| 66 |
<code> s1 = To Sound: "This is some text", "no"<br></code> |
| 67 |
<code> selectObject: syn<br></code> |
| 68 |
<code> Speech output settings: 44100, 0.01, 1.2, 1.0, 145, "IPA"<br></code> |
| 69 |
<code> Estimate speech rate from speech: "no"<br></code> |
| 70 |
<code> s2 = To Sound: "abracadabra, abra", "no"<br></code> |
| 71 |
<code> plusObject: s1<br></code> |
| 72 |
<code> stereo = Combine to stereo<br></code> |
| 73 |
<code> Select inner viewport: 1, 6, 0.1, 1.9<br></code> |
| 74 |
<code> Draw: 0, 0, 0, 0, "no", "Curve"<br></code> |
| 75 |
<code> Draw inner box<br></code> |
| 76 |
<code> mm = Create simple MixingMatrix: "mm", 2, 2, "1.0 2.0 2.0 1.0"<br></code> |
| 77 |
<code> plusObject: stereo<br></code> |
| 78 |
<code> mixed = Mix<br></code> |
| 79 |
<code> Select inner viewport: 1, 6, 2.1, 3.9<br></code> |
| 80 |
<code> Draw: 0, 0, 0, 0, "no", "Curve"<br></code> |
| 81 |
<code> Draw inner box<br></code> |
| 82 |
<code> unmixed = To Sound (bss): 0.1, 1, 20, 0.00021, 100, 0.001, "ffdiag"<br></code> |
| 83 |
<code> Select inner viewport: 1, 6, 4.1, 5.9<br></code> |
| 84 |
<code> Draw: 0, 0, 0, 0, "no", "Curve"<br></code> |
| 85 |
<code> Draw inner box<br></code> |
| 86 |
<code> removeObject: unmixed, syn, stereo, s1, s2, mixed, mm<br></code> |
| 87 |
<hr> |
| 88 |
<address> |
| 89 |
<p>© djmw 20190811</p> |
| 90 |
</address> |
| 91 |
</body> |
| 92 |
</html> |