Debian Codegraph @

dwtools/manual_BSS.cpp

raw
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"
24
25 void manual_BSS (ManPages me);
26 void manual_BSS (ManPages me)
27 {
28 MAN_BEGIN (U"CrossCorrelationTable", U"djmw", 20170908)
29 INTRO (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 NORMAL (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 ENTRY (U"Remarks")
36 NORMAL (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 TERM (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 TERM (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_END
44
45 MAN_BEGIN (U"CrossCorrelationTableList", U"djmw", 20220111)
46 INTRO (U"One of the types of objects in Praat. A CrossCorrelationTableList represents a collection of @@CrossCorrelationTable@ objects.")
47 MAN_END
48
49 MAN_BEGIN (U"CrossCorrelationTableList: Create test set...", U"djmw", 20230801)
50 INTRO (U"Create a collection of @@CrossCorrelationTable@s that are all derived from different diagonal matrices by the same transformation matrix.")
51 ENTRY (U"Settings")
52 SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (4), U""
53 Manual_DRAW_SETTINGS_WINDOW ("CrossCorrelationTableList: Create test set", 4)
54 Manual_DRAW_SETTINGS_WINDOW_FIELD ("Matrix dimension", "5")
55 Manual_DRAW_SETTINGS_WINDOW_FIELD ("Number of matrices", "20")
56 Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("First is positive-definite",1)
57 Manual_DRAW_SETTINGS_WINDOW_FIELD ("Sigma", "0.02")
58 )
59 TERM (U"##Matrix dimension")
60 DEFINITION (U"determines the size of the square matrix with cross-correlations.")
61 TERM (U"##Number of matrices")
62 DEFINITION (U"determines the number of matrices that have to be generated.")
63 TERM (U"##First is positive-definite")
64 DEFINITION (U"guarantees that the first matrix of the series is positive definite.")
65 TERM (U"##Sigma")
66 DEFINITION (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 ENTRY (U"Algorithm")
71 NORMAL (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 NORMAL (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_END
78
79 MAN_BEGIN (U"Create simple MixingMatrix...", U"djmw", 20170908)
80 INTRO (U"Create a new @@MixingMatrix@.")
81 ENTRY (U"Settings")
82 TERM (U"##Number of inputs")
83 DEFINITION (U"defines the number of input channels, i.e. the number of columns in the matrix.")
84 TERM (U"##Number of outputs")
85 DEFINITION (U"defines the number of output channels, i.e. the number of rows in the matrix.")
86 TERM (U"##Mixing coefficients")
87 DEFINITION (U"define the coefficients. You input them row-wise. There have to be %%numberOfOutPuts% \\xx %%numberOfInputs% values. ")
88 MAN_END
89
90 MAN_BEGIN (U"MixingMatrix", U"djmw", 20170907)
91 INTRO (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 NORMAL (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 NORMAL (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 ENTRY (U"Examples")
96 NORMAL (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 CODE (U"stereo = Create Sound from formula: \"s\", 2, 0, 1, 44100, \"sin(2*pi*row*300*x)\"")
98 TERM (U"Example 1")
99 CODE (U"mm1 = Create simple MixingMatrix: \"mm1\", 2, 1, \"1 0\"")
100 CODE (U"selectObject: mm1, stereo")
101 CODE (U"Mix")
102 DEFINITION (U"will produce a new %mono Sound object that shows a tone with a frequency of 300 Hz.")
103 DEFINITION (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 TERM (U"Example 2")
105 CODE (U"mm2 = Create simple MixingMatrix: \"mm2\", 2, 1, \"0 1\"")
106 CODE (U"selectObject: mm2, stereo")
107 CODE (U"Mix")
108 DEFINITION (U"will produce a new mono Sound object that shows a tone with a frequency of 600 Hz.")
109 TERM (U"Example 3")
110 CODE (U"mm3 = Create simple MixingMatrix: \"mm3\", 2, 1, \"1 1\"")
111 CODE (U"selectObject: mm3, stereo")
112 CODE (U"Mix")
113 DEFINITION (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 TERM (U"Example 4")
115 CODE (U"mm4 = Create simple MixingMatrix: \"mm4\", 2, 2, \"1 0 1 0\"")
116 CODE (U"selectObject: mm4, stereo")
117 CODE (U"Mix")
118 DEFINITION (U"will produce a new stereo Sound object that shows a tone of frequency 300 Hz in both channels.")
119 TERM (U"Example 5")
120 CODE (U"mm5 = Create simple MixingMatrix: \"mm5\", 2, 1, \"0.5 0.5\"")
121 CODE (U"selectObject: mm5, stereo")
122 CODE (U"Mix")
123 DEFINITION (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 TERM (U"Example 6")
125 CODE (U"mono = Create Sound from formula: \"s\", 1, 0, 1, 44100, \"sin(2*pi*300*x)\"")
126 CODE (U"mm6 = Create simple MixingMatrix: \"mm6\", 1, 2, \"1 1\"")
127 CODE (U"selectObject: mm6, mono")
128 CODE (U"Mix")
129 DEFINITION (U"will produce from the mono input sound a stereo output sound that shows a tone of frequency 300 Hz in both channels.")
130 TERM (U"Example 7")
131 CODE (U"mm7 = Create simple MixingMatrix: \"mm7\", 2, 2, \"0 1 1 0\"")
132 CODE (U"selectObject: mm7, stereo")
133 CODE (U"Mix")
134 DEFINITION (U"will interchange the channels.")
135 TERM (U"Example 8")
136
137 MAN_END
138
139 MAN_BEGIN (U"MixingMatrix: Multiply input channel...", U"djmw", 20170908)
140 INTRO (U"Multiply an input channel of the selected @@MixingMatrix@ by a value.")
141 ENTRY (U"Examples")
142 TERM (U"Increase the contribution of input channel 1 in each output channel by a factor of 2")
143 CODE (U"Multiply input channel: 1, 2")
144 TERM (U"Remove the contribution of channel 1 in each output channel")
145 CODE (U"Multiply input channel: 1, 0")
146 MAN_END
147
148 MAN_BEGIN (U"Sound: To CrossCorrelationTable...", U"djmw", 20110212)
149 INTRO (U"A command that creates a @@CrossCorrelationTable@ form every selected @@Sound@ object.")
150 ENTRY (U"Settings")
151 SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (2), U""
152 Manual_DRAW_SETTINGS_WINDOW ("Sound: To CrossCorrelationTable", 2)
153 Manual_DRAW_SETTINGS_WINDOW_RANGE("Time range", "0.0", "10.0")
154 Manual_DRAW_SETTINGS_WINDOW_FIELD ("Lag time", "0.0")
155 )
156 TERM (U"##Time range (s)#,")
157 DEFINITION (U"determines the time range over which the table is calculated.")
158 TERM (U"##Lag time (s)#,")
159 DEFINITION (U"determines the lag time.")
160 ENTRY (U"Algorithm")
161 NORMAL (U"The cross-correlation between channel %i and channel %j for lag time \\ta is defined as the "
162 "discretized #integral")
163 EQUATION (U"cross-corr (%c__%i_, %c__%j_) [%\\ta] \\=3 \\su__%t_ %c__%i_[%t] %c__%j_[%t+%\\ta] %%\\Det%,")
164 NORMAL (U"where %t and %t+%\\ta are discrete times and %%\\Det% is the @@sampling period@. ")
165 MAN_END
166
167 MAN_BEGIN (U"Sound: To Covariance (channels)...", U"djmw", 20120303)
168 INTRO (U"Detemines the @@Covariance|covariances@ between the channels of a selected @Sound.")
169 NORMAL (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_END
171
172 MAN_BEGIN (U"Sound: To Sound (blind source separation)...", U"djmw", 20190811)
173 INTRO (U"Analyze the selected multi-channel sound into its independent components by an iterative method.")
174 NORMAL (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 ENTRY (U"Settings")
177 SCRIPT (5.4, Manual_SETTINGS_WINDOW_HEIGHT (6), U""
178 Manual_DRAW_SETTINGS_WINDOW ("Sound: To Sound (blind source separation)", 6)
179 Manual_DRAW_SETTINGS_WINDOW_RANGE("Time range (s)", "0.0", "10.0")
180 Manual_DRAW_SETTINGS_WINDOW_FIELD ("Number of cross-correlations", "20")
181 Manual_DRAW_SETTINGS_WINDOW_FIELD ("Lag times", "0.002")
182 Manual_DRAW_SETTINGS_WINDOW_FIELD ("Maximum number of iterations", "100")
183 Manual_DRAW_SETTINGS_WINDOW_FIELD ("Tolerance", "0.001")
184 Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU("Diagonalization method", "ffdiag")
185 )
186 TERM (U"##Time range (s)")
187 DEFINITION (U"defines the time range over which the ##CrossCorrelationTable#s of the sound will be calculated.")
188 TERM (U"##Number of cross-correlations")
189 DEFINITION (U"defines the number of ##CrossCorrelationTable#s to be calculated.")
190 TERM (U"##Lag times")
191 DEFINITION (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 TERM (U"##Maximum number of iterations")
194 DEFINITION (U"defines a stopping criterion for the iteration. The iteration will stops when this number is reached.")
195 TERM (U"##Tolerance")
196 DEFINITION (U"defines another stopping criterion that depends on the method used.")
197 TERM (U"##Diagonalization method")
198 DEFINITION (U"defines the method to determine the independent components.")
199 ENTRY (U"Algorithm")
200 NORMAL (U"This method tries to decompose the sound according to the %%instantaneous% mixing model")
201 EQUATION (U"#Y=#A\\.c#X.")
202 NORMAL (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 NORMAL (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 NORMAL (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 EQUATION (U"#C(\\ta)=#A\\.c#D(\\ta)\\.c#A\\'p, for all values of the lag time \\ta.")
222 NORMAL (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 NORMAL (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 NORMAL (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 NORMAL (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 ENTRY (U"Example")
236 NORMAL (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 CODE (U"synth = Create SpeechSynthesizer: \"English (Great Britain)\", \"Female1\"")
238 CODE (U"s1 = To Sound: \"This is some text\", \"no\"")
239 NORMAL (U"The first speech sound was created from the text \"This is some text\" at a speed of 175 words per minute.")
240 CODE (U"selectObject: synth")
241 CODE (U"Speech output settings: 44100, 0.01, 1.2, 1.0, 145, \"IPA\"")
242 CODE (U"Estimate speech rate from speech: \"no\"")
243 CODE (U"s2 = To Sound.: \"Abracadabra, abra\", \"no\"")
244 NORMAL (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 CODE (U"plusObject: s1")
246 CODE (U"stereo = Combine to stereo")
247 NORMAL (U"We combine the two separate sounds into one stereo sound because our blind source separation works on multichannel sounds only.")
248 CODE (U"mm = Create simple MixingMatrix: \"mm\", 2, 2, \"1.0 2.0 2.0 1.0\"")
249 NORMAL (U"A two by two MixingMatrix is created.")
250 CODE (U"plusObject: stereo")
251 CODE (U"Mix")
252 NORMAL (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 CODE (U"To Sound (blind source separation): 0.1, 1, 20, 0.0002, 100, 0.001, \"ffdiag\"")
256 NORMAL (U"The two channels in the new sound that results from this command contain a reasonable approximation of "
257 "the two originating sounds.")
258 NORMAL (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 SCRIPT (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 NORMAL (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 NORMAL (U"The complete script:")
289 CODE (U"syn = Create SpeechSynthesizer: \"English (Great Britain)\", \"Female1\"")
290 CODE (U"s1 = To Sound: \"This is some text\", \"no\"")
291 CODE (U"selectObject: syn")
292 CODE (U"Speech output settings: 44100, 0.01, 1.2, 1.0, 145, \"IPA\"")
293 CODE (U"Estimate speech rate from speech: \"no\"")
294 CODE (U"s2 = To Sound: \"abracadabra, abra\", \"no\"")
295 CODE (U"plusObject: s1")
296 CODE (U"stereo = Combine to stereo")
297 CODE (U"Select inner viewport: 1, 6, 0.1, 1.9")
298 CODE (U"Draw: 0, 0, 0, 0, \"no\", \"Curve\"")
299 CODE (U"Draw inner box")
300 CODE (U"mm = Create simple MixingMatrix: \"mm\", 2, 2, \"1.0 2.0 2.0 1.0\"")
301 CODE (U"plusObject: stereo")
302 CODE (U"mixed = Mix")
303 CODE (U"Select inner viewport: 1, 6, 2.1, 3.9")
304 CODE (U"Draw: 0, 0, 0, 0, \"no\", \"Curve\"")
305 CODE (U"Draw inner box")
306 CODE (U"unmixed = To Sound (bss): 0.1, 1, 20, 0.00021, 100, 0.001, \"ffdiag\"")
307 CODE (U"Select inner viewport: 1, 6, 4.1, 5.9")
308 CODE (U"Draw: 0, 0, 0, 0, \"no\", \"Curve\"")
309 CODE (U"Draw inner box")
310 CODE (U"removeObject: unmixed, syn, stereo, s1, s2, mixed, mm")
311 MAN_END
312
313 MAN_BEGIN (U"Sound: To Sound (whiten channels)...", U"djmw", 20120303)
314 INTRO (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 ENTRY (U"Settings")
316 TERM (U"##Variance fraction to keep#,")
317 DEFINITION (U"determines, indirectly, how many channels the final sound will have.")
318 ENTRY (U"Algorithm")
319 NORMAL (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 NORMAL (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 NORMAL (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_END
326
327 MAN_BEGIN (U"blind source separation", U"djmw", 20120907)
328 INTRO (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 NORMAL (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_ITEM (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_ITEM (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_ITEM (U"\\bu Varying distances to microphones: one or more speakers might be moving. This makes the mixing time dependent.")
336 NORMAL (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 ENTRY (U"Typology of mixtures")
338 NORMAL (U"In general two different types of mixtures are considered in the literature: %%instantaneous "
339 "mixtures% and %%convolutive mixtures%. ")
340 TERM (U"%%Instantaneous mixtures%")
341 DEFINITION (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 TERM (U"%%Convolutive mixtures%")
347 DEFINITION (U"are mixtures where the mixing is of convolutive nature, i.e. the model is ")
348 EQUATION (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 DEFINITION (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 ENTRY (U"Solving the blind source separation for instantaneous mixtures")
351 NORMAL (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 NORMAL (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 ENTRY (U"Solving the blind source separation for convolutive mixtures")
360 NORMAL (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_END
367
368 MAN_BEGIN (U"reverberation time", U"djmw", 20110107)
369 NORMAL (U"Reverberation is the persistence of sound in a room after the sound source has silenced. ")
370 NORMAL (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_END
375
376 MAN_BEGIN (U"Vollgraf & Obermayer (2006)", U"djmw", 20110105)
377 NORMAL (U"Roland Vollgraf & Klaus Obermayer (2006): \"Quadratic optimization for simultaneous matrix "
378 "diagonalization.\" %%IEEE Transactions On Signal Processing% #54: 3270\\--3278.")
379 MAN_END
380
381 MAN_BEGIN (U"Ziehe et al. (2004)", U"djmw", 20110105)
382 NORMAL (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_END
386
387 }
388
389 /* End of file manual_BSS.cpp */
390