Skip to content

Commit

Permalink
Adding more comments to the code...
Browse files Browse the repository at this point in the history
git-svn-id: https://mary.opendfki.de/repos/trunk@2033 953a6561-930b-0410-b2a6-db37d1b2ae63
  • Loading branch information
Oytun Turk committed Jul 29, 2009
1 parent 70ec4c2 commit 644f867
Show file tree
Hide file tree
Showing 20 changed files with 147 additions and 84 deletions.
Binary file modified doc/MaryReferences.odt
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 60,7 @@ public class WeightedCodebookMapperParams {
public double freqRange; //Frequency range to be considered around center freq when matching LSFs (note that center freq is estimated automatically as the middle of most closest LSFs)
public static final double DEFAULT_FREQ_RANGE_FOR_LSF_MATCH = 5000.0;

public int lpOrder;
public int lpOrder; //Linear prediction oreder

public WeightedCodebookMapperParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 30,10 @@ public class WeightedCodebookTransformerParams extends BaselineTransformerParams

public String codebookFile; //Codebook file

public WeightedCodebookMapperParams mapperParams;
public WeightedCodebookMapperParams mapperParams; //Weighted codebook mapping parameters

public boolean isContextBasedPreselection;
public int totalContextNeighbours;
public boolean isContextBasedPreselection; //If true, use context to pre-select codebook entries for finding the best matches for a given source vector
public int totalContextNeighbours; //Number of previous and next neightbours to be considered for context based pre-selection

public WeightedCodebookTransformerParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 31,13 @@
* @author Oytun T&uumlrk
*/
public class JointGMMTrainerParams extends BaselineTrainerParams {
public boolean isContextualGMMs;
public int contextClassificationType; //Only active when isContextualGMMs=true
public boolean isContextualGMMs; //Train separate GMMs for each context class
public int contextClassificationType; //Type of context classification to use. Only active when isContextualGMMs=true

public GMMTrainerParams gmmEMTrainerParams;
public String jointGMMFile;
public GMMTrainerParams gmmEMTrainerParams; //Expectation-maximization training parameters
public String jointGMMFile; //Binary file that keeps the GMMs

public int vocalTractFeature;
public int vocalTractFeature; //Type of vocal tract feature that the GMMs will be trained for.

public JointGMMTrainerParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 26,9 @@
*
* @author Oytun T&uumlrk
*/
public class JointGMMTransformerParams extends BaselineTransformerParams {
public String jointGmmFile; //Joint GMM file
public class JointGMMTransformerParams extends BaselineTransformerParams
{
public String jointGmmFile; //Binary GMM file

public JointGMMTransformerParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 27,14 @@
*
* @author Oytun T&uumlrk
*/
public class BaselineOutlierEliminatorParams extends BaselineParams {
public boolean isCheckLsfOutliers;
public boolean isCheckF0Outliers;
public boolean isCheckDurationOutliers;
public boolean isCheckEnergyOutliers;
public class BaselineOutlierEliminatorParams extends BaselineParams
{
public boolean isActive; //Is outlier elimination process being used? If false, the below parameters have no effect.

public boolean isActive;
public boolean isCheckLsfOutliers; //Use LSF distance distributions for finding outliers?
public boolean isCheckF0Outliers; //Use F0 difference distributions for finding outliers?
public boolean isCheckDurationOutliers; //Use duration difference distributions for finding outliers?
public boolean isCheckEnergyOutliers; //Use energy difference distributions for finding outliers?

public BaselineOutlierEliminatorParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 25,9 @@
*
* @author Oytun T&uumlrk
*/
public class GaussianOutlierEliminatorParams extends BaselineOutlierEliminatorParams {
public TotalStandardDeviations totalStandardDeviations;
public class GaussianOutlierEliminatorParams extends BaselineOutlierEliminatorParams
{
public TotalStandardDeviations totalStandardDeviations; //Total standard deviations around the mean to select the entries to be eliminated as outlier from a source-target distance or difference distribution

public boolean isEliminateTooSimilarLsf; //Also eliminate left tail - this forces some average vocal tract transformation for all frames

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 23,45 @@
import marytts.signalproc.analysis.distance.DistanceComputer;

/**
* Parameters for K-Means clustering and mapping based outlier elimination
* This class implements a K-Means clustering and mapping based outlier elimination procedure:
* - Step1: Cluster source and target acoustic features either jointly or separately
* - Step2: For each feature, for each source cluster find the most likely target cluster
* - Step3: For each feature, for each target cluster find the most likely source cluster
* - Step4: Determine outlier pairs by checking the total number of source-target pairs assigned to
* clusters other than the most likely cluster which are sufficiently "distant" from the most likely cluster
*
* @author Oytun T&uumlrk
*/
public class KMeansMappingEliminatorParams extends BaselineOutlierEliminatorParams {
public int eliminationAlgorithm;
//eliminationAlgorithm types and their parameters:
public static final int ELIMINATE_LEAST_LIKELY_MAPPINGS = 1;
public double eliminationLikelihood;
public class KMeansMappingEliminatorParams extends BaselineOutlierEliminatorParams
{
public int eliminationAlgorithm; //EliminationAlgorithm to use
public static final int ELIMINATE_LEAST_LIKELY_MAPPINGS = 1;
public static final int ELIMINATE_MEAN_DISTANCE_MISMATCHES = 2;
public static final int ELIMINATE_USING_SUBCLUSTER_MEAN_DISTANCES = 3;

public static final int ELIMINATE_MEAN_DISTANCE_MISMATCHES = 2;
//Parameters of ELIMINATE_LEAST_LIKELY_MAPPINGS algorithm:
public double eliminationLikelihood;
//

//Parameters of ELIMINATE_MEAN_DISTANCE_MISMATCHES algorithm:
public TotalStandardDeviations totalStandardDeviations;
public int distanceType; //This can be one of the distance measures in class DistanceComputer
public boolean isGlobalVariance; //Use global variances when computing normalized Euclidean distance
// If false, separate variance is computed for each cluster which may lead to inaccuracies when cluster size is small

public static final int ELIMINATE_USING_SUBCLUSTER_MEAN_DISTANCES = 3;

//

public boolean isSeparateClustering; //separate cluster numbers are used only if this is set to true
public int numClusters;
public int numClustersLsf;
public int numClustersF0;
public int numClustersDuration;
public int numClustersEnergy;
public static final int DEFAULT_NUM_CLUSTERS = 30;
public boolean isSeparateClustering; //Separate cluster numbers are used only if this is set to true
public int numClusters; //Total clusters
public int numClustersLsf; //Total clusters for LSFs
public int numClustersF0; //Total clusters for f0
public int numClustersDuration; //Total clusters for duration
public int numClustersEnergy; //Total clusters for energy
public static final int DEFAULT_NUM_CLUSTERS = 30; //Default number of clusters

public int maxIterations;
public double minClusterChangePercent;
public boolean isDiagonalCovariance;
public int maxIterations; //Maximum K-means iterations
public double minClusterChangePercent; //Minimum percentage change in clsuter means to terminate K-means iterations
public boolean isDiagonalCovariance; //Use diagonal covariance matrix as cluster covariances

public KMeansMappingEliminatorParams()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 25,15 @@
*
* @author Oytun T&uumlrk
*/
public class TotalStandardDeviations {
public double general;
public double lsf;
public double f0;
public double duration;
public double energy;
public static final double DEFAULT_TOTAL_STANDARD_DEVIATIONS = 1.5;
public class TotalStandardDeviations
{
public double general; //Common total standard deviations to use unless the user does not want to specify the below parameters
public double lsf; //Standard deviation for LSFs
public double f0; //Standard deviation for f0
public double duration; //Standard deviation for duration
public double energy; //Standard deviation for energy

public static final double DEFAULT_TOTAL_STANDARD_DEVIATIONS = 1.5; //Default value of standard deviations to use

public TotalStandardDeviations()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 44,15 @@
* @author oytun.turk
*
*/
public class BasicProsodyModifierParams {
public float[] tScales;
public float[] tScalesTimes;
public float[] pScales;
public float[] pScalesTimes;
public class BasicProsodyModifierParams
{
public float[] tScales; //Time scale factors
public float[] tScalesTimes; //Instants that the time scale factors are effective.
//For the time instants in between, linear interpolation is used to estimate corresponding time scaling factor.
public float[] pScales; //Pitch scale factors
public float[] pScalesTimes; //Instants that the pitch scale factors are effective.
//For the time instants in between, linear interpolation is used to estimate corresponding pitch scaling factor.


public BasicProsodyModifierParams()
{
Expand Down
7 changes: 5 additions & 2 deletions java/marytts/signalproc/adaptation/prosody/PitchMapping.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 21,21 @@


/**
* A class to support pitch transformation in voice conversion.
*
* @author Oytun T&uumlrk
*
*/
public class PitchMapping extends PitchTransformationData {
public class PitchMapping extends PitchTransformationData
{
//These are for feature requests from the codebook
public static final int SOURCE = 1;
public static final int TARGET = 2;
public static final int SOURCE_TARGET = 3;
public static final int TARGET_SOURCE = 4;
//

public PitchMappingFileHeader header;
public PitchMappingFileHeader header; //Binary file header

//These two contain identical information in different forms
//f0Statistics is always read from the codebook first
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 21,8 @@


/**
* A collection of PitchStatistics.
*
* @author Oytun T&uumlrk
*
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,30 22,35 @@
import marytts.signalproc.adaptation.BaselineParams;

/**
* Parameters for prosody transformation.
*
* @author Oytun T&uumlrk
*
*/
public class ProsodyTransformerParams extends BaselineParams {

public static final int CUSTOM_TRANSFORMATION = -10;
public static final int NO_TRANSFORMATION = 0;

public int energyTransformationMethod; //Energy contour transformation method

////ENERGY
public int energyTransformationMethod;

////DURATION
public int durationTransformationMethod;
////
public int durationTransformationMethod; //Duration transformation method

//Duration transformation method types
public static final int PHONEME_DURATIONS = 1;
public static final int TRIPHONE_DURATIONS = 2;
public static final int SENTENCE_DURATION = 3;
public static final int GLOBAL_AVERAGE = 4;
//

////PITCH
public int pitchTransformationMethod;

////
public int pitchTransformationMethod; //Pitch transformaiton method
//Pitch transformaiton method types
public static final int USE_ONLY_PSCALES = -1;
//

//Global transformations
//Global transformation types
public static final int GLOBAL_MEAN = 1;
public static final int GLOBAL_STDDEV = 2;
public static final int GLOBAL_RANGE = 3;
Expand Down Expand Up @@ -78,7 83,7 @@ public class ProsodyTransformerParams extends BaselineParams {
public boolean isUseInputSlopePitch; //For GLOBAL tfms: Estimate slope from input f0s? Otherwise from codebook
////

public int pitchStatisticsType;
public int pitchStatisticsType; //Type for pitch statistics to use
/////

public ProsodyTransformerParams()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 37,20 @@
import marytts.util.string.StringUtils;

/**
* This class implements the acoustic post-processor in an attempt to improve intelligibility
* of TTS outputs passed from a telephone channel in Blizzard 2009. The algorithm is based on
* some basic processing to enhance formants, to boost consonant gains as compared to vowels,
* and optional highpass filtering.
*
* Reference:
* M. Schröder, S. Pammi, and O. Türk, "Multilingual MARY TTS participation in the Blizzard Challenge 2009",
* in Proc. of the Blizzard Challenge 2009.
*
* @author oytun.turk
*
*/
public class IeeeTaslp2009MaryResultsPreprocessor {

public class IeeeTaslp2009MaryResultsPreprocessor
{
//Search for all .txt files, read them, extract test results, and write all results to a separate, single file
//Also compute total time it took for each .txt file to be completed by the subject
public static void combineResults(String[] folders, String completeResultsFile, String totalDurationsFile)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 34,11 @@


/**
*
* A Pitch-synchronous LPC analyser.
*
* @author Marc Schröder
*
* A Pitch-synchronous LPC analyser.
*
*/
public class LpcPitchSynchronousAnalyser extends PitchFrameAnalyser
{
Expand Down
7 changes: 4 additions & 3 deletions java/marytts/signalproc/analysis/LsfAnalyser.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 36,12 @@
import marytts.util.signal.SignalProcUtils;

/**
* @author Marc Schröder
*
*
* Demonstration program to accompany the subroutines described in the
* articles by J. Rothweiler, on computing the Line Spectral Frequencies.
* From http://mysite.verizon.net/vzenxj75/myown1/joe/lsf/a2lsp.c
* From http://mysite.verizon.net/vzenxj75/myown1/joe/lsf/a2lsp.c
*
* @author Marc Schröder
*
*/
public class LsfAnalyser
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 24,10 @@
import marytts.util.signal.SignalProcUtils;


//Note that RegularizedPreWarpedCepstrumEstimator or RegularizedPostWarpedCepstrumEstimator works much better
public class RegularizedCepstrumEstimator
{
public static final double DEFAULT_LAMBDA = 5e-4;
public static final double DEFAULT_LAMBDA = 5e-4; //Regularization parameter

//Warping for better estimation can be performed in two ways:
// either pre-warping of linear frequency values in Bark-scale
Expand Down
Loading

0 comments on commit 644f867

Please sign in to comment.