Ejemplo n.º 1
0
        private int _nonStaticLsfMeanDownScaleFactor = 2;    // 40D, 8.0 for other LSP order
        #endregion

        #region Construction

        /// <summary>
        /// Initializes a new instance of the FixedPointLspGaussianSerializer class.
        /// </summary>
        /// <param name="config">Gaussian configuration.</param>
        internal FixedPointLspGaussianSerializer(GaussianConfig config) :
            base(config)
        {
            Helper.ThrowIfNull(config);

            // 32768, quantize delta (LSF[i+1]-LSP[i]) to 256, LSF (0, 0.5), so delta will depend on dimension count
            // 4.0 if dimension >= 40D
            // 8.0 if dimension < 40D
            // Maximum range of LSF (16384 -> 0.5)
            // 1024 = (256 * 4), maximum delta of LSF should be 1/16 of 0.5 in term of 40D
            // 256 is what to quantize
            // 1 is the smallest difference, to make sure the stabilize of the LPC filter.
            if (Config.StaticVectorSize >= 40)
            {
                _staticLsfMeanDownScaleTo256Factor = 4;
                _nonStaticLsfMeanDownScaleFactor = 2;
            }
            else
            {
                _staticLsfMeanDownScaleTo256Factor = 8;
                _nonStaticLsfMeanDownScaleFactor = 4;
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the FixedPointF0GaussianSerializer class.
 /// </summary>
 /// <param name="config">Gaussian configuration.</param>
 internal FixedPointF0GaussianSerializer(GaussianConfig config) :
     base(config)
 {
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Initializes a new instance of the GaussianSerializer class.
 /// </summary>
 /// <param name="config">Gaussian configuration.</param>
 protected GaussianSerializer(GaussianConfig config) :
     this()
 {
     Helper.ThrowIfNull(config);
     Config = config;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the MultipleSpaceDistributionGaussianSerializer class.
 /// </summary>
 /// <param name="config">Gaussian configuration.</param>
 internal MultipleSpaceDistributionGaussianSerializer(GaussianConfig config) :
     base(config)
 {
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Create Gaussian serializer.
        /// </summary>
        /// <param name="config">Gaussian configuration.</param>
        /// <param name="modelType">Model type.</param>
        /// <param name="modelDistribution">Model distribution.</param>
        /// <returns>Gaussian serializer.</returns>
        public static GaussianSerializer Create(GaussianConfig config, HmmModelType modelType,
             ModelDistributionType modelDistribution)
        {
            Helper.ThrowIfNull(config);

            GaussianSerializer serializer = null;
            if (config.IsFixedPoint)
            {
                if (modelType == HmmModelType.Lsp)
                {
                    serializer = new FixedPointLspGaussianSerializer(config);
                }
                else if (modelType == HmmModelType.FundamentalFrequency)
                {
                    serializer = new FixedPointF0GaussianSerializer(config);
                }
                else if (modelType == HmmModelType.Mbe)
                {
                    serializer = new FixedPointMBEGaussianSerializer(config);
                }
            }

            if (serializer == null)
            {
                if (modelDistribution == ModelDistributionType.Msd)
                {
                    serializer = new MultipleSpaceDistributionGaussianSerializer(config);
                }
                else
                {
                    serializer = new GaussianSerializer(config);
                }
            }

            return serializer;
        }