Debian Codegraph @

dwtools/manual_BSS.cpp

raw symbols SCIP
1 /* manual_BSS.cpp
2 *
3 * Copyright (C) 2010-2023,2025 David Weenink
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /*
20 djmw 20101227 Initial version
21 */
22
23 #include "ManPagesM.h"cxx . . $ `<file>/sys/ManPagesM.h`/
24
25 void manual_BSScxx . . $ manual_BSS(e57bd08652fa63a5). (ManPagescxx . . $ ManPages# me);
26 void manual_BSScxx . . $ manual_BSS(e57bd08652fa63a5). (ManPagescxx . . $ ManPages# me)
27 {
28 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"CrossCorrelationTable", U"djmw", 20170908)
29 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"One of the types of objects in Praat. A ##CrossCorrelationTable# represents the cross-correlations between "
30 "a number of signals. Cell [%i,%j] of a CrossCorrelationTable contains the cross-correlation between the %i-th "
31 "and the %j-th signal. For example, the CrossCorrelationTable of an %n-channel sound is a %n\\xx%n table where "
32 "the number in cell [%i,%j] is the cross-correlation of channel %i with channel %j (for a particular lag time %\\ta).")
33 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"A CrossCorrelationTable has a square matrix whose cells contain the cross-correlations between "
34 "the signals and a centroid vector with the average value of each signal.")
35 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Remarks")
36 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Sometimes in the statistical literature, the cross-correlation between signals is also called "
37 "\"covariance\". However, the only thing a @@Covariance@ has in common with a CrossCorrelationTable is that "
38 "both are symmetric matrices. The differences between a CrossCorrelationTable and a Covariance are:")
39 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"1. A Covariance matrix is always positive-definite; for a cross-correlation table this is only guaranteed if "
40 "the lag time %\\ta = 0.")
41 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"2. The elements %%c__ij_% in a Covariance always satisfy |%%c__ij_%/\\Vr(%%c__ii_%\\.c%%c__jj_%)| \\<_ 1; this is "
42 "generally not the case for cross-correlations.")
43 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
44
45 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"CrossCorrelationTableList", U"djmw", 20220111)
46 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"One of the types of objects in Praat. A CrossCorrelationTableList represents a collection of @@CrossCorrelationTable@ objects.")
47 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
48
49 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"CrossCorrelationTableList: Create test set...", U"djmw", 20230801)
50 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Create a collection of @@CrossCorrelationTable@s that are all derived from different diagonal matrices by the same transformation matrix.")
51 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Settings")
52 SCRIPTcxx . . $ `sys/ManPagesM.h:59:9`! (5.4, Manual_SETTINGS_WINDOW_HEIGHTcxx . . $ `sys/ManPagesM.h:82:9`! (4), U""
53 Manual_DRAW_SETTINGS_WINDOWcxx . . $ `sys/ManPagesM.h:83:9`! ("CrossCorrelationTableList: Create test set", 4)
54 Manual_DRAW_SETTINGS_WINDOW_FIELDcxx . . $ `sys/ManPagesM.h:118:9`! ("Matrix dimension", "5")
55 Manual_DRAW_SETTINGS_WINDOW_FIELDcxx . . $ `sys/ManPagesM.h:118:9`! ("Number of matrices", "20")
56 Manual_DRAW_SETTINGS_WINDOW_BOOLEANcxx . . $ `sys/ManPagesM.h:137:9`!("First is positive-definite",1)
57 Manual_DRAW_SETTINGS_WINDOW_FIELDcxx . . $ `sys/ManPagesM.h:118:9`! ("Sigma", "0.02")
58 )
59 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Matrix dimension")
60 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines the size of the square matrix with cross-correlations.")
61 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Number of matrices")
62 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines the number of matrices that have to be generated.")
63 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##First is positive-definite")
64 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"guarantees that the first matrix of the series is positive definite.")
65 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Sigma")
66 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"the standard deviation of the noise that is added to each transformation matrix element. A value "
67 "of zero makes all the cross-correlation matrices jointly diagonalizable. A value greater than zero "
68 "makes each transformation matrix a little different and the collection not jointly "
69 "diagonalizable anymore.")
70 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Algorithm")
71 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"All the CrossCorrelationTable matrices are generated as #%V\\'p #%D__%k_ #%V, where #%D__%k_ is a diagonal matrix "
72 "with entries randomly chosen from the [-1,1] interval. The matrix #%V is a \"random\" orthogonal matrix "
73 "obtained from the singular value decomposition of a matrix #%M = #%U #%D #%V\\'p, where the cells of the "
74 "matrix #%M are random Gaussian numbers with mean 0 and standard deviation 1.")
75 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"If the first matrix has to be positive definite, the numbers on the diagonal of #%D__1_ are randomly "
76 "chosen from the [0.1,1] interval.")
77 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
78
79 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Create simple MixingMatrix...", U"djmw", 20170908)
80 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Create a new @@MixingMatrix@.")
81 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Settings")
82 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Number of inputs")
83 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"defines the number of input channels, i.e. the number of columns in the matrix.")
84 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Number of outputs")
85 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"defines the number of output channels, i.e. the number of rows in the matrix.")
86 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Mixing coefficients")
87 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"define the coefficients. You input them row-wise. There have to be %%numberOfOutPuts% \\xx %%numberOfInputs% values. ")
88 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
89
90 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"MixingMatrix", U"djmw", 20170907)
91 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"One of the @@Types of objects|type of Objects@ in Praat. A ##MixingMatrix# shows a mapping of the channels of an input @Sound to the channels of an output Sound. A channel in the input sound is called an %%input% channel. Each output channel is a linear combination of input channels. ")
92 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The mixing of input channels can be written as the matrix multiplication ##R=M\\.cS#. Here #S is the matrix that represents the input sound, with %numberOfInputs% rows and %%numberOfSamples% columns. Each row in #S corresponds to one input channel. #M is the %%numberOfOutputChannels%\\xx %%numberOfInputs% MixingMatrix and #R is the %%numberOfOutputChannels%\\xx %%numberOfSamples% matrix that is the result of the mixing.")
93 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Row %i in the MixingMatrix #M therefore represents the weights %m__%ij_ of the different input channels %j in output channel %i, the number of rows of #M determines the number of output channels in the resulting #R. Column %j in #M represents the weight factors %m__%ij_ of input %j in the different output channels %i.")
94
95 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Examples")
96 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Given the following stereo Sound with a tone of 300 Hz in channel 1 and a tone of 600 Hz in channel two: ")
97 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"stereo = Create Sound from formula: \"s\", 2, 0, 1, 44100, \"sin(2*pi*row*300*x)\"")
98 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Example 1")
99 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm1 = Create simple MixingMatrix: \"mm1\", 2, 1, \"1 0\"")
100 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: mm1, stereo")
101 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Mix")
102 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"will produce a new %mono Sound object that shows a tone with a frequency of 300 Hz.")
103 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"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.")
104 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Example 2")
105 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm2 = Create simple MixingMatrix: \"mm2\", 2, 1, \"0 1\"")
106 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: mm2, stereo")
107 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Mix")
108 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"will produce a new mono Sound object that shows a tone with a frequency of 600 Hz.")
109 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Example 3")
110 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm3 = Create simple MixingMatrix: \"mm3\", 2, 1, \"1 1\"")
111 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: mm3, stereo")
112 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Mix")
113 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"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")
114 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Example 4")
115 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm4 = Create simple MixingMatrix: \"mm4\", 2, 2, \"1 0 1 0\"")
116 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: mm4, stereo")
117 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Mix")
118 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"will produce a new stereo Sound object that shows a tone of frequency 300 Hz in both channels.")
119 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Example 5")
120 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm5 = Create simple MixingMatrix: \"mm5\", 2, 1, \"0.5 0.5\"")
121 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: mm5, stereo")
122 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Mix")
123 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"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.")
124 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Example 6")
125 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mono = Create Sound from formula: \"s\", 1, 0, 1, 44100, \"sin(2*pi*300*x)\"")
126 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm6 = Create simple MixingMatrix: \"mm6\", 1, 2, \"1 1\"")
127 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: mm6, mono")
128 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Mix")
129 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"will produce from the mono input sound a stereo output sound that shows a tone of frequency 300 Hz in both channels.")
130 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Example 7")
131 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm7 = Create simple MixingMatrix: \"mm7\", 2, 2, \"0 1 1 0\"")
132 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: mm7, stereo")
133 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Mix")
134 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"will interchange the channels.")
135 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Example 8")
136
137 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
138
139 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"MixingMatrix: Multiply input channel...", U"djmw", 20170908)
140 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Multiply an input channel of the selected @@MixingMatrix@ by a value.")
141 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Examples")
142 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Increase the contribution of input channel 1 in each output channel by a factor of 2")
143 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Multiply input channel: 1, 2")
144 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"Remove the contribution of channel 1 in each output channel")
145 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Multiply input channel: 1, 0")
146 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
147
148 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Sound: To CrossCorrelationTable...", U"djmw", 20110212)
149 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"A command that creates a @@CrossCorrelationTable@ form every selected @@Sound@ object.")
150 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Settings")
151 SCRIPTcxx . . $ `sys/ManPagesM.h:59:9`! (5.4, Manual_SETTINGS_WINDOW_HEIGHTcxx . . $ `sys/ManPagesM.h:82:9`! (2), U""
152 Manual_DRAW_SETTINGS_WINDOWcxx . . $ `sys/ManPagesM.h:83:9`! ("Sound: To CrossCorrelationTable", 2)
153 Manual_DRAW_SETTINGS_WINDOW_RANGEcxx . . $ `sys/ManPagesM.h:126:9`!("Time range", "0.0", "10.0")
154 Manual_DRAW_SETTINGS_WINDOW_FIELDcxx . . $ `sys/ManPagesM.h:118:9`! ("Lag time", "0.0")
155 )
156 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Time range (s)#,")
157 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines the time range over which the table is calculated.")
158 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Lag time (s)#,")
159 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines the lag time.")
160 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Algorithm")
161 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The cross-correlation between channel %i and channel %j for lag time \\ta is defined as the "
162 "discretized #integral")
163 EQUATIONcxx . . $ `sys/ManPagesM.h:57:9`! (U"cross-corr (%c__%i_, %c__%j_) [%\\ta] \\=3 \\su__%t_ %c__%i_[%t] %c__%j_[%t+%\\ta] %%\\Det%,")
164 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"where %t and %t+%\\ta are discrete times and %%\\Det% is the @@sampling period@. ")
165 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
166
167 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Sound: To Covariance (channels)...", U"djmw", 20120303)
168 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Detemines the @@Covariance|covariances@ between the channels of a selected @Sound.")
169 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The covariance of a sound is determined by calculating the @@CrossCorrelationTable@ of a multichannel sound for a lag time equal to zero.")
170 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
171
172 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Sound: To Sound (blind source separation)...", U"djmw", 20190811)
173 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Analyze the selected multi-channel sound into its independent components by an iterative method.")
174 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The @@blind source separation@ method to find the independent components tries to simultaneously diagonalize a number of "
175 "@@CrossCorrelationTable@s that are calculated from the multi-channel sound at different lag times.")
176 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Settings")
177 SCRIPTcxx . . $ `sys/ManPagesM.h:59:9`! (5.4, Manual_SETTINGS_WINDOW_HEIGHTcxx . . $ `sys/ManPagesM.h:82:9`! (6), U""
178 Manual_DRAW_SETTINGS_WINDOWcxx . . $ `sys/ManPagesM.h:83:9`! ("Sound: To Sound (blind source separation)", 6)
179 Manual_DRAW_SETTINGS_WINDOW_RANGEcxx . . $ `sys/ManPagesM.h:126:9`!("Time range (s)", "0.0", "10.0")
180 Manual_DRAW_SETTINGS_WINDOW_FIELDcxx . . $ `sys/ManPagesM.h:118:9`! ("Number of cross-correlations", "20")
181 Manual_DRAW_SETTINGS_WINDOW_FIELDcxx . . $ `sys/ManPagesM.h:118:9`! ("Lag times", "0.002")
182 Manual_DRAW_SETTINGS_WINDOW_FIELDcxx . . $ `sys/ManPagesM.h:118:9`! ("Maximum number of iterations", "100")
183 Manual_DRAW_SETTINGS_WINDOW_FIELDcxx . . $ `sys/ManPagesM.h:118:9`! ("Tolerance", "0.001")
184 Manual_DRAW_SETTINGS_WINDOW_OPTIONMENUcxx . . $ `sys/ManPagesM.h:160:9`!("Diagonalization method", "ffdiag")
185 )
186 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Time range (s)")
187 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"defines the time range over which the ##CrossCorrelationTable#s of the sound will be calculated.")
188 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Number of cross-correlations")
189 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"defines the number of ##CrossCorrelationTable#s to be calculated.")
190 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Lag times")
191 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"defines the lag time %\\ta__0_ for the ##CrossCorrelationTable#s. These tables "
192 "are calculated at lag times %\\ta__k_=(%k - 1)%\\ta__0_, where %k runs from 1 to %%numberOfCrosscorrelations%.")
193 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Maximum number of iterations")
194 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"defines a stopping criterion for the iteration. The iteration will stops when this number is reached.")
195 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Tolerance")
196 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"defines another stopping criterion that depends on the method used.")
197 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Diagonalization method")
198 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"defines the method to determine the independent components.")
199 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Algorithm")
200 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"This method tries to decompose the sound according to the %%instantaneous% mixing model")
201 EQUATIONcxx . . $ `sys/ManPagesM.h:57:9`! (U"#Y=#A\\.c#X.")
202 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In this model #Y is a matrix with the selected multi-channel sound, #A is a so-called "
203 "%%mixing matrix% and #X is a matrix with the independent components. "
204 "Essentially the model says that each channel in the multi-channel sound is a linear combination of the "
205 "independent sound components in #X. "
206 "If we would know the mixing matrix #A we could easily solve the model above for #X by standard means. "
207 "However, if we don't know #A and we don't know #X, the decomposition of #Y is underdetermined. This means there "
208 "are an infinite number of possible combinations of #A and #X that result in the same #Y. ")
209 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"One approach to solve the equation above is to make assumptions about the statistical properties "
210 "of the components in the matrix #X: it turns out that a sufficient assumption is to assume that the "
211 "components in #X at each time instant are %%statistically independent%. This is not an unrealistic "
212 "assumption in many cases, although in practice it need not be exactly the case. Another assumption is "
213 "that the mixing matrix is constant, which means that the mixing conditions did not change during the recoding of the sound." )
214 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The theory says that statistically independent signals are not correlated (although the reverse "
215 "is not always true: signals that are not correlated don't have to be statistically independent). "
216 "The methods implemented here all follow this lead as follows. If we calculate the @@CrossCorrelationTable@ "
217 "for the left and the right side signals of the equation above, then, "
218 "for the multi-channel sound #Y this will result in a cross-correlation matrix #C. For the right side we "
219 "obtain #A\\.c#D\\.c#A\\'p, where #D is a diagonal matrix because all the cross-correlations between "
220 "different independent components are zero by definition. This results in the following identity: ")
221 EQUATIONcxx . . $ `sys/ManPagesM.h:57:9`! (U"#C(\\ta)=#A\\.c#D(\\ta)\\.c#A\\'p, for all values of the lag time \\ta.")
222 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"This equation says that, given the model, the cross-correlation matrix can be diagonalized for "
223 "all values of the lag time %%by the same transformation matrix% #A.")
224 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"If we calculate the cross-correlation matrices for a number of different lag times, say 20, we "
225 "then have to obtain the matrix #A that diagonalizes them all. Unfortunately there is no closed form solution "
226 "that diagonalizes more than two matrices at the same time and we have to resort to iterative "
227 "algorithms for joint diagonalization. ")
228 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Two of these algorithms are the ##qdiag# method as described in @@Vollgraf & Obermayer (2006)@ "
229 "and the ##ffdiag# method as described in @@Ziehe et al. (2004)@. ")
230 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Unfortunately the convergence criteria of these two algorithms cannot easily be compared as "
231 "the criterion for the ##ffdiag# algorithm is the relative change of the square root of the sum of the "
232 "squared off-diagonal "
233 "elements of the transformed cross-correlation matrices and the criterion for ##qdiag# is the largest "
234 "change in the eigenvectors norm during an iteration.")
235 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Example")
236 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"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.")
237 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"synth = Create SpeechSynthesizer: \"English (Great Britain)\", \"Female1\"")
238 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"s1 = To Sound: \"This is some text\", \"no\"")
239 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The first speech sound was created from the text \"This is some text\" at a speed of 175 words per minute.")
240 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: synth")
241 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Speech output settings: 44100, 0.01, 1.2, 1.0, 145, \"IPA\"")
242 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Estimate speech rate from speech: \"no\"")
243 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"s2 = To Sound.: \"Abracadabra, abra\", \"no\"")
244 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The second sound \"Abracadabra, abra\" was synthesized at 145 words per minute with a somewhat larger pitch excursion (80) than the previous sound (50).")
245 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"plusObject: s1")
246 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"stereo = Combine to stereo")
247 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"We combine the two separate sounds into one stereo sound because our blind source separation works on multichannel sounds only.")
248 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm = Create simple MixingMatrix: \"mm\", 2, 2, \"1.0 2.0 2.0 1.0\"")
249 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"A two by two MixingMatrix is created.")
250 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"plusObject: stereo")
251 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Mix")
252 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The last command, Mix, creates a new two-channel sound where each channel is a linear mixture of the two "
253 "channels in the stereo sound, i.e. channel 1 is the sum of s1 and s2 with mixture strengths of 1 and 2, respectively. "
254 "The second channel is also the sum of s1 and s2 but now with mixture strengths 2 and 1, respectively.")
255 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"To Sound (blind source separation): 0.1, 1, 20, 0.0002, 100, 0.001, \"ffdiag\"")
256 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The two channels in the new sound that results from this command contain a reasonable approximation of "
257 "the two originating sounds.")
258 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In the top panel the two speech sounds \"This is some text\" and \"abracadabra, abra\". "
259 "The middle panel shows the two mixed sounds while the lower panel shows the two sounds after unmixing.")
260 SCRIPTcxx . . $ `sys/ManPagesM.h:59:9`! (6, 6, U" "
261 "syn = Create SpeechSynthesizer: \"English (Great Britain)\", \"Female1\"\n"
262 "s1 = To Sound: \"This is some text\", \"no\"\n"
263 "selectObject: syn\n"
264 "Speech output settings: 44100, 0.01, 1.2, 1.0, 145, \"IPA\"\n"
265 "Estimate speech rate from speech: \"no\"\n"
266 "s2 = To Sound: \"abracadabra, abra\", \"no\"\n"
267 "plusObject: s1\n"
268 "stereo = Combine to stereo\n"
269 "Select inner viewport: 1, 6, 0.1, 1.9\n"
270 "Draw: 0, 0, 0, 0, \"no\", \"Curve\"\n"
271 "Draw inner box\n"
272 "mm = Create simple MixingMatrix: \"mm\", 2, 2, \"1.0 2.0 2.0 1.0\"\n"
273 "plusObject: stereo\n"
274 "mixed = Mix\n"
275 "Select inner viewport: 1, 6, 2.1, 3.9\n"
276 "Draw: 0, 0, 0, 0, \"no\", \"Curve\"\n"
277 "Draw inner box\n"
278 "unmixed = To Sound (bss): 0.1, 1, 20, 0.00021, 100, 0.001, \"ffdiag\"\n"
279 "Select inner viewport: 1, 6, 4.1, 5.9\n"
280 "Draw: 0, 0, 0, 0, \"no\", \"Curve\"\n"
281 "Draw inner box\n"
282 "removeObject: unmixed, syn, stereo, s1, s2, mixed, mm\n"
283 )
284 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The first two panels will not change between different sessions of praat. The last panel, which shows "
285 "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 "
286 "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 @@blind source separation@ manual, the unmixing is only "
287 "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.")
288 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The complete script:")
289 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"syn = Create SpeechSynthesizer: \"English (Great Britain)\", \"Female1\"")
290 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"s1 = To Sound: \"This is some text\", \"no\"")
291 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"selectObject: syn")
292 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Speech output settings: 44100, 0.01, 1.2, 1.0, 145, \"IPA\"")
293 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Estimate speech rate from speech: \"no\"")
294 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"s2 = To Sound: \"abracadabra, abra\", \"no\"")
295 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"plusObject: s1")
296 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"stereo = Combine to stereo")
297 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Select inner viewport: 1, 6, 0.1, 1.9")
298 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Draw: 0, 0, 0, 0, \"no\", \"Curve\"")
299 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Draw inner box")
300 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mm = Create simple MixingMatrix: \"mm\", 2, 2, \"1.0 2.0 2.0 1.0\"")
301 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"plusObject: stereo")
302 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"mixed = Mix")
303 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Select inner viewport: 1, 6, 2.1, 3.9")
304 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Draw: 0, 0, 0, 0, \"no\", \"Curve\"")
305 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Draw inner box")
306 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"unmixed = To Sound (bss): 0.1, 1, 20, 0.00021, 100, 0.001, \"ffdiag\"")
307 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Select inner viewport: 1, 6, 4.1, 5.9")
308 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Draw: 0, 0, 0, 0, \"no\", \"Curve\"")
309 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"Draw inner box")
310 CODEcxx . . $ `sys/ManPagesM.h:50:9`! (U"removeObject: unmixed, syn, stereo, s1, s2, mixed, mm")
311 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
312
313 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Sound: To Sound (whiten channels)...", U"djmw", 20120303)
314 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Transforms the channels of the selected @Sound linearly to make them white, i.e. the new channels will be uncorrelated and their variances equal unity.")
315 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Settings")
316 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"##Variance fraction to keep#,")
317 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"determines, indirectly, how many channels the final sound will have.")
318 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Algorithm")
319 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"We start by determining the @@Sound: To Covariance (channels)...|covariance@ of the selected sound. "
320 "Next a @@Principal component analysis|principal component analysis@ determines the eigenvalues and eigenvectors of the covariance matrix. The settings of the variance fraction to keep determines how many eigenvalues and eigenvectors we use for the whitening. This number, %p, will also be equal to the number of channels of the resulting whitened sound.")
321 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In mathematical terms. For an %n-channel sound, if #E is the matrix with the eigenvectors and #D=diag (%d__1_, %d__2_,..., %d__n_) is the diagonal matrix with the "
322 "eigenvalues of the covariance matrix, then the whitening matrix is #W = #E#D^^-1/2^#E\\'p, where #D^^-1/2^=diag (%d__1_^^-1/2^, ..., %d__p_^^-1/2^, 0, ..., 0). Only the %p most important eigenvalues have been retained, where %p was determined as the smallest integer for which (%d__1_+%d__2_+...%d__%p_)/(%d__1_+%d__2_+ ... + %d__%n_) >= %%varianceFractionToKeep%.")
323 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The resulting sound samples of the whitened sound, %w__%ij_, are then calculated from the samples of the "
324 "original sound, %s__%kj_, as %w__%ij_ = \\Si__%k_ W__%ik_ %s__%kj_, where 1 \\<_ %i \\<_ %p, 1 \\<_ %j \\<_ numberOfSamples and 1 \\<_ %k \\<_ %n.")
325 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
326
327 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"blind source separation", U"djmw", 20120907)
328 INTROcxx . . $ `sys/ManPagesM.h:35:9`! (U"Blind source separation (BSS) is a technique for estimating individual source components from their mixtures "
329 "at multiple sensors. It is called %blind because we don't use any other information besides the mixtures. ")
330 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"For example, imagine a room with a number of persons present and a number of microphones for recording. "
331 "When one or more persons are speaking at the same time, each microphone registers a different %mixture of individual speaker's audio signals. It is the task of BSS to untangle these mixtures into their sources, i.e. the individual speaker's audio signals. "
332 "In general, this is a difficult problem because of several complicating factors. ")
333 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu Different locations of speakers and microphones in the room: the individual speaker's audio signals do not reach all microphones at the same time. ")
334 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu Room acoustics: the signal that reaches a microphone is composed of the signal that %directly travels to the microphone and parts that come from room reverberations and echos. ")
335 LIST_ITEMcxx . . $ `sys/ManPagesM.h:38:9`! (U"\\bu Varying distances to microphones: one or more speakers might be moving. This makes the mixing time dependent.")
336 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"If the number of sensors is %larger than the number of sources we speak of an %overdetermined problem. If the number of sensors and the number of sources are %equal we speak of a %determined problem. The more difficult problem is the %underdetermined one where the number of sensors is %less than the number of sources.")
337 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Typology of mixtures")
338 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"In general two different types of mixtures are considered in the literature: %%instantaneous "
339 "mixtures% and %%convolutive mixtures%. ")
340 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"%%Instantaneous mixtures%")
341 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"where the mixing is instantaneous, corresponds to the model #Y=#A\\.c#X. In this model #Y is a matrix with the recorded microphone sounds, #A is a so-called "
342 "%%mixing matrix% and #X is a matrix with the independent source signals. "
343 "Essentially the model says that the signal that each microphone records is a (possibly different) linear combination of the %same source signals. "
344 "If we would know the mixing matrix #A we could easily solve the model above for #X by standard means. "
345 "However, in general we don't know #A and #X and there are an infinite number of possible decompositions for #Y. The problem is however solvable by making some (mild) assumptions about #A and #X. ")
346 TERMcxx . . $ `sys/ManPagesM.h:42:9`! (U"%%Convolutive mixtures%")
347 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"are mixtures where the mixing is of convolutive nature, i.e. the model is ")
348 EQUATIONcxx . . $ `sys/ManPagesM.h:57:9`! (U"%%y__i_ (n)% = \\Si__%j_^^%d^\\Si__%\\ta_^^M__%ij_-1^ %%h__ij_(\\ta)x__j_(n-\\ta) + N__i_(n)%, for %i=1..m.")
349 DEFINITIONcxx . . $ `sys/ManPagesM.h:46:9`! (U"Here %%y__i_ (n) is the %n-th sample of the %i-th microphone signal, %m is the number of microphones, %%h__ij_(\\ta)% is the multi-input multi-output linear filter with the source-microphone impulse responses that characterize the propagation of the sound in the room and %%N__i_% is a noise source. This model is typically much harder to solve than the previous one because of the %%h__ij_(\\ta)% filter term that can have thousands of coefficients. For example, the typical @@reverberation time@ of a room is approximately 0.3 s which corresponds to 2400 samples, i.e. filter coefficients, for an 8 kHz sampled sound.")
350 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Solving the blind source separation for instantaneous mixtures")
351 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Various techniques exist for solving the blind source separation problem for %instantaneous mixtures. Very popular ones make make use of second order statistics (SOS) by trying to "
352 "simultaneously diagonalize a large number of cross-correlation matrices. Other techniques like independent component analysis use higher order statistics (HOS) to find the independent components, i.e. the sources.")
353 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Given the decomposition problem #Y=#A\\.c#X, we can see that the solution is determined "
354 "only upto a permutation and a scaling of the components. This is called the %%indeterminancy "
355 "problem% of BSS. This can be seen as follows: given a permutation matrix #P, i.e. a matrix which "
356 "contains only zeros except for one 1 in every row and column, and a diagonal scaling matrix #D, any "
357 "scaling and permutation of the independent components #X__%n_=(#D\\.c#P)\\.c#X can be compensated "
358 "by the reversed scaling of the mixing matrix #A__%n_=#A\\.c(#D\\.c#P)^^-1^ because #A\\.c(#D\\.c#P)^^-1^\\.c(#D\\.c#P)\\.c#X = #A\\.c#X = #Y. ")
359 ENTRYcxx . . $ `sys/ManPagesM.h:36:9`! (U"Solving the blind source separation for convolutive mixtures")
360 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Solutions for %convolutive mixture problems are much harder to achieve. "
361 "One normally starts by transforming the problem to the frequency domain where the "
362 "convolution is turned into a multiplication. The problem then translates into a separate "
363 "%%instantaneous% mixing problem for %%each% frequency in the frequency domain. It is here that "
364 "the indeterminacy problem hits us because it is not clear beforehand how to combine the "
365 "independent components of each frequency bin.")
366 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
367
368 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"reverberation time", U"djmw", 20110107)
369 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Reverberation is the persistence of sound in a room after the sound source has silenced. ")
370 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"The %%reverberation time% is normally defined as the time required for the persistence of a direct sound "
371 "to decay by 60 dB after the direct sound has silenced. Sometimes this dB level is indicated with a subscript "
372 "and the reverberation time is given by the symbol %T__60_. "
373 "The reverberation time depends mainly on a room's volume and area and on the absorption at the walls. Generally absorption is frequency dependent and therefore the reverberation time of a room varies with frequency. ")
374 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
375
376 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Vollgraf & Obermayer (2006)", U"djmw", 20110105)
377 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Roland Vollgraf & Klaus Obermayer (2006): \"Quadratic optimization for simultaneous matrix "
378 "diagonalization.\" %%IEEE Transactions On Signal Processing% #54: 3270\\--3278.")
379 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
380
381 MAN_BEGINcxx . . $ `sys/ManPagesM.h:33:9`! (U"Ziehe et al. (2004)", U"djmw", 20110105)
382 NORMALcxx . . $ `sys/ManPagesM.h:37:9`! (U"Andreas Ziehe, Pavel Laskov, Guido Nolte & Klaus-Robert M\\u\"ller (2004): \"A fast algorithm for joint "
383 "diagonalization with non-orthogonal transformations and its application to blind source separation\", "
384 "%%Journal of Machine Learning Research% #5: 777\\--800.")
385 MAN_ENDcxx . . $ `sys/ManPagesM.h:61:9`!
386
387 }
388
389 /* End of file manual_BSS.cpp */
390