当前位置: 首页>>代码示例>>C++>>正文


C++ Data_copy函数代码示例

本文整理汇总了C++中Data_copy函数的典型用法代码示例。如果您正苦于以下问题:C++ Data_copy函数的具体用法?C++ Data_copy怎么用?C++ Data_copy使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Data_copy函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Permutation_checkInvariant

void Permutation_checkInvariant (Permutation me) {
	autoPermutation thee = Data_copy (me);
	NUMsort_l (thy numberOfElements, thy p);
	for (long i = 1; i <= my numberOfElements; i++) {
		if (thy p[i] != i) {
			Melder_throw (me, ":not a valid permutation.");
		}
	}
}
开发者ID:georgiee,项目名称:lip-sync-lpc,代码行数:9,代码来源:Permutation.cpp

示例2: Sound_FormantTier_filter_noscale

Sound Sound_FormantTier_filter_noscale (Sound me, FormantTier formantTier) {
	try {
		autoSound thee = Data_copy (me);
		Sound_FormantTier_filter_inline (thee.peek(), formantTier);
		return thee.transfer();
	} catch (MelderError) {
		Melder_throw (me, ": not filtered with ", formantTier, ".");
	}
}
开发者ID:tommyharris,项目名称:praat-tau,代码行数:9,代码来源:FormantTier.cpp

示例3: SpellingChecker_extractUserDictionary

autoSortedSetOfString SpellingChecker_extractUserDictionary (SpellingChecker me) {
	try {
		if (! my userDictionary)
			Melder_throw (U"This spelling checker does not contain a user dictionary.");
		return Data_copy (my userDictionary.get());
	} catch (MelderError) {
		Melder_throw (me, U": user dictionary not extracted.");
	}
}
开发者ID:guilhermegarcia,项目名称:praat-1,代码行数:9,代码来源:SpellingChecker.cpp

示例4: Sound_filter_oneFormant

Sound Sound_filter_oneFormant (Sound me, double frequency, double bandwidth) {
	try {
		autoSound thee = Data_copy (me);
		Sound_filterWithOneFormantInline (thee.peek(), frequency, bandwidth);
		return thee.transfer();
	} catch (MelderError) {
		Melder_throw (me, U": not filtered (one formant).");
	}
}
开发者ID:psibre,项目名称:praat,代码行数:9,代码来源:Sound.cpp

示例5: PowerCepstrum_subtractTilt

autoPowerCepstrum PowerCepstrum_subtractTilt (PowerCepstrum me, double qstartFit, double qendFit, int lineType, int fitMethod) {
	try {
		autoPowerCepstrum thee = Data_copy (me);
		PowerCepstrum_subtractTilt_inline (thee.get(), qstartFit,  qendFit, lineType, fitMethod);
		return thee;
	} catch (MelderError) {
		Melder_throw (me, U": couldn't subtract tilt line.");
	}
}
开发者ID:PaulBoersma,项目名称:praat,代码行数:9,代码来源:Cepstrum.cpp

示例6: LPC_and_Sound_filterInverseWithFilterAtTime

Sound LPC_and_Sound_filterInverseWithFilterAtTime (LPC me, Sound thee, int channel, double time) {
	try {
		autoSound him = Data_copy (thee);
		LPC_and_Sound_filterInverseWithFilterAtTime_inline (me, him.peek(), channel, time);
		return him.transfer();
	} catch (MelderError) {
		Melder_throw (thee, ": not inverse filtered.");
	}
}
开发者ID:georgiee,项目名称:lip-sync-lpc,代码行数:9,代码来源:Sound_and_LPC.cpp

示例7: Permutation_permuteRandomly

Permutation Permutation_permuteRandomly (Permutation me, long from, long to) {
	try {
		autoPermutation thee = Data_copy (me);
		Permutation_permuteRandomly_inline (thee.peek(), from, to);
		return thee.transfer();
	} catch (MelderError) {
		Melder_throw (me, ": not permuted.");
	}
}
开发者ID:georgiee,项目名称:lip-sync-lpc,代码行数:9,代码来源:Permutation.cpp

示例8: _Sound_to_LPC

static LPC _Sound_to_LPC (Sound me, int predictionOrder, double analysisWidth, double dt,
                          double preEmphasisFrequency, int method, double tol1, double tol2) {
	double t1, samplingFrequency = 1.0 / my dx;
	double windowDuration = 2 * analysisWidth; /* gaussian window */
	long nFrames, frameErrorCount = 0;

	if (floor (windowDuration / my dx) < predictionOrder + 1) Melder_throw ("Analysis window duration too short.\n"
		        "For a prediction order of ", predictionOrder, " the analysis window duration has to be greater than ", my dx * (predictionOrder + 1),
		        "Please increase the analysis window duration or lower the prediction order.");
	// Convenience: analyse the whole sound into one LPC_frame
	if (windowDuration > my dx * my nx) {
		windowDuration = my dx * my nx;
	}
	Sampled_shortTermAnalysis (me, windowDuration, dt, & nFrames, & t1);
	autoSound sound = Data_copy (me);
	autoSound sframe = Sound_createSimple (1, windowDuration, samplingFrequency);
	autoSound window = Sound_createGaussian (windowDuration, samplingFrequency);
	autoLPC thee = LPC_create (my xmin, my xmax, nFrames, dt, t1, predictionOrder, my dx);

	autoMelderProgress progress (L"LPC analysis");

	if (preEmphasisFrequency < samplingFrequency / 2) {
		Sound_preEmphasis (sound.peek(), preEmphasisFrequency);
	}

	for (long i = 1; i <= nFrames; i++) {
		LPC_Frame lpcframe = (LPC_Frame) & thy d_frames[i];
		double t = Sampled_indexToX (thee.peek(), i);
		LPC_Frame_init (lpcframe, predictionOrder);
		Sound_into_Sound (sound.peek(), sframe.peek(), t - windowDuration / 2);
		Vector_subtractMean (sframe.peek());
		Sounds_multiply (sframe.peek(), window.peek());
		if (method == LPC_METHOD_AUTO) {
			if (! Sound_into_LPC_Frame_auto (sframe.peek(), lpcframe)) {
				frameErrorCount++;
			}
		} else if (method == LPC_METHOD_COVAR) {
			if (! Sound_into_LPC_Frame_covar (sframe.peek(), lpcframe)) {
				frameErrorCount++;
			}
		} else if (method == LPC_METHOD_BURG) {
			if (! Sound_into_LPC_Frame_burg (sframe.peek(), lpcframe)) {
				frameErrorCount++;
			}
		} else if (method == LPC_METHOD_MARPLE) {
			if (! Sound_into_LPC_Frame_marple (sframe.peek(), lpcframe, tol1, tol2)) {
				frameErrorCount++;
			}
		}
		if ( (i % 10) == 1) {
			Melder_progress ( (double) i / nFrames, L"LPC analysis of frame ",
			                   Melder_integer (i), L" out of ", Melder_integer (nFrames), L".");
		}
	}
	return thee.transfer();
}
开发者ID:georgiee,项目名称:lip-sync-lpc,代码行数:56,代码来源:Sound_and_LPC.cpp

示例9: PowerCepstrogram_paint

void PowerCepstrogram_paint (PowerCepstrogram me, Graphics g, double tmin, double tmax, double qmin, double qmax, double dBmaximum, int autoscaling, double dynamicRangedB, double dynamicCompression, int garnish) {
	if (tmax <= tmin) { tmin = my xmin; tmax = my xmax; }
	if (qmax <= qmin) { qmin = my ymin; qmax = my ymax; }
	long itmin, itmax, ifmin, ifmax;
	if (! Matrix_getWindowSamplesX (me, tmin - 0.49999 * my dx, tmax + 0.49999 * my dx, & itmin, & itmax) ||
		 ! Matrix_getWindowSamplesY (me, qmin - 0.49999 * my dy, qmax + 0.49999 * my dy, & ifmin, & ifmax)) {
		return;
	}
	autoMatrix thee = Data_copy (me);
	double min = 1e308, max = -min;
	for (long i = 1; i <= my ny; i++) {
		for (long j = 1; j <= my nx; j++) {
			double val = TO10LOG (my z[i][j]);
			min = val < min ? val : min;
			max = val > max ? val : max;
			thy z[i][j] = val;
		}
	}
	double dBminimum = dBmaximum - dynamicRangedB;
	if (autoscaling) {
		dBminimum = min; dBmaximum = max;
	}

	for (long j = 1; j <= my nx; j++) {
		double lmax = thy z[1][j];
		for (long i = 2; i <= my ny; i++) {
			if (thy z[i][j] > lmax) {
				lmax = thy z[i][j];
			}
		}
		double factor = dynamicCompression * (max - lmax);
		for (long i = 1; i <= my ny; i++) {
			thy z[i][j] += factor;
		}
	}
	
	Graphics_setInner (g);
	Graphics_setWindow (g, tmin, tmax, qmin, qmax);
	Graphics_image (g, thy z,
		itmin, itmax,
		Matrix_columnToX (thee.get(), itmin - 0.5),
		Matrix_columnToX (thee.get(), itmax + 0.5),
		ifmin, ifmax,
		Matrix_rowToY (thee.get(), ifmin - 0.5),
		Matrix_rowToY (thee.get(), ifmax + 0.5),
		dBminimum, dBmaximum);

	Graphics_unsetInner (g);
	if (garnish) {
		Graphics_drawInnerBox (g);
		Graphics_textBottom (g, true, U"Time (s)");
		Graphics_marksBottom (g, 2, true, true, false);
		Graphics_marksLeft (g, 2, true, true, false);
		Graphics_textLeft (g, true, U"Quefrency (s)");
	}
}
开发者ID:nullpunktTUD,项目名称:praat,代码行数:56,代码来源:Cepstrogram.cpp

示例10: OrderedOfString_selectUniqueItems

autoOrderedOfString OrderedOfString_selectUniqueItems (OrderedOfString me) {
	try {
		autoStringSet thee = StringSet_create ();
		for (long i = 1; i <= my size; i ++) {
			if (! thy hasItem (my at [i])) {   // FIXME: first sort, then unicize
				autoSimpleString item = Data_copy (my at [i]);
				thy addItem_move (item.move());
			}
		}
		autoOrderedOfString him = OrderedOfString_create ();
		for (long i = 1; i <= thy size; i ++) {
			autoSimpleString item = Data_copy (thy at [i]);
			his addItem_move (item.move());
		}
		return him;
	} catch (MelderError) {
		Melder_throw (me, U": unique items not selected.");
	}
}
开发者ID:READSEARCH,项目名称:praat,代码行数:19,代码来源:Collection_extensions.cpp

示例11: Sound_AmplitudeTier_multiply

autoSound Sound_AmplitudeTier_multiply (Sound me, AmplitudeTier amplitude) {
	try {
		autoSound thee = Data_copy (me);
		Sound_AmplitudeTier_multiply_inline (thee.peek(), amplitude);
		Vector_scale (thee.peek(), 0.9);
		return thee;
	} catch (MelderError) {
		Melder_throw (me, U": not multiplied by ", amplitude, U".");
	}
}
开发者ID:guilhermegarcia,项目名称:praat-1,代码行数:10,代码来源:AmplitudeTier.cpp

示例12: Configuration_varimax

autoConfiguration Configuration_varimax (Configuration me, int normalizeRows,
                                     int quartimax, long maximumNumberOfIterations, double tolerance) {
	try {
		autoConfiguration thee = Data_copy (me);
		NUMvarimax (my data, thy data, my numberOfRows, my numberOfColumns, normalizeRows, quartimax, maximumNumberOfIterations, tolerance);
		return thee;
	} catch (MelderError) {
		Melder_throw (me, U": varimax rotation not performed.");
	}
}
开发者ID:motiz88,项目名称:praat,代码行数:10,代码来源:Configuration.cpp

示例13: VocalTract_to_VocalTractPoint

autoVocalTractPoint VocalTract_to_VocalTractPoint (VocalTract me, double time) {
	try {
		autoVocalTractPoint thee = Thing_new (VocalTractPoint);
		thy number = time;
		thy d_vocalTract = Data_copy (me).transfer();
		return thee;
	} catch (MelderError) {
		Melder_throw (me, U": not converted to VocalTractPoint.");
	}
}
开发者ID:guilhermegarcia,项目名称:praat-1,代码行数:10,代码来源:VocalTractTier.cpp

示例14: Sound_FormantGrid_filter

Sound Sound_FormantGrid_filter (Sound me, FormantGrid formantGrid) {
	try {
		autoSound thee = Data_copy (me);
		Sound_FormantGrid_filter_inline (thee.peek(), formantGrid);
		Vector_scale (thee.peek(), 0.99);
		return thee.transfer();
	} catch (MelderError) {
		Melder_throw (me, ": not filtered with ", formantGrid, ".");
	}
}
开发者ID:georgiee,项目名称:lip-sync-lpc,代码行数:10,代码来源:FormantGrid.cpp

示例15: WordList_upto_SpellingChecker

SpellingChecker WordList_upto_SpellingChecker (WordList me) {
	try {
		autoSpellingChecker thee = Thing_new (SpellingChecker);
		thy wordList = Data_copy (me);
		thy separatingCharacters = Melder_dup (U".,;:()\"");
		return thee.transfer();
	} catch (MelderError) {
		Melder_throw (me, U": not converted to SpellingChecker.");
	}
}
开发者ID:eginhard,项目名称:praat,代码行数:10,代码来源:SpellingChecker.cpp


注:本文中的Data_copy函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。