本文整理汇总了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.");
}
}
}
示例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, ".");
}
}
示例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.");
}
}
示例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).");
}
}
示例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.");
}
}
示例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.");
}
}
示例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.");
}
}
示例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();
}
示例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)");
}
}
示例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.");
}
}
示例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".");
}
}
示例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.");
}
}
示例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.");
}
}
示例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, ".");
}
}
示例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.");
}
}