| 1 | /* manual_LPC.cpp |
| 2 | * |
| 3 | * Copyright (C) 1994-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 20020422 GPL + removed "C syntax" part of manpage |
| 21 | djmw 20101009 Latest modification |
| 22 | */ |
| 23 | |
| 24 | #include "KlattGrid.h" |
| 25 | #include "ManPagesM.h" |
| 26 | #include "MFCC.h" |
| 27 | |
| 28 | void manual_LPC (ManPages me); |
| 29 | void manual_LPC (ManPages me) |
| 30 | { |
| 31 | MAN_BEGIN (U"Candidate modelling settings...", U"djmw", 20221129) |
| 32 | INTRO (U"A command in the #Candidates menu of the @FormantPathEditor window.") |
| 33 | TERM (U"##Coefficients by track#") |
| 34 | DEFINITION (U"determines how many coefficients will be used in the modelling of a formant track. " |
| 35 | |
| 36 | "The second number determines the number of coefficients for the modelling of formant 2, and so on. " |
| 37 | "For example, if you specify \"4 3 3\", the first three formants will be modelled. Formant 1 will be modelled with 4 " |
| 38 | "coefficients which means that a third order polynomial is used for modelling. Formant 2 and formant 3 are modelled with " |
| 39 | "3 coefficients which means that their tracks will be modelled as parabolas.") |
| 40 | TERM (U"##Variance exponent#") |
| 41 | DEFINITION (U"determines the power of the first term in the overall stress criterion #S. " |
| 42 | "The best model is the one with the lowest value for the stress %S.") |
| 43 | NORMAL (U"The stress criterion #S is defined in @@Weenink (2015)@ as") |
| 44 | EQUATION (U"%S = (%s^2 / %k)^^%varianceExponent^ (%\\ci^^2^ / %d),") |
| 45 | NORMAL (U"where %s^^2^ is the sum of the squares of the standard errors of all the coefficients of the modelled formant " |
| 46 | "tracks within one Formant object, %k is the total number of coefficients of these tracks, in the example given above " |
| 47 | "%k is 10 (= 4 + 3 + 3), \\ci^^2^ is the sum of the chi squares of each track, %d is the sum of the " |
| 48 | "degrees of freedom of each track. " |
| 49 | "Because the standard error %s is proportional to bandwidth and \\ci^^2^ is inversely proportional to bandwidth, " |
| 50 | "the expression for %S grows approximately as 2\\.c%varianceExponent-2 with bandwidth. Setting the %varianceExponent " |
| 51 | "somewhat larger than one guarantees that for two tracks whose formants only differ in their bandwidths, the track with the " |
| 52 | "larger bandwidths obtains a larger value for the stress value %S.") |
| 53 | MAN_END |
| 54 | |
| 55 | MAN_BEGIN (U"CC: Paint...", U"djmw", 20040407) |
| 56 | INTRO (U"A command to paint the cepstral coefficients in shades of grey.") |
| 57 | ENTRY (U"Settings") |
| 58 | TERM (U"##From coefficient#, ##To coefficient#") |
| 59 | DEFINITION (U"the range of coefficients that will be represented.") |
| 60 | MAN_END |
| 61 | |
| 62 | MAN_BEGIN (U"CC: To DTW...", U"djmw", 20221114) |
| 63 | INTRO (U"You can choose this command after selecting two objects with cepstral coefficients (two @MFCC's or @LFCC's). " |
| 64 | "With this command you perform dynamic time warping. ") |
| 65 | ENTRY (U"Algorithm") |
| 66 | NORMAL (U"First we calculate the distance matrix %D of all the distances between the cepstral frames of the two objects. " |
| 67 | "This matrix has %n__1_ rows, the number of frames in the first object, and %n__2_ columns, the number of frames " |
| 68 | "in the second object.") |
| 69 | NORMAL (U"The elements of %D are the distances %d__%ij_ between frame %i (from the first object) and frame %j " |
| 70 | "(from the second one). The %d__%ij_ are composed of three parts:") |
| 71 | EQUATION (U"%d__%ij_ = %w__1_ \\.c %d__1_ + %w__2_ \\.c %d__2_ + %w__3_ \\.c %d__3_,") |
| 72 | NORMAL (U"where %w__1_, %w__2_ and %w__3_ are user-supplied weights and ") |
| 73 | TERM (U"%d__1_ = \\su^^N^__%k=1_ (%c__%ik_ - %c__%jk_)^2), ") |
| 74 | DEFINITION (U"the sum of the squared distances between the %N cepstral coefficients of the two frames. ") |
| 75 | TERM (U"%d__2_ = (c__%i0_ - c__%j0_)^2") |
| 76 | DEFINITION (U"the difference between the average 'power' of the two frames.") |
| 77 | TERM (U"%d__3_ = \\su^^N^__%k=1_ (%r__%ik_ - %r__%jk_)^2), ") |
| 78 | DEFINITION (U"in which %r__%ik_ is the regression coefficient of the cepstral coefficient %k, calculated " |
| 79 | "from the frames within a time span of %T seconds, the %%regression window length%, around the centre of frame %i.") |
| 80 | NORMAL (U"After calculation of all the frame distances %d__%ij_, we find the optimal path through the distance matrix %D with a " |
| 81 | "Viterbi-algorithm.") |
| 82 | MAN_END |
| 83 | |
| 84 | MAN_BEGIN (U"CC: To Matrix", U"djmw", 20011123) |
| 85 | INTRO (U"Copies the cepstral coefficients of the selected @CC " |
| 86 | "object to a newly created @Matrix object.") |
| 87 | ENTRY (U"Behaviour") |
| 88 | EQUATION (U"%z__%ji_ = %c__%ij_, with 1 \\<_ %i \\<_ %nx and " |
| 89 | "1 \\<_ j \\<_ %numberOfCoefficients__%i_,") |
| 90 | NORMAL (U"where %z__%ji_ is the matrix element in row %j and column %i and " |
| 91 | "%c__%ij_ is the %j-th cepstral coefficient in frame %i.") |
| 92 | MAN_END |
| 93 | |
| 94 | MAN_BEGIN (U"Formant: List formant slope...", U"djmw", 20210813) |
| 95 | INTRO (U"A command available in the @@Query submenu@ if you select a @@Formant@ object. The Info window will show the characteristics of the slope of the chosen interval as a vector with a number of values.") |
| 96 | ENTRY (U"Settings") |
| 97 | TERM (U"##Formant number#,") |
| 98 | DEFINITION (U"defines the formant whose slope characteristics you want.") |
| 99 | TERM (U"##Time range (s)#,") |
| 100 | DEFINITION (U"defines the start time and the end time of the segment on which the slope should be determined.") |
| 101 | TERM (U"##Slope curve#") |
| 102 | DEFINITION (U"defines the kind of curve you want to fit on the formant points to determine the slope characteristics. " |
| 103 | "The options available are ##Exponential plus constant#, ##Parabolic# and ##Sigmoid plus constant#.") |
| 104 | ENTRY (U"The vector result") |
| 105 | NORMAL (U"The vector values are determined from the fit of the formant track with a an ##exponential plus constant# function " |
| 106 | "%F(%t) = %a+%b\\.cexp(%c\\.c%t), or a ##parabolic# function %F(%t) = %a+%b\\.ct+%c\\.ct^2, or a ##sigmoid plus constant# function " |
| 107 | "%F(%t) = %a+%b / (1 + exp(- (%t -c) / d)) " |
| 108 | "on the chosen interval [%t__min_, %t__max_].") |
| 109 | TERM (U"##1. Average slope (Hz / s)#") |
| 110 | DEFINITION (U"defined as (%F__start_ - %F__end_) / (%t__max_ - %t__min_), where %F__start_ and %F__end_ are the start and " |
| 111 | "end values of the fitted function %F(%t) and %t__max_ and %t__min_ are the start and end times of the interval.") |
| 112 | TERM (U"##2. %R^2#") |
| 113 | DEFINITION (U"The %R^2 value of the fit defined as %R^2 = 1 - %varianceAfter / %varianceBefore.") |
| 114 | TERM (U"##3. %F__start_#") |
| 115 | DEFINITION (U"the frequency in hertz of the function %F(%t__min_).") |
| 116 | TERM (U"##4. %F__end_#") |
| 117 | DEFINITION (U"the frequency in hertz of the function %F(%t__max_).") |
| 118 | TERM (U"##5. %a#") |
| 119 | DEFINITION (U"the parameter %a (hertz) of the function %F(%t).") |
| 120 | TERM (U"##6. %b#") |
| 121 | DEFINITION (U"the parameter %b of the function %F(%t).") |
| 122 | TERM (U"##7. %c#") |
| 123 | DEFINITION (U"the parameter %c ( / s) of the function %F(%t).") |
| 124 | TERM (U"##8. %d#") |
| 125 | DEFINITION (U"the parameter %d of the function %F(%t), if the sigmoid plus constant function was chosen.") |
| 126 | ENTRY (U"Remarks about the interpretation of the fit parameters.") |
| 127 | NORMAL (U"The returned average slope parameter is reliable only if the formant trajectory is clearly not constant and there is a large difference between the %F__start_ and the %F__end_ values. In cases where the formant trajectory shows a noisy pattern all return values have a large error margin and the determined average slope can also be unreliable.") |
| 128 | ENTRY (U"Algorithm") |
| 129 | NORMAL (U"The algorithm to fit the %%non-linear% exponential plus constant and the sigmoid plus constant functions to a series of (time, frequency) values by a non-iterative algorithm is described in @@Jacquelin (2009)@.") |
| 130 | MAN_END |
| 131 | |
| 132 | MAN_BEGIN (U"HTK parameter file format", U"djmw", 20210311) |
| 133 | INTRO (U"HTK parameter format files consist of a contiguous sequence of frames preceded by a header. " |
| 134 | "Each frame is a vector of either 2-byte integers or 4-byte floats. 2-byte integers are used for " |
| 135 | "compressed forms and for vector quantised data. All multi-byte numbers are written as big-endian numbers.") |
| 136 | NORMAL (U"The HTK file format header is 12 bytes long and contains the following data:") |
| 137 | TERM (U"numberOfFrames (4-byte integer)") |
| 138 | DEFINITION (U"The number of analysis frames in a file") |
| 139 | TERM (U"samplePeriod (4-byte integer)") |
| 140 | DEFINITION (U"The sample period in units of 100 ns. A sampling frequency of 10 kHz would correspond to a sample period of 0.0001 s and to a value of 1000 in this field.") |
| 141 | TERM (U"frameSize (2-byte integer)") |
| 142 | DEFINITION (U"The number of bytes per frame.") |
| 143 | TERM (U"parameterKind (2-byte integer)") |
| 144 | DEFINITION (U"A code indication what kind of frames the file contains.") |
| 145 | ENTRY (U"Remarks") |
| 146 | NORMAL (U"The HTK parameter files do not contain specific information that identifies them as " |
| 147 | "HTK parameter files. However, the file type can be deduced as follows. If we have any file and interpret " |
| 148 | "the first 12 bytes as the above format specifies then we know that the first three numbers read have to " |
| 149 | "be positive integers, that frameSize has to an even number and that %numberOfFrames * %frameSize + 12 must be equal to the number " |
| 150 | "of bytes in the file. The chance that a random data file fulfils these conditions is very small.") |
| 151 | ENTRY (U"VTRFormants data in HTK parameter format") |
| 152 | NORMAL (U"The VTRFormants data of @@Deng et al. (2006)@ can serve as reference formant frequency values for " |
| 153 | "(part of) the TIMIT acoustic phonetic corpus. These data are stored in HTK parameter files with extension \".fb\". " |
| 154 | "They can be download from %%http://www.seas.ucla.edu/spapl/VTRFormants.html%.") |
| 155 | NORMAL (U"HTK parameter files do not contain timing information and therefore we can only calculate the domain of " |
| 156 | "the Formant from external information. From the ##Deng et al. (2006)# paper we assume that the data were taken " |
| 157 | "every 10 ms and therefore the best guess for the duration of the Formant equals %numberOfFrames * 0.01." |
| 158 | "The value in these files for the samplePeriod is 10000 which is a factor 10 off from the correct value of 1000 in units of 100 ns.") |
| 159 | MAN_END |
| 160 | |
| 161 | MAN_BEGIN (U"FormantPath", U"djmw", 20230225) |
| 162 | INTRO (U"One of the @@types of objects@ in Praat. A ##FormantPath# object maintains a path through a collection of " |
| 163 | "Formant objects, each the result of a formant frequency analysis of the same sound but with a different setting " |
| 164 | "of the analysis parameters.") |
| 165 | NORMAL (U"A FormantPath combines a collection of @@Formant@s with a TextGrid that indicates which of these formants is preferred " |
| 166 | "in a certain time interval. ") |
| 167 | NORMAL (U"As an example we consider a FormantPath that has nine Formant objects in its collection. " |
| 168 | "Suppose these formant objects were the result of nine @@Sound: To Formant (burg)...@ analyses of the ##same# sound, " |
| 169 | "however, with a difference only in the \"Formant ceiling (Hz)\" parameter setting which was 4093.7, 4303.5, 4524.2, 4756.1, " |
| 170 | "5000.0, 5256.4, 5525.9, 5809.2, and 6107.0 Hz, respectively. " |
| 171 | "In this way, this collection of Formants functions as a set of alternative analyses where the \"Time step\", " |
| 172 | "the \"Max. number of formants\", the \"Window length\" and the \"Pre-emphasis from\" are constant for each analysis and only " |
| 173 | "the frequency interval in which the number of formants should fit varies. ") |
| 174 | NORMAL (U"You create a FormantPath from a Sound with the @@Sound: To FormantPath (burg)...@ command. The FormantPath example above could have been created from a Sound by:") |
| 175 | CODE (U"To FormantPath (burg): 0.005, 5.0, 5000.0, 0.025, 50.0, 0.05, 4") |
| 176 | NORMAL (U"The Formant object which has a ceiling of 5000 Hz, the object at the middle in the set, here corresponds to the " |
| 177 | "result of the \"standard\" analysis for a male voice where the interval from 0 to 5000 Hz is chosen and we expect, " |
| 178 | "on average, five formant to exist in this interval. ") |
| 179 | NORMAL (U"To choose your own path through the alternatives you can use Praat's @@FormantPathEditor@.") |
| 180 | MAN_END |
| 181 | |
| 182 | MAN_BEGIN (U"FormantPath: Down to Table (optimal interval)...", U"djmw", 20210817) |
| 183 | INTRO (U"A command that creates a @Table with formant frequency values for the chosen interval of the selected @@FormantPath@. The values in the table are from the segment that has the lowest stress value for the fit of its formant tracks.") |
| 184 | MAN_END |
| 185 | |
| 186 | MAN_BEGIN (U"FormantPath: Down to Table (stresses)...", U"djmw", 20230235) |
| 187 | INTRO (U"A command that creates a @Table with stress of fit values for the selected @@FormantPath@.") |
| 188 | NORMAL (U"The resulting Table has one row for each of the ceiling frequencies. The number of columns will depend on the number of " |
| 189 | "formant tracks that are modelled. ") |
| 190 | MAN_END |
| 191 | |
| 192 | MAN_BEGIN (U"Sound: To FormantPath (burg)...", U"djmw", 20230225) |
| 193 | INTRO (U"A command that creates a @@FormantPath@ object from each selected @@Sound@ . ") |
| 194 | ENTRY (U"##Settings") |
| 195 | NORMAL (U"The settings for ##Time step (s)#, ##Maximum number of formants#, ##Window length (s)# and ##Pre-emphasis from (Hz)# " |
| 196 | "are as you would set them with the @@Sound: To Formant (burg)...@ method. " |
| 197 | "The defaults are 0.005 seconds, 5.0 formants, 0.025 seconds, and 50.0 Hz, respectively.") |
| 198 | TERM (U"##Middle formant ceiling (Hz)") |
| 199 | DEFINITION (U"determines the middle formant ceiling frequency in Hz. You normaly would use 5500.0 Hz for an average female voice " |
| 200 | "and 5000.0 Hz for an average male voice as you would do for the ##Formant ceiling (Hz)# setting in ##To Formant (burg)...#. " |
| 201 | "However, instead of performing only one analysis with a fixed ceiling, we perform " |
| 202 | "multiple analyses, each with a different ceiling frequency. The number of analyses with a %%lower% formant ceiling than the " |
| 203 | "%%middle formant ceiling% is equal to the number of analyses with a %%higher% formant ceiling than the %%middle formant ceiling%. ") |
| 204 | TERM (U"##Ceiling step size#") |
| 205 | DEFINITION (U"defines the increase or decrease in the formant ceiling between two successive analyses as exp(%ceilingStepSize) " |
| 206 | "when we step up, or as exp(-%ceilingStepSize) when we step down.") |
| 207 | TERM (U"##Number of steps up / down") |
| 208 | DEFINITION (U"determines the number of steps we go up as well as the number of steps we go down with respect to the %middle formant ceiling%. " |
| 209 | "The ceiling frequency for the %i^^th^ step down is %middleFormantCeiling\\.cexp (-%i\\.c%ceilingStepSize) and for the %i^^th^ step up " |
| 210 | "is %middleFormantCeiling\\.cexp (+%i\\.c%ceilingStepSize). The total number of analyses is always 2\\.c%numberOfStepsUpDown+1.") |
| 211 | ENTRY (U"Algorithm") |
| 212 | NORMAL (U"The following algorithm describes what is going on. ") |
| 213 | CODE (U"ceiling [numberOfStepsUpDown + 1] = middleCeiling") |
| 214 | CODE (U"for istep from 1 to 2 * numberOfStepsUpDown + 1") |
| 215 | CODE1 (U"if istep <= numberOfStepsUpDown") |
| 216 | CODE2 (U"ceiling [istep] = middleFormantCeiling * exp (-(numberOfStepsUpDown - istep + 1) * ceilingStepSize)") |
| 217 | CODE1 (U"elsif istep > numberOfStepsUpOrDown + 1") |
| 218 | CODE2 (U"ceiling [istep] = middleFormantCeiling * exp ((istep - numberOfStepsUpDown - 1) * ceilingStepSize)") |
| 219 | CODE1 (U"selectObject: sound") |
| 220 | CODE1 (U"formant [istep] = To Formant (burg): timeStep, maxNumberOfFormants, ceiling [istep], windowLength, preEmphasis") |
| 221 | CODE (U"endfor") |
| 222 | NORMAL (U"This description is approximate because in the \"To Formant\" step we have to guarantee that all the Formant objects get the same time sampling.") |
| 223 | MAN_END |
| 224 | |
| 225 | MAN_BEGIN (U"FormantPathEditor", U"djmw", 20220816) |
| 226 | INTRO (U"One of the @@Editors@ in Praat, for editing a @@FormantPath@ object.") |
| 227 | NORMAL (U"You can optionally include a @Sound and a @TextGrid in this editor, by selecting both the Sound and the FormantPath together, or the Sound and the TextGrid and the FormantPath together before clicking ##View & Edit#.") |
| 228 | NORMAL (U"With the FormantPathEditor you can, for each interval that you select, " |
| 229 | "replace its formant frequencies and bandwidths by the corresponding values " |
| 230 | "from one of the alternative Formant objects in the FormantPath's collection.") |
| 231 | ENTRY (U"Editor layout") |
| 232 | NORMAL (U"The left part of the editor is similar to the layout of the @@SoundEditor@.") |
| 233 | NORMAL (U"The right part is called the %%selection viewer%. " |
| 234 | "Here you see alternative formant frequency analyses of the selected part of the sound laid out in a grid " |
| 235 | "(or of the whole visible sound window if there is no selection).") |
| 236 | NORMAL (U"The selection viewer shows not only a formant's frequency but also its bandwidth as a vertical line. " |
| 237 | "This will give you a better impression of the analysis results because well defined formants have small bandwidths " |
| 238 | "and, therefore, show short vertical lines.") |
| 239 | ENTRY (U"How to operate") |
| 240 | NORMAL (U"When you start to edit a new FormantPath object, the formants in the path are set equal to the formants of the default " |
| 241 | "analysis. This guarantees that there always is a path at the start. The ceiling of this path is indicated by the fat red " |
| 242 | "line in the upper part of the spectrogram. " |
| 243 | "If you click in one of the rectangles in the selection viewer the values of the formant frequencies (and bandwidths) " |
| 244 | "in the selected part on the left are replaced by the values present in the rectangle and the fat red line will indicate " |
| 245 | "the new ceiling. The colour of the clicked rectangle on the right will also change.") |
| 246 | NORMAL (U"This also works the other way around: if you click near a red line in the spectrogram the corresponding selection viewer " |
| 247 | "will be shown.") |
| 248 | ENTRY (U"Details") |
| 249 | NORMAL (U"The stress numbers that are displayed above the rectangles in the selection viewer " |
| 250 | "are explained in @@Weenink (2015)@. Basically each number is a combined stress score of the individual formant tracks " |
| 251 | "within the rectangle. Each track's stress score quantifies how well the track has been modelled. " |
| 252 | "The lower this number is, the better the track is modelled by a polynomial of the chosen order. " |
| 253 | "The higher the order, the more flexible the curve is and the better it can adapt to the data. " |
| 254 | "The higher the order of the polynomial, the more parameters are needed in the model. " |
| 255 | "You may change the number of parameters that model each track with the ##Candidate modelling settings...# option in the Candidates menu.") |
| 256 | MAN_END |
| 257 | |
| 258 | MAN_BEGIN (U"Formants: Extract smoothest part...", U"djmw", 20140313) |
| 259 | INTRO (U"Extracts the part from one of the selected formants which shows the smoothest formant tracks in a given interval. ") |
| 260 | ENTRY (U"Settings") |
| 261 | SCRIPT (5, Manual_SETTINGS_WINDOW_HEIGHT (5), U"" |
| 262 | Manual_DRAW_SETTINGS_WINDOW (U"Formants: Extract smoothest part", 5) |
| 263 | Manual_DRAW_SETTINGS_WINDOW_RANGE (U"Time range (s)", U"0.0", U"0.0") |
| 264 | Manual_DRAW_SETTINGS_WINDOW_RANGE (U"Fitter formant range", U"1", U"3") |
| 265 | Manual_DRAW_SETTINGS_WINDOW_FIELD (U"Order of polynomials", U"3") |
| 266 | Manual_DRAW_SETTINGS_WINDOW_BOOLEAN (U"Use bandwidths to model formant tracks", 1) |
| 267 | Manual_DRAW_SETTINGS_WINDOW_BOOLEAN (U"Bandwidths for stress test", 0) |
| 268 | ) |
| 269 | TERM (U"##Time range (s)#") |
| 270 | DEFINITION (U"determines the position of the intervals that have to be compared.") |
| 271 | TERM (U"##Fitter formant range") |
| 272 | DEFINITION (U"determines which formant tracks will be modelled with a polynomial function. The goodness of fit of these models " |
| 273 | "will be used in the comparison.") |
| 274 | TERM (U"##Order of polynomials") |
| 275 | DEFINITION (U"determines the maximum order of the polynomials that are used in modelling each formant track. Order 0 means a " |
| 276 | "model which is a constant function; this model needs only one parameter. Order 1 means a model that is a straight line " |
| 277 | "function; this order needs two parameters. Order 2 means that an additional parabolic function is used in the modelling; " |
| 278 | "order 2 needs therefore 3 parameters. In general an order %p model needs %p+1 parameters.") |
| 279 | TERM (U"##Use bandwidths to model formant tracks") |
| 280 | DEFINITION (U"Bandwidths give an indication about the sharpness of a spectral peak. Sharp peaks have small bandwidths and, " |
| 281 | "vice versa, broad peaks have large bandwidths. The width of a peak can also be interpreted as a measure of certainty " |
| 282 | "for its formant frequency value. Setting this option %%on%, the default setting, means that you force the modelling " |
| 283 | "function to be closer to frequencies that are well defined, i.e. that have sharp peaks, than to the frequencies of " |
| 284 | "broad peaks, if choices have to be made. The consequence is that in the model sharp peaks will be better represented than broad peaks.") |
| 285 | TERM (U"##Bandwidths for stress test") |
| 286 | DEFINITION (U"determines whether for the stress determination the formant frequencies are still needed. Not using them anymore " |
| 287 | "probably gives a better indication of the stress of a track.") |
| 288 | MAN_END |
| 289 | |
| 290 | #define PowerCepstrum_manual_pitchRange \ |
| 291 | U"determine the limits of the quefrency range where a peak is searched for. The lower quefrency is determined as " \ |
| 292 | "1 / %%pitchCeiling% and this value is in general more critical than " \ |
| 293 | "the value of the upper quefrency which equals 1 / %%pitchFloor%. A %%pitchCeiling% of 300 Hz will correspond to a " \ |
| 294 | "lower quefrency of 1/300\\~~0.0033 seconds." |
| 295 | |
| 296 | #define PowerCepstrum_manual_trendRange \ |
| 297 | U"the quefrency range for which the amplitudes (in dB) will be modelled by a straight line. " \ |
| 298 | "In @@Hillenbrand et al. (1994)@, the lower value for this range was chosen as 0.001 s " \ |
| 299 | "in order to reduce the effect of very low quefrency data on the straight line fit. In our analysis this value " \ |
| 300 | "is not so critical if we use the robust fitting procedure. If you choose the \"Least squares\" fit method " \ |
| 301 | "then it matters more." |
| 302 | |
| 303 | #define PowerCepstrum_manual_trendType \ |
| 304 | U"defines how to model the cepstrum background. We can model it with a straight line as was " \ |
| 305 | "done in @@Hillenbrand et al. (1994)@. The slope of this line will generally be negative " \ |
| 306 | "because the background amplitudes get weaker for higher quefrencies. Or, we could use an exponential " \ |
| 307 | "model in which the background cepstral amplitudes decay in a non-linear fashion. " |
| 308 | |
| 309 | #define PowerCepstrum_manual_fitMethod \ |
| 310 | U"defines how the line that models the cepstrum background is calculated. The default method, " \ |
| 311 | "\"Robust slow\", corresponds to @@theil regression|Theil's robust line fit@. The \"Robust\" method corresponds to the incomplete theil regression and is computationally faster but somewhat less precise. To be compatible with the past, a standard least squares " \ |
| 312 | "line fit can also be chosen but it is much less precise than the other two because a least squares fit is much more influenced by the peak cepstral values than the other two." |
| 313 | |
| 314 | #define PowerCepstrum_manual_quefrencyAveragingWindow \ |
| 315 | U"determines the width of the averaging window in the quefrency domain. " \ |
| 316 | "By chosing a value of zero, you can prevent any smoothing in the quefrency dimension." |
| 317 | |
| 318 | #define PowerCepstrogram_manual_timeAveraging \ |
| 319 | U"determines the width of the averaging window in the time domain. The result " \ |
| 320 | "of the smoothing will be that in the new smoothed PowerCepstrogram each cepstral value is the average of the cepstral values " \ |
| 321 | "within the averaging window that was positioned symmetrically around the center of this frame in the selected PowerCepstrogram. " \ |
| 322 | "By choosing a value of zero, you can prevent any smoothing in the time dimension. " |
| 323 | |
| 324 | MAN_BEGIN (U"PowerCepstrogram", U"djmw", 20190909) |
| 325 | INTRO (U"One of the @@types of objects@ in Praat. A cepstrogram represents a time-quefrency representation of a sound. " |
| 326 | "Horizontally it shows time, vertically it shows quefrency while the quefrency power density is shown as shades of grey.") |
| 327 | MAN_END |
| 328 | |
| 329 | MAN_BEGIN (U"PowerCepstrogram: Get CPPS...", U"djmw", 20220721) |
| 330 | INTRO (U"A command to get the cepstral peak prominence (CPP) of the selected @@PowerCepstrogram@. ") |
| 331 | NORMAL (U"The returned value is the average of the cepstral peak prominences of the individual frames.") |
| 332 | ENTRY (U"Settings") |
| 333 | TERM (U"##Subtract trend before smoothing#") |
| 334 | DEFINITION (U"determines whether the smoothing should be performed on the Cepstrogram after the trend of each PowerCepstrum frame has been removed. Because, in general, the trends in the analysis frames will not be equal, the value of CPPS will be different whether or not smoothing is performed. If no smoothing is going on the result should be independent of this setting. ") |
| 335 | TERM (U"##Time averaging window (s)#") |
| 336 | DEFINITION (PowerCepstrogram_manual_timeAveraging) |
| 337 | TERM (U"##Quefrency averaging window (s)#") |
| 338 | DEFINITION (PowerCepstrum_manual_quefrencyAveragingWindow) |
| 339 | TERM (U"##Peak search pitch range (Hz)#") |
| 340 | DEFINITION (PowerCepstrum_manual_pitchRange) |
| 341 | TERM (U"##Tolerance#") |
| 342 | DEFINITION (U"") |
| 343 | TERM (U"##Interpolation#") |
| 344 | DEFINITION (U"determines how the @@vector peak interpolation|amplitude and position of a peak are determined@.") |
| 345 | TERM (U"##Trend line quefrency range (s)#") |
| 346 | DEFINITION (PowerCepstrum_manual_trendRange) |
| 347 | TERM (U"##Trend type#") |
| 348 | DEFINITION (PowerCepstrum_manual_trendType) |
| 349 | TERM (U"##Fit method#") |
| 350 | DEFINITION (PowerCepstrum_manual_fitMethod) |
| 351 | MAN_END |
| 352 | |
| 353 | MAN_BEGIN (U"PowerCepstrogram: To Table (cepstral peak prominences)...", U"djmw", 20210916) |
| 354 | INTRO (U"A command to create a table with @@PowerCepstrum: Get peak prominence...|cepstral peak prominence@ values.") |
| 355 | ENTRY (U"Settings") |
| 356 | SCRIPT (5, Manual_SETTINGS_WINDOW_HEIGHT (7.8), U"" |
| 357 | Manual_DRAW_SETTINGS_WINDOW ("PowerCepstrogram: To Table (cepstral peak prominences)", 7.8) // 9 - 4 * 0.3 (four is the number of additional radio buttons) |
| 358 | Manual_DRAW_SETTINGS_WINDOW_RANGE("Peak search pitch range (Hz)", U"60.0", U"300.0") |
| 359 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"Interpolation", U"None", 0) |
| 360 | "y -= 12\n" |
| 361 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"", U"parabolic", 1) |
| 362 | "y -= 12\n" |
| 363 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"", U"cubic", 0) |
| 364 | "y -= 12\n" |
| 365 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"", U"sinc70", 0) |
| 366 | "y -= 12\n" |
| 367 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"", U"sinc700", 0) |
| 368 | Manual_DRAW_SETTINGS_WINDOW_RANGE ("Trend line quefrency range (s)", U"0.001", U"0.05") |
| 369 | Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU (U"Trend type", U"Exponential decay") |
| 370 | Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU (U"Fit method", U"Robust") |
| 371 | ) |
| 372 | NORMAL (U"The meaning of these settings is explained @@PowerCepstrum: Get peak prominence...|here@.") |
| 373 | MAN_END |
| 374 | |
| 375 | MAN_BEGIN(U"PowerCepstrogram: Paint...", U"djmw", 20131001) |
| 376 | INTRO (U"A command to draw the selected @@PowerCepstrogram@ object(s) in shades of grey.") |
| 377 | ENTRY (U"Settings") |
| 378 | SCRIPT (5, Manual_SETTINGS_WINDOW_HEIGHT (7), U"" |
| 379 | Manual_DRAW_SETTINGS_WINDOW (U"PowerCepstrogram: Paint", 7) |
| 380 | Manual_DRAW_SETTINGS_WINDOW_RANGE("Time range (s)", U"0.0", U"0.0") |
| 381 | Manual_DRAW_SETTINGS_WINDOW_RANGE("Quefrency range (s)", U"0.0", U"0.0") |
| 382 | Manual_DRAW_SETTINGS_WINDOW_FIELD("Maximum (dB)", U"80.0") |
| 383 | Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("Autoscaling",0) |
| 384 | Manual_DRAW_SETTINGS_WINDOW_FIELD("Dynamic range (dB)", U"30.0") |
| 385 | Manual_DRAW_SETTINGS_WINDOW_FIELD("Dynamic compression (0-1)", U"0.0") |
| 386 | Manual_DRAW_SETTINGS_WINDOW_BOOLEAN("Garnish",1) |
| 387 | ) |
| 388 | TERM (U"##Time range (s)") |
| 389 | DEFINITION (U"the time domain along the %%x% axis.") |
| 390 | TERM (U"##Quefrency range (s)") |
| 391 | DEFINITION (U"the quefency domain along the %%y% axis.") |
| 392 | TERM (U"##Maximum (dB)") |
| 393 | DEFINITION (U"cells that have cepstral values greater or equal than this value are drawn in black.") |
| 394 | TERM (U"##Autoscaling") |
| 395 | DEFINITION (U"If %%on%, overrules the effects of the previous option and the following three options. I.e. the global maximum and the " |
| 396 | "global minimum cepstral values determine the maximum blackness and the minimal blackness. Values in-between have apropriate " |
| 397 | "values of grey.") |
| 398 | TERM (U"##Dynamic range (dB)") |
| 399 | DEFINITION (U"All values more than %%Dynamic range% below the maximum will be drawn in white. Values in-between have apropriate " |
| 400 | "values of grey.") |
| 401 | TERM (U"##Dynamic compression (0-1)") |
| 402 | DEFINITION (U"determines how much stronger weak frames should be made before drawing. Normally this parameter is between 0 and 1. " |
| 403 | "If it is 0, no dynamic compression will take place. If it is 1, all time frames (vertical bands) will contain cepstral values " |
| 404 | "that are drawn in black. If the global %%maximum% is set at 80 dB, %%autoscaling% is off, %%dynamic range% is 30 dB and " |
| 405 | "%%dynamic compression% is 0.4 then for a frame with a local maximum of 40 dB all values will be lifted by 0.4*(80-40)=16 dB, " |
| 406 | "so that its maximum will be seen at 56 dB (thus making the corresponding cell visible).") |
| 407 | TERM (U"##Garnish") |
| 408 | DEFINITION (U"Draws a box around the cepstrogram and labels the axes.") |
| 409 | MAN_END |
| 410 | |
| 411 | MAN_BEGIN (U"PowerCepstrogram: Smooth...", U"djmw", 20201216) |
| 412 | INTRO (U"Smoothes the selected @PowerCepstrogram by averaging with a rectangular window. The smoothed PowerCepstrogram is the " |
| 413 | "result of two separate steps. " |
| 414 | "In the first step, cepstra are averaged across time. In the second step, cepstra are averaged across quefrency.") |
| 415 | ENTRY (U"Settings") |
| 416 | TERM (U"##Time averaging window (s)") |
| 417 | DEFINITION (PowerCepstrogram_manual_timeAveraging) |
| 418 | TERM (U"##Quefrency averaging window (s)") |
| 419 | DEFINITION (PowerCepstrum_manual_quefrencyAveragingWindow) |
| 420 | ENTRY (U"Note") |
| 421 | NORMAL (U"The following commands should reproduce the smoothing described in the @@Hillenbrand & Houde (1996)@ article, " |
| 422 | "where they use a 20 ms (10 frame) time smoothing and a 1 ms (10 bin) quefrency smoothing. ") |
| 423 | CODE (U"selectObject (\"Sound xxx\")") |
| 424 | CODE (U"To PowerCepstrogram: 60.0, 0.002, 5000.0, 50.0") |
| 425 | CODE (U"Smooth: 0.02, 0.001") |
| 426 | MAN_END |
| 427 | |
| 428 | MAN_BEGIN (U"Cepstrum", U"djmw", 20130616) |
| 429 | INTRO (U"One of the @@types of objects@ in Praat.") |
| 430 | ENTRY (U"Description") |
| 431 | NORMAL (U"A Cepstrum is the log spectrum of the log power spectrum.") |
| 432 | MAN_END |
| 433 | |
| 434 | MAN_BEGIN (U"PowerCepstrum", U"djmw", 20200403) |
| 435 | INTRO (U"One of the @@types of objects@ in Praat.") |
| 436 | ENTRY (U"Description") |
| 437 | NORMAL (U"A PowerCepstrum is the power spectrum of the log power spectrum. When drawn the vertical scale " |
| 438 | "will show the amplitude expressed in dB. The horizontal scale shows %%quefrency% in units of seconds. " |
| 439 | "It is calculated from the ##Spectrum# by a method described at @@Spectrum: To PowerCepstrum@.") |
| 440 | MAN_END |
| 441 | |
| 442 | MAN_BEGIN (U"PowerCepstrum: Get peak prominence...", U"djmw", 20190912) |
| 443 | INTRO (U"Calculates the cepstral peak prominence measure (CPP) as defined by @@Hillenbrand et al. (1994)@") |
| 444 | NORMAL (U"The CPP measure is the difference in amplitude between the cepstral peak and the corresponding value on the trend " |
| 445 | "line that is directly below the peak (i.e., the predicted magnitude for the quefrency at the cepstral peak). " |
| 446 | "The CPP measure represents how far the cepstral peak emerges from the cepstrum background. ") |
| 447 | ENTRY (U"Settings") |
| 448 | SCRIPT (7, Manual_SETTINGS_WINDOW_HEIGHT (6.8), U"" |
| 449 | Manual_DRAW_SETTINGS_WINDOW (U"PowerCepstrum: Get peak prominence", 6.8) // 8 - 4 * 0.3 (four is the number of additional radio buttons) |
| 450 | Manual_DRAW_SETTINGS_WINDOW_RANGE("Search peak in pitch range (s)", U"60.0", U"333.3") |
| 451 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"Interpolation", U"None", 0) |
| 452 | "y -= 12\n" |
| 453 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"", U"parabolic", 0) |
| 454 | "y -= 12\n" |
| 455 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"", U"cubic", 1) |
| 456 | "y -= 12\n" |
| 457 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"", U"sinc70", 0) |
| 458 | "y -= 12\n" |
| 459 | Manual_DRAW_SETTINGS_WINDOW_CHOICE (U"", U"sinc700", 0) |
| 460 | Manual_DRAW_SETTINGS_WINDOW_RANGE (U"Trend line quefrency range (s)", U"0.001", U"0.0 (= end)") |
| 461 | Manual_DRAW_SETTINGS_WINDOW_OPTIONMENU (U"Fit method", U"Robust") |
| 462 | ) |
| 463 | TERM (U"##Search peak in pitch range") |
| 464 | DEFINITION (PowerCepstrum_manual_pitchRange) |
| 465 | TERM (U"##Interpolation") |
| 466 | DEFINITION (U"determines how the @@vector peak interpolation|amplitude and position of a peak are determined@.") |
| 467 | TERM (U"##Trend line quefrency range") |
| 468 | DEFINITION (PowerCepstrum_manual_trendRange) |
| 469 | TERM (U"##Trend type#") |
| 470 | DEFINITION (PowerCepstrum_manual_trendType) |
| 471 | TERM (U"##Fit method") |
| 472 | DEFINITION (PowerCepstrum_manual_fitMethod) |
| 473 | ENTRY (U"Examples") |
| 474 | NORMAL (U"Next picture of a PowerCepstrum with its straight blue trend line and its corresponding " |
| 475 | "peak prominence value was generated with the following script. Note that the first four lines in the " |
| 476 | "script are only necessary to generate a PowerCepstrum of a part of a vowel. ") |
| 477 | CODE (U"Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000") |
| 478 | CODE (U"To Sound") |
| 479 | CODE (U"To PowerCepstrogram: 60, 0.002, 5000, 50") |
| 480 | CODE (U"To PowerCepstrum (slice): 0.1") |
| 481 | CODE (U"prominence = Get peak prominence: 60, 333.3, \"parabolic\", 0.001, 0.05, \"straight\", \"robust slow\"") |
| 482 | CODE (U"Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"") |
| 483 | CODE (U"Draw: 0, 0, 0, 110, \"yes\"") |
| 484 | CODE (U"Colour: \"blue\"") |
| 485 | CODE (U"Draw trend line: 0, 0, 0, 110, 0.001, 0.05, \"straight\", \"robust slow\"") |
| 486 | CODE (U"Colour: \"black\"") |
| 487 | CODE (U"Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"") |
| 488 | SCRIPT (5, 3, U"" |
| 489 | "kg = Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000\n" |
| 490 | "vowel = To Sound\n" |
| 491 | "cepstrogram = To PowerCepstrogram: 60, 0.002, 5000, 50\n" |
| 492 | "cepstrum = To PowerCepstrum (slice): 0.1\n" |
| 493 | "prominence = Get peak prominence: 60, 333.3, \"parabolic\", 0.001, 0.05, \"straight\", \"robust slow\"\n" |
| 494 | "Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"\n" |
| 495 | "Draw: 0, 0, 0, 110, \"yes\"\n" |
| 496 | "Colour: \"Blue\"\n" |
| 497 | "Draw trend line: 0, 0, 0, 110, 0.001, 0.05, \"straight\", \"robust slow\"\n" |
| 498 | "Colour: \"Black\"\n" |
| 499 | "Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"\n" |
| 500 | "removeObject: kg, vowel, cepstrogram, cepstrum\n") |
| 501 | NORMAL (U"In the next picture the trend line is of exponential decay type and consequently the " |
| 502 | "peak prominence value has changed a little bit.") |
| 503 | SCRIPT (5, 3, U"" |
| 504 | "kg = Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000\n" |
| 505 | "vowel = To Sound\n" |
| 506 | "cepstrogram = To PowerCepstrogram: 60, 0.002, 5000, 50\n" |
| 507 | "cepstrum = To PowerCepstrum (slice): 0.1\n" |
| 508 | "prominence = Get peak prominence: 60, 333.3, \"parabolic\", 0.001, 0.05, \"exponential decay\", \"robust slow\"\n" |
| 509 | "Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"\n" |
| 510 | "Draw: 0, 0, 0, 110, \"yes\"\n" |
| 511 | "Colour: \"Blue\"\n" |
| 512 | "Draw trend line: 0, 0, 0, 110, 0.001, 0.05, \"exponential decay\", \"robust slow\"\n" |
| 513 | "Colour: \"Black\"\n" |
| 514 | "Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"\n" |
| 515 | "removeObject: kg, vowel, cepstrogram, cepstrum\n") |
| 516 | |
| 517 | MAN_END |
| 518 | |
| 519 | MAN_BEGIN (U"PowerCepstrum: Draw...", U"djmw", 20190914) |
| 520 | INTRO (U"A command to draw the selected @@PowerCepstrum@.") |
| 521 | ENTRY (U"Settings") |
| 522 | TERM (U"##Quefrency range (s)#") |
| 523 | DEFINITION (U"define the extrema on the horizontal scale of the picture.") |
| 524 | TERM (U"##Amplitude range (dB)#") |
| 525 | DEFINITION (U"define the extrema on the vertical scale of the picture") |
| 526 | ENTRY (U"Remark") |
| 527 | NORMAL (U"Cepstrum values are drawn as 20\\.clog10 (value +\\ep), " |
| 528 | "where \\ep is a small number that avoids taking the logarithm of zero if the cepstrum value happens to be zero.") |
| 529 | MAN_END |
| 530 | |
| 531 | MAN_BEGIN (U"PowerCepstrum: Draw trend line...", U"djmw", 20191008) |
| 532 | INTRO (U"Draws the line that models the background of the selected @@PowerCepstrum@.") |
| 533 | ENTRY (U"Settings") |
| 534 | TERM (U"##Quefrency range (s)#") |
| 535 | DEFINITION (U"define the extrema on the horizontal scale of the picture.") |
| 536 | TERM (U"##Amplitude range (dB)#") |
| 537 | DEFINITION (U"define the extrema on the vertical scale of the picture") |
| 538 | TERM (U"##Trend line quefrency range (s)") |
| 539 | DEFINITION (PowerCepstrum_manual_trendRange) |
| 540 | TERM (U"##Trend type#") |
| 541 | DEFINITION (PowerCepstrum_manual_trendType) |
| 542 | TERM (U"##Fit method") |
| 543 | DEFINITION (PowerCepstrum_manual_fitMethod) |
| 544 | ENTRY (U"Examples") |
| 545 | NORMAL (U"The next picture shows a PowerCepstrum with %%two% drawn trend lines, a straight line in blue " |
| 546 | "and an exponential decay line in green. The picture was generated by the following script. " |
| 547 | "Note that the first four lines in the script are only necessary to generate a PowerCepstrum of a part of a vowel.") |
| 548 | CODE (U"Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000") |
| 549 | CODE (U"To Sound") |
| 550 | CODE (U"To PowerCepstrogram: 60, 0.002, 5000, 50") |
| 551 | CODE (U"To PowerCepstrum (slice): 0.1") |
| 552 | CODE (U"Draw: 0, 0, 0, 110, \"yes\"") |
| 553 | CODE (U"Colour: \"Blue\"") |
| 554 | CODE (U"Draw trend line: 0, 0, 0, 110, 0.001, 0.05, \"Straight\", \"Robust slow\"") |
| 555 | CODE (U"Colour: \"Green\"") |
| 556 | CODE (U"Draw trend line: 0, 0, 0, 110, 0.001, 0.05, \"Exponential decay\", \"Robust slow\"") |
| 557 | CODE (U"Colour: \"Black\"") |
| 558 | SCRIPT (5, 3, U"" |
| 559 | "kg = Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000\n" |
| 560 | "vowel = To Sound\n" |
| 561 | "cepstrogram = To PowerCepstrogram: 60, 0.002, 5000, 50\n" |
| 562 | "cepstrum = To PowerCepstrum (slice): 0.1\n" |
| 563 | "Draw: 0, 0, 0, 110, \"yes\"\n" |
| 564 | "Colour: \"Blue\"\n" |
| 565 | "Draw trend line: 0, 0, 0, 110, 0.001, 0.05, \"Straight\", \"Robust slow\"\n" |
| 566 | "Colour: \"Green\"\n" |
| 567 | "Draw trend line: 0, 0, 0, 110, 0.001, 0.05, \"Exponential decay\", \"Robust slow\"\n" |
| 568 | "Colour: \"Black\"\n" |
| 569 | "removeObject: kg, vowel, cepstrogram, cepstrum\n") |
| 570 | MAN_END |
| 571 | |
| 572 | MAN_BEGIN (U"PowerCepstrum: Get peak...", U"djmw", 20190910) |
| 573 | INTRO (U"Get the amplitude of the peak in the selected @@PowerCepstrum@.") |
| 574 | ENTRY (U"Settings") |
| 575 | TERM (U"##Search peak in pitch range (Hz)#") |
| 576 | DEFINITION (PowerCepstrum_manual_pitchRange) |
| 577 | TERM (U"##Interpolation#") |
| 578 | DEFINITION (U"determines how the @@vector peak interpolation|amplitude and position of a peak are determined@.") |
| 579 | MAN_END |
| 580 | |
| 581 | MAN_BEGIN (U"PowerCepstrum: Get quefrency of peak...", U"djmw", 20190910) |
| 582 | INTRO (U"A command to get the quefrency of the peak in the selected @@PowerCepstrum@.") |
| 583 | ENTRY (U"Settings") |
| 584 | TERM (U"##Search peak in pitch range (Hz)#") |
| 585 | DEFINITION (PowerCepstrum_manual_pitchRange) |
| 586 | TERM (U"##Interpolation#") |
| 587 | DEFINITION (U"determines how the @@vector peak interpolation|amplitude and position of a peak are determined@.") |
| 588 | MAN_END |
| 589 | |
| 590 | MAN_BEGIN (U"PowerCepstrum: Get trend line slope...", U"djmw", 20190910) |
| 591 | INTRO (U"A command to calculate the slope of the line that models the cepstrum background of the selected @@PowerCepstrum@.") |
| 592 | ENTRY (U"Settings") |
| 593 | TERM (U"##Trend line quefrency range (s)#") |
| 594 | DEFINITION (PowerCepstrum_manual_trendRange) |
| 595 | TERM (U"##Trend type#") |
| 596 | DEFINITION (PowerCepstrum_manual_trendType) |
| 597 | TERM (U"##Fit method") |
| 598 | DEFINITION (PowerCepstrum_manual_fitMethod) |
| 599 | MAN_END |
| 600 | |
| 601 | MAN_BEGIN (U"PowerCepstrum: Get trend line intercept...", U"djmw", 20190910) |
| 602 | INTRO (U"A command to calculate the intercept of the line that models the cepstrum background of the selected @@PowerCepstrum@.") |
| 603 | ENTRY (U"Settings") |
| 604 | TERM (U"##Trend line quefrency range (s)#") |
| 605 | DEFINITION (PowerCepstrum_manual_trendRange) |
| 606 | TERM (U"##Trend type#") |
| 607 | DEFINITION (PowerCepstrum_manual_trendType) |
| 608 | TERM (U"##Fit method") |
| 609 | DEFINITION (PowerCepstrum_manual_fitMethod) |
| 610 | MAN_END |
| 611 | |
| 612 | MAN_BEGIN (U"PowerCepstrum: Smooth...", U"djmw", 20191005) |
| 613 | INTRO (U"A command to smooth the selected @@PowerCepstrum@ by averaging values at successive quefrencies.") |
| 614 | ENTRY (U"Settings") |
| 615 | TERM (U"##Quefrency averaging window (s)#") |
| 616 | DEFINITION (PowerCepstrum_manual_quefrencyAveragingWindow) |
| 617 | TERM (U"##Number of iterations#") |
| 618 | DEFINITION (U"determines how often the averaging will take place. If chosen 2, for example, the output PowerCepstrum " |
| 619 | "after the first averaging will be averaged once again.") |
| 620 | ENTRY (U"Examples") |
| 621 | NORMAL (U"The figure below is the PowerCepstrum taken from an artificial /a/ vowel synthesized as follows:") |
| 622 | CODE (U"Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000") |
| 623 | CODE (U"To Sound") |
| 624 | CODE (U"To PowerCepstrogram: 60, 0.002, 5000, 50") |
| 625 | CODE (U"To PowerCepstrum (slice): 0.1") |
| 626 | CODE (U"prominence = Get peak prominence: 60, 333.3, \"Parabolic\", 0.001, 0.05, \"Straight\", \"Robust slow\"") |
| 627 | CODE (U"Draw: 0, 0, 0, 110, \"yes\"") |
| 628 | CODE (U"Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"") |
| 629 | SCRIPT (5, 3, U"" |
| 630 | "kg = Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000\n" |
| 631 | "vowel = To Sound\n" |
| 632 | "cepstrogram = To PowerCepstrogram: 60, 0.002, 5000, 50\n" |
| 633 | "cepstrum = To PowerCepstrum (slice): 0.3\n" |
| 634 | "prominence = Get peak prominence: 60, 333.3, \"Parabolic\", 0.001, 0.05, \"Straight\", \"Robust slow\"\n" |
| 635 | "Draw: 0, 0, 0, 110, \"yes\"\n" |
| 636 | "Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"\n" |
| 637 | "removeObject: kg, vowel, cepstrogram, cepstrum\n") |
| 638 | NORMAL (U"After 1 iteration with an averaging window of 0.0005 s the PowerCepstrum is:") |
| 639 | SCRIPT (5, 3, U"" |
| 640 | "kg = Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000\n" |
| 641 | "vowel = To Sound\n" |
| 642 | "cepstrogram = To PowerCepstrogram: 60, 0.002, 5000, 50\n" |
| 643 | "cepstrum = To PowerCepstrum (slice): 0.3\n" |
| 644 | "smooth = Smooth: 0.0005, 1\n" |
| 645 | "prominence = Get peak prominence: 60, 333.3, \"Parabolic\", 0.001, 0.05, \"Straight\", \"Robust slow\"\n" |
| 646 | "Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"\n" |
| 647 | "Draw: 0, 0, 0, 110, \"yes\"\n" |
| 648 | "removeObject: kg, vowel, cepstrogram, cepstrum, smooth\n") |
| 649 | NORMAL (U"After 2 iterations with an averaging window of 0.0005 s the PowerCepstrum is:") |
| 650 | SCRIPT (5, 3, U"" |
| 651 | "kg = Create KlattGrid from vowel: \"a\", 0.3, 125, 800, 80, 1200, 80, 2300, 100, 2800, 0.1, 1000\n" |
| 652 | "vowel = To Sound\n" |
| 653 | "cepstrogram = To PowerCepstrogram: 60, 0.002, 5000, 50\n" |
| 654 | "cepstrum = To PowerCepstrum (slice): 0.3\n" |
| 655 | "smooth = Smooth: 0.0005, 2\n" |
| 656 | "prominence = Get peak prominence: 60, 333.3, \"Parabolic\", 0.001, 0.05, \"Straight\", \"Robust slow\"\n" |
| 657 | "Draw: 0, 0, 0, 110, \"yes\"\n" |
| 658 | "Text top: \"no\", \"Peak prominence = \" + fixed$ (prominence, 2) + \" dB\"\n" |
| 659 | "removeObject: kg, vowel, cepstrogram, cepstrum, smooth\n") |
| 660 | MAN_END |
| 661 | |
| 662 | MAN_BEGIN (U"PowerCepstrum: Subtract trend...", U"djmw", 20190914) |
| 663 | INTRO (U"Subtract the cepstrum trend from the selected @@PowerCepstrum@.") |
| 664 | ENTRY (U"Settings") |
| 665 | TERM (U"##Trend line quefrency range (s)#") |
| 666 | DEFINITION (PowerCepstrum_manual_trendRange) |
| 667 | TERM (U"##Trend type#") |
| 668 | DEFINITION (PowerCepstrum_manual_trendType) |
| 669 | TERM (U"##Fit method#") |
| 670 | DEFINITION (PowerCepstrum_manual_fitMethod) |
| 671 | MAN_END |
| 672 | |
| 673 | MAN_BEGIN (U"Formant & Spectrogram: To IntensityTier...", U"djmw", 20130109) |
| 674 | INTRO (U"Determines the formant intensities from the selected Spectrogram.") |
| 675 | NORMAL (U"The intensities at the frequencies of the selected formant are copied from the corresponding positions in the spectrogram. " |
| 676 | "If the selected formant doesn't exist in a particular frame, then a large negative value (< -200 dB) is substituted instead. " |
| 677 | "Because the values in the spectrogram are expressed in Pa^^2^/Hz, the units in the intensity tier are in dB/Hz. ") |
| 678 | MAN_END |
| 679 | |
| 680 | MAN_BEGIN (U"LFCC", U"djmw", 20040421) |
| 681 | INTRO (U"One of the @@types of objects@ in Praat.") |
| 682 | NORMAL (U"An object of type LFCC represents cepstral " |
| 683 | "coefficients on a linear frequency scale as a function of time. " |
| 684 | "The coefficients are represented in frames with constant sampling " |
| 685 | "period.") |
| 686 | ENTRY (U"#LFCC commands") |
| 687 | NORMAL (U"Creation:") |
| 688 | LIST_ITEM (U"\\bu @@LPC: To LFCC...") |
| 689 | MAN_END |
| 690 | |
| 691 | MAN_BEGIN (U"LFCC: To LPC...", U"djmw", 20040407) |
| 692 | INTRO (U"You can choose this command after selecting 1 or more @LFCC's.") |
| 693 | ENTRY (U"Settings") |
| 694 | TERM (U"##Number of coefficients") |
| 695 | DEFINITION (U"the desired number of linear predictive coefficients.") |
| 696 | ENTRY (U"Behaviour") |
| 697 | NORMAL (U"The transformation from cepstral coefficients to %a-coefficients " |
| 698 | "as described in @@Markel & Gray (1976)@.") |
| 699 | MAN_END |
| 700 | |
| 701 | MAN_BEGIN (U"LPC", U"djmw", 19990610) |
| 702 | INTRO (U"One of the @@types of objects@ in Praat.") |
| 703 | NORMAL (U"An object of type LPC represents filter coefficients as a function of time. " |
| 704 | "The coefficients are represented in frames with constant sampling period.") |
| 705 | ENTRY (U"LPC commands") |
| 706 | NORMAL (U"Creation:") |
| 707 | LIST_ITEM (U"\\bu @@Sound: To LPC (autocorrelation)...@") |
| 708 | LIST_ITEM (U"\\bu @@Sound: To LPC (covariance)...@") |
| 709 | LIST_ITEM (U"\\bu @@Sound: To LPC (burg)...@") |
| 710 | LIST_ITEM (U"\\bu @@Sound: To LPC (marple)...@") |
| 711 | ENTRY (U"Conversion") |
| 712 | LIST_ITEM (U"\\bu @@LPC: To LFCC...|To LFCC...@") |
| 713 | LIST_ITEM (U"\\bu @@LPC: To Spectrogram...|To Spectrogram...@") |
| 714 | LIST_ITEM (U"\\bu @@LPC: To Spectrum (slice)...|To Spectrum (slice)...@") |
| 715 | LIST_ITEM (U"\\bu @@LPC: To Polynomial (slice)...|To Polynomial (slice)...@") |
| 716 | MAN_END |
| 717 | |
| 718 | MAN_BEGIN (U"LPC: Draw gain...", U"djmw", 20040407) |
| 719 | INTRO (U"You can choose this command after selecting 1 or more @LPC objects.") |
| 720 | ENTRY (U"Settings") |
| 721 | TERM (U"##From time (s)#, ##To time (seconds)#") |
| 722 | DEFINITION (U"the time domain along the %x-axis.") |
| 723 | TERM (U"##Minimum gain#, ##Maximum gain#") |
| 724 | DEFINITION (U"the range for the %y-axis.") |
| 725 | TERM (U"##Garnish") |
| 726 | DEFINITION (U"determines whether to draw a bounding box and axis labels.") |
| 727 | ENTRY (U"Behaviour") |
| 728 | NORMAL (U"Gain will be drawn as a function of time (gain also equals the prediction error " |
| 729 | "energy). ") |
| 730 | MAN_END |
| 731 | |
| 732 | MAN_BEGIN (U"LPC: Draw poles...", U"djmw", 20040407) |
| 733 | INTRO (U"You can choose this command after selecting 1 or more @LPC objects.") |
| 734 | ENTRY (U"Settings") |
| 735 | TERM (U"##Time (s)") |
| 736 | DEFINITION (U"the time of the nearest frame.") |
| 737 | ENTRY (U"Behaviour") |
| 738 | NORMAL (U"The @@Roots|roots@ of the @@LPC: To Polynomial (slice)...|linear prediction " |
| 739 | "polynomial@, constructed from the coefficients " |
| 740 | "of the analysis frame, will be drawn in the complex plane.") |
| 741 | MAN_END |
| 742 | |
| 743 | MAN_BEGIN (U"LPC: To LFCC...", U"djmw", 20040407) |
| 744 | INTRO (U"You can choose this command after selecting 1 or more @LPC objects.") |
| 745 | ENTRY (U"Behaviour") |
| 746 | NORMAL (U"The transformation from a-coefficients to cepstral coefficients " |
| 747 | "as described in @@Markel & Gray (1976)@.") |
| 748 | ENTRY (U"Settings") |
| 749 | TERM (U"%%Number of coefficients%") |
| 750 | DEFINITION (U"the desired number of cepstral coefficients.") |
| 751 | MAN_END |
| 752 | |
| 753 | MAN_BEGIN (U"LPC: To Matrix", U"djmw", 20011123) |
| 754 | INTRO (U"Copies the linear prediction coefficients of the selected @LPC " |
| 755 | "object to a newly created @Matrix object.") |
| 756 | ENTRY (U"Behaviour") |
| 757 | EQUATION (U"%z__%ji_ = %a__%ij_, with 1 \\<_ %i \\<_ %nx and " |
| 758 | "1 \\<_ j \\<_ %nCoefficients__%i_,") |
| 759 | NORMAL (U"where %z__%ji_ is the matrix element in row %j and column %i and " |
| 760 | "%a__%ij_ is the %j-th linear prediction coefficient in frame %i.") |
| 761 | MAN_END |
| 762 | |
| 763 | MAN_BEGIN (U"LPC: To Formant", U"djmw", 19970123) |
| 764 | INTRO (U"You can choose this command after selecting 1 or more @LPC objects.") |
| 765 | ENTRY (U"Behaviour") |
| 766 | NORMAL (U"For each LPC frame, the zeros of the linear prediction polynomial are extracted. " |
| 767 | "Zeros that are outside the unit circle are reflected into it. " |
| 768 | "Next, formant frequencies and bandwidths are calculated from all the roots that have the " |
| 769 | "imaginary part positive, i.e., that lie in the upper half of the unit circle. " |
| 770 | "Formant frequencies smaller than 50 Hz or larger than (%nyquistFrequency - 50) are discarded. " |
| 771 | "The remaining frequencies and bandwidths are sorted " |
| 772 | "and copied to the Formant frame. Finally, the %gain field of the LPC is copied to the %intensity " |
| 773 | "field of the Formant frame.") |
| 774 | ENTRY (U"Algorithm") |
| 775 | NORMAL (U"The root finder is Laguerre's method followed by root polishing, see @@Press " |
| 776 | "et al. (1992)@.") |
| 777 | ENTRY (U"Warning") |
| 778 | LIST_ITEM (U"\\bu The formant values can be very inaccurate if you did not resample the Sound " |
| 779 | "before the LPC-analysis (consult the @@Source-filter synthesis@ tutorial).") |
| 780 | LIST_ITEM (U"\\bu The results of the root finder may not always be accurate when more than 30 " |
| 781 | "roots have to be found.") |
| 782 | MAN_END |
| 783 | |
| 784 | MAN_BEGIN (U"LPC: To Polynomial (slice)...", U"djmw", 20260104) |
| 785 | INTRO (U"A command that creates a Polynomial object from each selected @LPC object.") |
| 786 | ENTRY (U"Settings") |
| 787 | TERM (U"##Time (s)") |
| 788 | DEFINITION (U"defines the LPC frame whose coefficients will be selected.") |
| 789 | ENTRY (U"Behaviour") |
| 790 | NORMAL (U"The linear prediction coefficients %a__1..%n_ of the LPC frame that is nearest to the" |
| 791 | " given time will be copied into polynomial coefficients %c__1..%n+1_ as follows:") |
| 792 | EQUATION (U"%c__%i_ = %a__%n\\--%i+1_ for %i=1..%n,") |
| 793 | EQUATION (U"%c__%n+1_ = 1") |
| 794 | MAN_END |
| 795 | |
| 796 | MAN_BEGIN (U"LPC: To Spectrum (slice)...", U"djmw", 20071120) |
| 797 | INTRO (U"You can choose this command after selecting 1 or more @LPC objects.") |
| 798 | ENTRY (U"Settings") |
| 799 | TERM (U"##Time (s)") |
| 800 | DEFINITION (U"the time at which the Spectrum should be calculated.") |
| 801 | TERM (U"##Minimum frequency resolution (Hz)") |
| 802 | DEFINITION (U"successive frequencies in the @Spectrum " |
| 803 | "will be maximally this distance apart.") |
| 804 | TERM (U"##Bandwidth reduction (Hz)") |
| 805 | DEFINITION (U"formants with small bandwidths show up very well as peaks in the spectrum because the poles " |
| 806 | "lie close to the contour along which the spectrum is computed (the unit circle in the z-plane). " |
| 807 | "Peak enhancement can be realized by computing the spectrum in the z-plane along a contour of radius " |
| 808 | "%r = exp (\\-- %\\pi \\.c %bandwidthReduction / %samplingFrequency). " |
| 809 | "This technique is also called off-axis spectrum computation. " |
| 810 | "Negative values evaluate the spectrum on a contour %outside the unit circle and therefore result in a " |
| 811 | "flattened spectrum.") |
| 812 | TERM (U"##De-emphasis frequency (Hz)") |
| 813 | DEFINITION (U"Performs de-emphasis when frequency is in the interval (0, @@Nyquist frequency@)") |
| 814 | ENTRY (U"Algorithm") |
| 815 | NORMAL (U"The Spectrum at time %t will be calculated from the %nearest LPC frame according to:") |
| 816 | EQUATION (U"Spectrum (%f) = \\Vr(%gain\\.c%T/%df) / (1 + \\su__%k=1..%numberOfCoefficients_ %a__%k_%z^^\\--%k^),") |
| 817 | NORMAL (U"where %T is the sampling period and %z = exp (\\--2 %\\pi %i %f %T) and %df is the distance in Hz " |
| 818 | "between two successive components in the Spectrum.") |
| 819 | LIST_ITEM (U"1. Allocate a large enough buffer [1..%nfft] to perform an FFT analysis.") |
| 820 | LIST_ITEM (U"2. Make the first value of the buffer 1 and copy the prediction coefficients #a into " |
| 821 | "the buffer. This results in buffer values: (1, %a__1_, ..., %a__%numberOfCoefficients_, 0, ..., 0).") |
| 822 | LIST_ITEM (U"3. If ##De-emphasis frequency# is in the interval (0, %nyquistFrequency) then \"multiply\" " |
| 823 | "the buffer with (1 - %b %z^^\\--1^), where %b = exp (\\-- %\\pi %deEmphasisFrequency %T). " |
| 824 | "This results in buffer values: (1, %a__1_\\--%b, %a__2_\\--%b\\.c%a__1_, ..., " |
| 825 | "%a__%numberOfCoefficients_\\--%b\\.c%a__%numberOfCoefficients\\--1_, " |
| 826 | "\\--%b\\.c%a__%numberOfCoefficients_, 0, ..., 0). Note that the number of values in the buffer that differ from 0 " |
| 827 | "has increased by one.") |
| 828 | LIST_ITEM (U"4. If ##Bandwidth reduction# is greater than 0 then multiply corresponding values in the buffer by %g^^%i\\--1^ where " |
| 829 | "%g = exp (2%\\pi %bandwidthReduction %T / %nfft), and %i is the position index in the buffer. " |
| 830 | "%i runs from 1 to %numberOfCoefficients+1+%t, where %t equals 1 when de-emphasis was performed, " |
| 831 | "else 0.") |
| 832 | LIST_ITEM (U"5. Calculate the FFT spectrum of the buffer with the coefficients. This results in complex " |
| 833 | "amplitudes (%a__%j_,%b__%j_), %j=1..%nfft/2+1.") |
| 834 | LIST_ITEM (U"6. Calculate the LPC Spectrum by taking the inverse of the FFT spectrum, i.e., each complex " |
| 835 | "amplitude becomes (%a__%j_,%b__%j_)^^\\--1^ = (%a__%j_,\\--%b__%j_) / (%a__%j_^2 + %b__%j_^2)") |
| 836 | LIST_ITEM (U"7. Multiply all values with the scale factor \\Vr(%gain\\.c%T/%df).") |
| 837 | MAN_END |
| 838 | |
| 839 | MAN_BEGIN (U"LPC: To Spectrogram...", U"djmw", 20040407) |
| 840 | INTRO (U"You can choose this command after selecting 1 or more @LPC objects.") |
| 841 | ENTRY (U"Settings") |
| 842 | TERM (U"##Minimum frequency resolution (Hz)") |
| 843 | DEFINITION (U"successive frequencies in the Spectrum will be maximally this distance apart") |
| 844 | TERM (U"##Bandwidth reduction (Hz)") |
| 845 | DEFINITION (U"formants with small bandwidths show up very well as darker regions in the spectrogram " |
| 846 | "because the poles lie close to the contour along which a spectrum is computed (the unit circle " |
| 847 | "in the z-plane). " |
| 848 | "Peak enhancement can be realized by computing a spectrum in the z-plane along a contour of radius " |
| 849 | "%r = exp (\\-- %\\pi \\.c %bandwidthReduction / %samplingFrequency).") |
| 850 | TERM (U"##De-emphasis frequency (Hz)") |
| 851 | DEFINITION (U"Performs de-emphasis when value is in the interval (0, @@Nyquist frequency@)") |
| 852 | ENTRY (U"Algorithm") |
| 853 | NORMAL (U"For each LPC frame the corresponding Spectrum will be calculated according to the algorithm " |
| 854 | "explained in @@LPC: To Spectrum (slice)...@. " |
| 855 | "For each frequency the power, i.e., the square of the complex values, will be stored in the " |
| 856 | "corresponding area in the Spectrogram.") |
| 857 | MAN_END |
| 858 | |
| 859 | MAN_BEGIN (U"LPC: To VocalTract (slice)...", U"djmw", 20050615) |
| 860 | INTRO (U"You can choose this command after selecting 1 or more @LPC objects.") |
| 861 | ENTRY (U"Settings") |
| 862 | TERM (U"##Time (s)") |
| 863 | DEFINITION (U"the time of the nearest frame, in seconds.") |
| 864 | TERM (U"##Length (m)") |
| 865 | DEFINITION (U"the length of the vocal tract, in metres.") |
| 866 | /* |
| 867 | TERM (U"##Compute length according to Wakita") |
| 868 | DEFINITION (U"the length of the vocal tract is calculated according " |
| 869 | "to the algorithm as described in @@Wakita (1977)@.") |
| 870 | ENTRY (U"Behaviour") |
| 871 | NORMAL (U"A new @VocalTract area function is calculated from the prediction coefficients in the frame. ") |
| 872 | ENTRY (U"Warning") |
| 873 | NORMAL (U"If ##Compute length according to Wakita# is on, the optimal length is searched for in the range from 0.1 m to " |
| 874 | "0.25 m. This length calculation is extremely sensitive to the number of and the positions of the formants " |
| 875 | "with respect to the @@Nyquist frequency@. For example, there is a large difference " |
| 876 | "between the vocal tract length estimates if the highest formant is just below or just above the " |
| 877 | "Nyquist frequency. " |
| 878 | "The algorithm is not very reliable in vocal tract length estimation and we do not recommend using it. " )*/ |
| 879 | MAN_END |
| 880 | |
| 881 | MAN_BEGIN (U"LPC & Sound: Filter...", U"djmw", 20040407) |
| 882 | INTRO (U"A command that creates a new Sound object from one @Sound and one @LPC " |
| 883 | "object which have been selected together.") |
| 884 | ENTRY (U"Settings") |
| 885 | TERM (U"##Use LPC gain") |
| 886 | DEFINITION (U"Determines whether the gain from the LPC is used in the synthesis.") |
| 887 | ENTRY (U"Behaviour") |
| 888 | NORMAL (U"Filters the selected Sound by the selected LPC-filter.") |
| 889 | NORMAL (U"When the LPC-gain is used the samples in the new Sound will be " |
| 890 | "multiplied with the square root of the corresponding LPC-gain value.") |
| 891 | NORMAL (U"In #Z-domain notation: #O(%z) = #H(%z) \\.c #E(%z), where " |
| 892 | "#E(%z) is the selected filter input Sound, #H(%z) the selected LPC filter, " |
| 893 | "and, #O(%z) the filter output (the new Sound that will appear in the List of objects).") |
| 894 | MAN_END |
| 895 | |
| 896 | MAN_BEGIN (U"LPC & Sound: Filter with filter at time...", U"djmw", 20101009) |
| 897 | INTRO (U"Filters the selected @Sound with a static filter that is formed by the filter coefficients " |
| 898 | "from only one @LPC frame.") |
| 899 | ENTRY (U"Settings") |
| 900 | TERM (U"##Channel") |
| 901 | DEFINITION (U"determines the sound channel to be filtered.") |
| 902 | TERM (U"##Use filter at time (s)") |
| 903 | DEFINITION (U"determines which LPC frame will be chosen to filter the sound. ") |
| 904 | MAN_END |
| 905 | |
| 906 | MAN_BEGIN (U"LPC & Sound: Filter (inverse)", U"djmw", 19970126) |
| 907 | INTRO (U"A command that creates a new Sound object from one @Sound and one @LPC " |
| 908 | "object which have been selected together.") |
| 909 | ENTRY (U"Behaviour") |
| 910 | NORMAL (U"Given a filter (the selected LPC) and its output (the selected Sound), " |
| 911 | "its input is reconstructed (the new Sound that will appear in the List of objects).") |
| 912 | NORMAL (U"In Z-domain notation: #E(%z) = #O(%z) / #H(%z), where " |
| 913 | "#O(%z) is the filter output Sound, #H(%z) the LPC filter, and, #E(%z) the filter " |
| 914 | "input Sound. (Selecting this newly generated Sound and the LPC, choosing the command " |
| 915 | "##Filter...# generates a Sound that is identical to the Sound that originated " |
| 916 | "the LPC.)") |
| 917 | MAN_END |
| 918 | |
| 919 | MAN_BEGIN (U"LPC & Sound: Filter (inverse) with filter at time...", U"djmw", 20101009) |
| 920 | INTRO (U"%%Inverse% filters the selected @Sound with a static inverse filter that is formed by the filter coefficients " |
| 921 | "from only one @LPC frame.") |
| 922 | ENTRY (U"Settings") |
| 923 | TERM (U"##Channel") |
| 924 | DEFINITION (U"determines the sound channel to be filtered.") |
| 925 | TERM (U"##Use filter at time (s)") |
| 926 | DEFINITION (U"determines which LPC frame will be chosen to inverse filter the sound. ") |
| 927 | MAN_END |
| 928 | |
| 929 | MAN_BEGIN (U"MFCC", U"djmw", 20160225) |
| 930 | INTRO (U"One of the @@types of objects@ in Praat.") |
| 931 | NORMAL (U"An object of type MFCC represents mel frequency cepstral coefficients " |
| 932 | "as a function of time. The coefficients are represented in a number of frames centred at equally spaced times. " |
| 933 | "at constant sampling period.") |
| 934 | ENTRY (U"MFCC commands") |
| 935 | NORMAL (U"Creation:") |
| 936 | LIST_ITEM (U"\\bu @@Sound: To MFCC...@") |
| 937 | LIST_ITEM (U"\\bu @@MelSpectrogram: To MFCC...@") |
| 938 | MAN_END |
| 939 | |
| 940 | MAN_BEGIN (U"MFCC: To MelFilter...", U"djmw", 20141023) |
| 941 | INTRO (U"A #deprecated command replaced by @@MFCC: To MelSpectrogram...@.") |
| 942 | ENTRY (U"Settings") |
| 943 | TERM (U"##From coefficient#, ##To coefficient#") |
| 944 | DEFINITION (U"the range of coefficients that will be used in the reconstruction.") |
| 945 | ENTRY (U"Details") |
| 946 | NORMAL (U"The output of the triangular filters in a mel filter bank will be " |
| 947 | "reconstructed by applying the inverse cosine transform:") |
| 948 | EQUATION (U"%P__%j_ = 2/N (%c__0_/2 + \\Si__%k=1_^^%N-1^ %c__%k_ cos (\\pi%k(%j-0.5)/%N))),") |
| 949 | NORMAL (U"where %N represents the number of filters, %j runs from 1 to %N, and coefficients %c__%k_ with %k less than " |
| 950 | "%%fromCoefficient% and %k larger than %%toCoefficient% take zero values in the evaluation.") |
| 951 | MAN_END |
| 952 | |
| 953 | MAN_BEGIN (U"MFCC: To MelSpectrogram...", U"djmw", 20141023) |
| 954 | INTRO (U"A command to (re)construct a @MelSpectrogram object from the selected @MFCC object.") |
| 955 | ENTRY (U"Settings") |
| 956 | TERM (U"##From coefficient#, ##To coefficient#") |
| 957 | DEFINITION (U"the range of coefficients that will be used in the reconstruction.") |
| 958 | TERM (U"##Include constant term") |
| 959 | DEFINITION (U"selects whether or not to include the %c__0_ coefficient in the reconstruction. " |
| 960 | "As can be seen from the formula below, the contribution of the %c__0_ term is equal for each filter.") |
| 961 | ENTRY (U"Details") |
| 962 | NORMAL (U"The values %P__%j_ in each frame of the MelSpectrogram will be constructed by " |
| 963 | "applying the inverse Discrete Cosine Transform to the corresponding frame of the MFCC object:") |
| 964 | EQUATION (U"%P__%j_ = 2/N (%c__0_/2 + \\Si__%k=1_^^%N-1^ %c__%k_ cos (\\pi%k(%j-0.5)/%N))),") |
| 965 | NORMAL (U"where %N represents the number of filters that were used to get the MFCC object, %j runs from 1 to %N, " |
| 966 | "and coefficients %c__%k_ with %k less than " |
| 967 | "%%fromCoefficient% and %k larger than %%toCoefficient% take zero values in the evaluation.") |
| 968 | MAN_END |
| 969 | |
| 970 | MAN_BEGIN (U"Sound: To PowerCepstrogram...", U"djmw", 20200403) |
| 971 | INTRO (U"A command that creates a @@PowerCepstrogram@ from every selected @@Sound@.") |
| 972 | ENTRY (U"Settings") |
| 973 | TERM (U"##Pitch floor (Hz)") |
| 974 | DEFINITION (U"determines the effective length of the analysis window as three periods of this pitch, " |
| 975 | "e.g. if the pitch floor is 60 Hz, the analysis window will be 3/60 = 0.05 seconds long.") |
| 976 | TERM (U"##Time step (s)") |
| 977 | DEFINITION (U"defines the distance between the centres of subsequent frames. This determines the number of frames " |
| 978 | "in the resulting PowerCepstrogram.") |
| 979 | TERM (U"##Maximum frequency (Hz)") |
| 980 | DEFINITION (U"the maximum frequency subject to analysis.") |
| 981 | TERM (U"##Pre-emphasis from (Hz)") |
| 982 | ENTRY (U"Algorithm") |
| 983 | NORMAL (U"The sound will first be resampled to twice the value of the %%Maximum frequency%, with " |
| 984 | "the algorithm described at @@Sound: Resample...@. After this, pre-emphasis is applied with the " |
| 985 | "algorithm described at @@Sound: Pre-emphasize (in-place)...@. For each analysis window a Gaussian " |
| 986 | "window is applied and the ##Spectrum# is calculated. " |
| 987 | "The Spectrum is then transformed to a ##PowerCepstrum# with the procedure described at @@Spectrum: To PowerCepstrum@. " |
| 988 | "Finally, the values from the PowerCepstrum are stored in the vertical slice of the PowerCepstrogram.") |
| 989 | MAN_END |
| 990 | |
| 991 | MAN_BEGIN (U"Sound: To Formant (robust)...", U"djmw", 20111027) |
| 992 | INTRO (U"A command that creates a @@Formant@ object from every selected @@Sound@. ") |
| 993 | ENTRY (U"Settings") |
| 994 | NORMAL (U"The settings for ##Time step (s)#, ##Maximum number of formants#, ##Formant ceiling (Hz), " |
| 995 | "##Window length (s)# and ##Pre-emphasis from (Hz)# are as in @@Sound: To Formant (burg)...@. " |
| 996 | " The following settings determine aspects of the iterative formant frequency refinement.") |
| 997 | TERM (U"%%Number of std. dev.%,") |
| 998 | DEFINITION (U"determines the number of standard deviations from where selective weighing of samples starts. ") |
| 999 | TERM (U"%%Maximum number of iterations%,") |
| 1000 | DEFINITION (U"determines the maximum number of iterations allowed in the refinement step.") |
| 1001 | TERM (U"%%Tolerance%,") |
| 1002 | DEFINITION (U"detemines another stop ctriterion for the refinement step. If the relative change in variance " |
| 1003 | "between successive iterations is less then this value, iteration stops. Iteration stops whenever " |
| 1004 | "one of the two defined stop criteria is reached.") |
| 1005 | ENTRY (U"Algorithm") |
| 1006 | NORMAL (U"First the sound is downsampled to twice the maximum formant frequency. " |
| 1007 | "Next, the LPC coefficients are determined by the autocorrelation method. " |
| 1008 | "Finally, in an iterative procedure as described by @@Lee (1988)@, " |
| 1009 | "the formant frequencies and bandwidths are refined by selective weighting of samples values.") |
| 1010 | MAN_END |
| 1011 | |
| 1012 | MAN_BEGIN (U"Sound: LPC analysis", U"djmw", 19970126) |
| 1013 | INTRO (U"You can perform this analysis by selecting one or more @Sound objects and " |
| 1014 | "choosing the appropriate command to generate an @LPC.") |
| 1015 | NORMAL (U"The acronym LPC stands for Linear Predictive Coding.") |
| 1016 | NORMAL (U"In the LPC analysis one tries to predict %x__%n_ on the basis of the %p previous samples,") |
| 1017 | EQUATION (U"%x\\'p__%n_ = \\su %a__%k_ %x__%%n-k%_") |
| 1018 | NORMAL (U"then {%a__1_, %a__2_, ..., %a__%p_} can be chosen to minimize the prediction power %%Q__p_% where") |
| 1019 | EQUATION (U"%%Q__p_% = E [ |%x__%n_ - %x\\'p__%n_|^2].") |
| 1020 | NORMAL (U"Several different algorithms exist for minimizing %%Q__p_%:") |
| 1021 | LIST_ITEM (U"\\bu @@Sound: To LPC (autocorrelation)...|To LPC (autocorrelation)...@") |
| 1022 | LIST_ITEM (U"\\bu @@Sound: To LPC (covariance)...|To LPC (covariance)...@") |
| 1023 | LIST_ITEM (U"\\bu @@Sound: To LPC (burg)...|To LPC (burg)...@") |
| 1024 | LIST_ITEM (U"\\bu @@Sound: To LPC (marple)...|To LPC (marple)...@") |
| 1025 | MAN_END |
| 1026 | |
| 1027 | #define Sound_to_LPC_COMMON_HELP(method) \ |
| 1028 | INTRO (U"With this command you create a new @LPC from every selected @Sound, " \ |
| 1029 | "using " method " method.") \ |
| 1030 | ENTRY (U"Warning") \ |
| 1031 | NORMAL (U"You are advised not to use this command for formant analysis. " \ |
| 1032 | "For formant analysis, instead use @@Sound: To Formant (burg)...@, " \ |
| 1033 | "which also works via LPC (linear predictive coding). This is because " \ |
| 1034 | "##Sound: To Formant (burg)...# lets you specify a maximum frequency, " \ |
| 1035 | "whereas the ##To LPC# commands automatically use the @@Nyquist frequency@ " \ |
| 1036 | "as their maximum frequency. If you do use one of the ##To LPC# commands " \ |
| 1037 | "for formant analysis, you may therefore want to downsample the sound first. " \ |
| 1038 | "For instance, if you want five formants below 5500 Hz but your Sound has a sampling frequency " \ |
| 1039 | "of 44100 Hz, you have to downsample the sound to 11000 Hz with the @@Sound: Resample...@ command. " \ |
| 1040 | "After that, you can use the ##To LPC# commands, with a prediction order of 10 or 11.") \ |
| 1041 | ENTRY (U"Settings") \ |
| 1042 | TERM (U"##Prediction order#") \ |
| 1043 | DEFINITION (U"the number of linear prediction coefficients, also called the %%number of poles%. " \ |
| 1044 | "Choose this number at least twice as large as the number of spectral peaks that you want " \ |
| 1045 | "to detect.") \ |
| 1046 | TERM (U"##Analysis window duration (s)") \ |
| 1047 | DEFINITION (U"the effective duration of each analysis frame, in seconds.") \ |
| 1048 | TERM (U"##Time step (s)") \ |
| 1049 | DEFINITION (U"the time step between two consecutive analysis frames.") \ |
| 1050 | TERM (U"##Pre-emphasis frequency (Hz)") \ |
| 1051 | DEFINITION (U"a +6dB / octave filtering will be applied above this frequency. " \ |
| 1052 | "A pre-emphasis frequency of 48.47 Hz for a signal with a sampling frequency of 10 kHz " \ |
| 1053 | "approximately corresponds to a value of %a = 0.97 for the filter %y__%n_ = %x__%n_ - %a \\.c %x__%n-1_. " \ |
| 1054 | "The relation between %a and the pre-emphasis frequency is: " \ |
| 1055 | "%a = exp (\\--2\\.c%\\pi\\.c%preemphasisFrequency/%samplingFrequency). " \ |
| 1056 | "If you do not want pre-emphasis, choose a frequency greater than the @@Nyquist frequency@.") |
| 1057 | |
| 1058 | MAN_BEGIN (U"Sound: To LPC (autocorrelation)...", U"David Weenink & Paul Boersma", 20040407) |
| 1059 | Sound_to_LPC_COMMON_HELP ("the autocorrelation") |
| 1060 | ENTRY (U"Algorithm") |
| 1061 | NORMAL (U"The autocorrelation algorithm is decribed in @@Markel & Gray (1976)@.") |
| 1062 | MAN_END |
| 1063 | |
| 1064 | MAN_BEGIN (U"Sound: To LPC (covariance)...", U"David Weenink & Paul Boersma", 20040407) |
| 1065 | Sound_to_LPC_COMMON_HELP ("the covariance") |
| 1066 | ENTRY (U"Algorithm") |
| 1067 | NORMAL (U"The covariance algorithm is decribed in @@Markel & Gray (1976)@.") |
| 1068 | MAN_END |
| 1069 | |
| 1070 | MAN_BEGIN (U"Sound: To LPC (marple)...", U"djmw", 19970126) |
| 1071 | Sound_to_LPC_COMMON_HELP ("Marple's") |
| 1072 | TERM (U"##Tolerance 1") |
| 1073 | DEFINITION (U"stop the iteration when %E(%m) / %E(0) < %%Tolerance 1%, where %E(%m) is the " |
| 1074 | "prediction error for order %m.") |
| 1075 | TERM (U"##Tolerance 2") |
| 1076 | DEFINITION (U"stop the iteration when (%E(%m) - %E(%m-1)) / %E(%m-1) < %%Tolerance 2.") |
| 1077 | ENTRY (U"Algorithm") |
| 1078 | NORMAL (U"The algorithm is described in @@Marple (1980)@.") |
| 1079 | MAN_END |
| 1080 | |
| 1081 | MAN_BEGIN (U"Sound: To LPC (burg)...", U"David Weenink & Paul Boersma", 20040407) |
| 1082 | Sound_to_LPC_COMMON_HELP ("Burg's") |
| 1083 | ENTRY (U"Algorithm") |
| 1084 | NORMAL (U"Burg's algorithm is described in @@Anderson (1978)@") |
| 1085 | MAN_END |
| 1086 | |
| 1087 | MAN_BEGIN (U"Sound: To MFCC...", U"djmw", 20141022) |
| 1088 | INTRO (U"A command that creates a @MFCC object from every selected @Sound " |
| 1089 | "object.") |
| 1090 | NORMAL (U"The analysis proceeds in two steps:") |
| 1091 | LIST_ITEM (U"1. We perform a spectrum analysis on a mel frequency scale " |
| 1092 | "(see @@Sound: To MelSpectrogram...@ for details).") |
| 1093 | LIST_ITEM (U"2. We convert the melspectrogram values to mel frequency cepstral " |
| 1094 | "coefficients (see @@MelSpectrogram: To MFCC...@ for details).") |
| 1095 | MAN_END |
| 1096 | |
| 1097 | MAN_BEGIN (U"Spectrum: To PowerCepstrum", U"djmw", 20190908) |
| 1098 | INTRO (U"A command to create a @PowerCepstrum from every selected @Spectrum.") |
| 1099 | ENTRY (U"Mathematical procedure") |
| 1100 | NORMAL (U"The spectrum %X(%f) is transformed to a new spectrum %%X%\\'p(%f), where " |
| 1101 | "Re(%X\\'p(%f)) = ln (Re(%X(%f))^^2^ + Im(%X(%f))^^2^) and Im(%X\\'p(%f)) = 0.") |
| 1102 | NORMAL (U"The new spectrum %X\\'p(%f) is then transformed to a Sound %x(%t) by means of an inverse Fourier " |
| 1103 | "transform as is described in @@Spectrum: To Sound@. The %%squares% of the transformed " |
| 1104 | "values, %x(%t)^^2^, are stored in the ##PowerCepstrum#.") |
| 1105 | MAN_END |
| 1106 | |
| 1107 | MAN_BEGIN (U"VocalTractTier", U"djmw", 20120423) |
| 1108 | INTRO (U"One of the @@types of objects@ in Praat. A VocalTractTier objects contains a number of (%%time%, %%VocalTract%) " |
| 1109 | "points, where a @@VocalTract@ represents the area function of the vocal tract expressed as m^^2^, running from the glottis to the lips.") |
| 1110 | MAN_END |
| 1111 | |
| 1112 | MAN_BEGIN (U"theil regression", U"djmw", 20190909) |
| 1113 | NORMAL (U"a robust linear regression method, first proposed by @@Theil (1950)@. The slope of the regression line is estimated as " |
| 1114 | "the median of all pairwise slopes between each pair of points in the data set. Because this number of pairs increases quadratically " |
| 1115 | "with the number of data points, we have implemented a somewhat less computationally intensive procedure, the %%incomplete% " |
| 1116 | "theil regression. In the incomplete method we first split the data set of %N data points (%x__%i_, %y__%i_), %i = 1..%N, " |
| 1117 | "in two equal sets of size %N/2 and then calculate %N/2 slopes as ") |
| 1118 | EQUATION (U"%m__%i_ = (%y__%N/2+%i_ - %y__%i_) / (%x__%N/2+%i_ - %x__%i_), for %i = 1..%N/2.") |
| 1119 | NORMAL (U"The regression slope %m is calculated as the median of these %N/2 values %m__%i_.") |
| 1120 | NORMAL (U"Given the slope %m, the offset %b is calculated as the median of the %N values %b__%i_= %y__%i_ - %m\\.c%x__%i_.") |
| 1121 | NORMAL (U"The theil regression has a breakdown point of 29.3\\% , which means that it can tolerate arbitrary corruption of up to " |
| 1122 | "29.3\\% of the input data-points without degradation of its accuracy") |
| 1123 | MAN_END |
| 1124 | |
| 1125 | MAN_BEGIN (U"Ammar et al. (2001)", U"djmw", 20200416) |
| 1126 | NORMAL (U"G.S. Ammar, D. Calvetti, W.B. Gragg, L. Reichel (2001): \"Polynomial zero finders based on Szegö polynomials\", " |
| 1127 | "%%Journal of Computational and Applied Mathematics% #127: 1\\-–16.") |
| 1128 | MAN_END |
| 1129 | |
| 1130 | MAN_BEGIN (U"Anderson (1978)", U"djmw", 20030701) |
| 1131 | NORMAL (U"N. Anderson (1978): \"On the calculation of filter coefficients for " |
| 1132 | "maximum entropy spectral analysis.\" In Childers: %%Modern Spectrum Analysis%, " |
| 1133 | "IEEE Press: 252\\--255.") |
| 1134 | MAN_END |
| 1135 | |
| 1136 | MAN_BEGIN (U"Deng et al. (2006)", U"djmw", 20210310) |
| 1137 | NORMAL (U"L. Deng, X. Cui, R. Pruvenok, J. Huang, S. Momen, Y. Chen & A. Alwan (2006): \"A database of " |
| 1138 | "vocal tract resonance trajectories for research in speech processing\", %%Proceedings of the IEEE International Conference on Acoustics, Speech, and Signal Processing (ICASSP)%, Toulouse, France, May 2006.") |
| 1139 | MAN_END |
| 1140 | |
| 1141 | MAN_BEGIN (U"Fleisher et al. (2015)", U"djmw", 20191008) |
| 1142 | NORMAL (U"M. Fleisher, S. Pinkert, W. Mattheus, A. Mainka & D. Mürbe (2015): \"Formant frequencies and bandwidths of the vocal " |
| 1143 | "transfer function are affected by the mechanical impedance of the vocal tract wall.\", %%Biomech Model Mechanobiol% #14: 719\\--733.") |
| 1144 | MAN_END |
| 1145 | |
| 1146 | MAN_BEGIN (U"Hawks & Miller (1995)", U"djmw", 20191008) |
| 1147 | NORMAL (U"J. Hawks & J. Miller (1995): \"A formant bandwidth estimation procedure for vowel synthesis.\", " |
| 1148 | "%%Journal of the Acoustical Society of America% #97: 1343\\--1344.") |
| 1149 | MAN_END |
| 1150 | |
| 1151 | MAN_BEGIN (U"Hillenbrand et al. (1994)", U"djmw", 20121017) |
| 1152 | NORMAL (U"J. Hillenbrand, R.A. Cleveland & R.L. Erickson (1994): \"Acoustic correlates of breathy vocal quality\", " |
| 1153 | "%%Journal of speech and hearing research% #37: 769\\--778.") |
| 1154 | MAN_END |
| 1155 | |
| 1156 | MAN_BEGIN (U"Hillenbrand & Houde (1996)", U"djmw", 20121203) |
| 1157 | NORMAL (U"J. Hillenbrand & R.A. Houde (1996): \"Acoustic correlates of breathy vocal quality: Dysphonic voices and continuous " |
| 1158 | "speech\", %%Journal of speech and hearing research% #39: 311\\--321.") |
| 1159 | MAN_END |
| 1160 | |
| 1161 | MAN_BEGIN (U"Jacquelin (2009)", U"djmw", 20210126) |
| 1162 | NORMAL (U"J. Jacquelin (2009): \"Régressions et équations intégrales\", https://fr.scribd.com/doc/14674814/Regressions-et-equations-integrales: 1\\--84.") |
| 1163 | MAN_END |
| 1164 | |
| 1165 | MAN_BEGIN (U"Lee (1988)", U"djmw", 20111027) |
| 1166 | NORMAL (U"C.-H. Lee (1988): \"On robust linear prediction of speech.\", %%IEEE Trans. on ASSP% #36: 642\\--649.") |
| 1167 | MAN_END |
| 1168 | |
| 1169 | MAN_BEGIN (U"Markel & Gray (1976)", U"djmw", 19980114) |
| 1170 | NORMAL (U"J.D. Markel & A.H. Gray, Jr. (1976): %%Linear prediction of speech.% " |
| 1171 | "Springer Verlag, Berlin.") |
| 1172 | MAN_END |
| 1173 | |
| 1174 | MAN_BEGIN (U"Marple (1980)", U"djmw", 19980114) |
| 1175 | NORMAL (U"L. Marple (1980): \"A new autoregressive spectrum analysis algorithm.\" " |
| 1176 | "%%IEEE Trans. on ASSP% #28, 441\\--454.") |
| 1177 | MAN_END |
| 1178 | |
| 1179 | MAN_BEGIN (U"Rothweiler (1999)", U"djmw", 20160507) |
| 1180 | NORMAL (U"J. Rothweiler (1999): \"On polynomial reduction in the computation of LSP frequencies.\" " |
| 1181 | "%%IEEE Trans. on ASSP% #7, 592\\--594.") |
| 1182 | MAN_END |
| 1183 | |
| 1184 | MAN_BEGIN (U"Theil (1950)", U"djmw", 20121118) |
| 1185 | NORMAL (U"H. Theil (1950): \"A rank-invariant method of linear and polynomial regression analysis\", " |
| 1186 | "%%Proceedings of Koninklijke Nederlandse Akademie van Wetenschappen% ##A.53#: 1397\\--1412.") |
| 1187 | MAN_END |
| 1188 | |
| 1189 | MAN_BEGIN (U"Wakita (1977)", U"djmw", 19980114) |
| 1190 | NORMAL (U"H. Wakita (1977): \"Normalization of vowels by vocal-tract " |
| 1191 | "length and its application to vowel identification.\" %%IEEE Trans. on ASSP% " |
| 1192 | "#25: 183\\--192.") |
| 1193 | MAN_END |
| 1194 | |
| 1195 | MAN_BEGIN (U"Weenink (2015)", U"djmw", 20200514) |
| 1196 | NORMAL (U"D. Weenink (2015): \"Improved formant frequency measurements of short segments\", " |
| 1197 | "%%Proceedings of the 18th International Congress of Phonetic Sciences%, Brighton. ") |
| 1198 | MAN_END |
| 1199 | |
| 1200 | } |
| 1201 | |
| 1202 | /* End of file manual_LPC.cpp */ |