コード例 #1
0
ファイル: Tube.cpp プロジェクト: georgiee/lip-sync-lpc
void structTube :: v_info () {
	structData :: v_info ();
	MelderInfo_writeLine5 (L"Time domain: ", Melder_double (xmin), L" to ", Melder_double (xmax), L" seconds");
	MelderInfo_writeLine2 (L"Maximum number of segments: ", Melder_integer (maxnSegments));
	MelderInfo_writeLine2 (L"Number of frames: ", Melder_integer (nx));
	MelderInfo_writeLine3 (L"Time step: ", Melder_double (dx), L" seconds");
	MelderInfo_writeLine3 (L"First frame at: ", Melder_double (x1), L" seconds");
}
コード例 #2
0
ファイル: CC.cpp プロジェクト: georgiee/lip-sync-lpc
void structCC :: v_info () {
	structData :: v_info ();
	MelderInfo_writeLine5 (L"Time domain:", Melder_double (xmin), L" to ", Melder_double (xmax), L" seconds");
	MelderInfo_writeLine2 (L"Number of frames: ", Melder_integer (nx));
	MelderInfo_writeLine3 (L"Time step: ", Melder_double (dx), L" seconds");
	MelderInfo_writeLine3 (L"First frame at: ", Melder_double (x1), L" seconds");
	MelderInfo_writeLine2 (L"Number of coefficients: ", Melder_integer (maximumNumberOfCoefficients));
	MelderInfo_writeLine3 (L"Minimum frequency: ", Melder_double (fmin), L" Hz");
	MelderInfo_writeLine3 (L"Maximum frequency: ", Melder_double (fmax), L" Hz");
}
コード例 #3
0
void FileInMemory_showAsCode (FileInMemory me, const wchar_t *name, long numberOfBytesPerLine)
{
	if (numberOfBytesPerLine <= 0) numberOfBytesPerLine = 20;
	// autoNUMvector<unsigned char> data (0, my d_numberOfBytes); ????
	MelderInfo_writeLine5 (L"\t\tstatic unsigned char ", name, L"_data[", Melder_integer (my d_numberOfBytes+1), L"] = {");
	for (long i = 0; i < my d_numberOfBytes; i++) {
		unsigned char number = my d_data[i];
		MelderInfo_write4 ((i % numberOfBytesPerLine == 0 ? L"\t\t\t" : L""), Melder_integer (number), L",",
			((i % numberOfBytesPerLine  == (numberOfBytesPerLine - 1)) ? L"\n" : L" "));
	}
	MelderInfo_writeLine1 ((my d_numberOfBytes - 1) % numberOfBytesPerLine == (numberOfBytesPerLine - 1) ? L"\t\t\t0};" : L"0};");
	MelderInfo_write3 (L"\t\tautoFileInMemory ", name, L" = FileInMemory_createWithData (");
	MelderInfo_writeLine8 (Melder_integer (my d_numberOfBytes), L", reinterpret_cast<const char *> (&", name, L"_data), \n\t\t\tL\"", my d_path, L"\", \n\t\t\tL\"", my d_id, L"\");");
}
コード例 #4
0
ファイル: FFNet.c プロジェクト: alekstorm/tala
static void info (I)
{
	iam (FFNet);
	classData -> info (me);
	MelderInfo_writeLine2 (L"Number of layers: ", Melder_integer (my nLayers));
	MelderInfo_writeLine2 (L"Total number of units: ", Melder_integer (FFNet_getNumberOfUnits (me)));
	MelderInfo_writeLine4 (L"   Number of units in layer ", Melder_integer (my nLayers), L" (output): ",
		Melder_integer (my nUnitsInLayer[my nLayers]));
	for (int i = my nLayers-1; i >= 1; i--)
	{
		MelderInfo_writeLine4 (L"   Number of units in layer ", Melder_integer (i), L" (hidden): ",
			Melder_integer (my nUnitsInLayer[i]));
	}
	MelderInfo_writeLine2 (L"   Number of units in layer 0 (input): ", Melder_integer (my nUnitsInLayer[0]));
	MelderInfo_writeLine2 (L"Outputs are linear: ", Melder_boolean (my outputsAreLinear));
	MelderInfo_writeLine5 (L"Number of weights: ", Melder_integer (my nWeights), L" (", 
		Melder_integer (FFNet_dimensionOfSearchSpace (me)), L" selected)");
	MelderInfo_writeLine2 (L"Number of nodes: ", Melder_integer (my nNodes));
} 
コード例 #5
0
ファイル: Sound.cpp プロジェクト: alekstorm/tala
static void info (I) {
	iam (Sound);
	const double rho_c = 400;   /* rho = 1.14 kg m-3; c = 353 m s-1; [rho c] = kg m-2 s-1 */
	long numberOfSamples = my nx;
	double minimum = my z [1] [1], maximum = minimum;
	classData -> info (me);
	MelderInfo_writeLine3 (L"Number of channels: ", Melder_integer (my ny),
		my ny == 1 ? L" (mono)" : my ny == 2 ? L" (stereo)" : L"");
	MelderInfo_writeLine1 (L"Time domain:");
	MelderInfo_writeLine3 (L"   Start time: ", Melder_double (my xmin), L" seconds");
	MelderInfo_writeLine3 (L"   End time: ", Melder_double (my xmax), L" seconds");
	MelderInfo_writeLine3 (L"   Total duration: ", Melder_double (my xmax - my xmin), L" seconds");
	MelderInfo_writeLine1 (L"Time sampling:");
	MelderInfo_writeLine2 (L"   Number of samples: ", Melder_integer (my nx));
	MelderInfo_writeLine3 (L"   Sampling period: ", Melder_double (my dx), L" seconds");
	MelderInfo_writeLine3 (L"   Sampling frequency: ", Melder_single (1.0 / my dx), L" Hz");
	MelderInfo_writeLine3 (L"   First sample centred at: ", Melder_double (my x1), L" seconds");
	double sum = 0.0, sumOfSquares = 0.0;
	for (long channel = 1; channel <= my ny; channel ++) {
		double *amplitude = my z [channel];
		for (long i = 1; i <= numberOfSamples; i ++) {
			double value = amplitude [i];
			sum += value;
			sumOfSquares += value * value;
			if (value < minimum) minimum = value;
			if (value > maximum) maximum = value;
		}
	}
	MelderInfo_writeLine1 (L"Amplitude:");
	MelderInfo_writeLine3 (L"   Minimum: ", Melder_single (minimum), L" Pascal");
	MelderInfo_writeLine3 (L"   Maximum: ", Melder_single (maximum), L" Pascal");
	double mean = sum / (my nx * my ny);
	MelderInfo_writeLine3 (L"   Mean: ", Melder_single (mean), L" Pascal");
	MelderInfo_writeLine3 (L"   Root-mean-square: ", Melder_single (sqrt (sumOfSquares / (my nx * my ny))), L" Pascal");
	double penergy = sumOfSquares * my dx / my ny;   /* Pa2 s = kg2 m-2 s-3 */
	MelderInfo_write3 (L"Total energy: ", Melder_single (penergy), L" Pascal\u00B2 sec");
	double energy = penergy / rho_c;   /* kg s-2 = Joule m-2 */
	MelderInfo_writeLine3 (L" (energy in air: ", Melder_single (energy), L" Joule/m\u00B2)");
	double power = energy / (my dx * my nx);   /* kg s-3 = Watt/m2 */
	MelderInfo_write3 (L"Mean power (intensity) in air: ", Melder_single (power), L" Watt/m\u00B2");
	if (power != 0.0) {
		MelderInfo_writeLine3 (L" = ", Melder_half (10 * log10 (power / 1e-12)), L" dB");
	} else {
		MelderInfo_writeLine1 (L"");
	}
	if (my nx > 1) {
		for (long channel = 1; channel <= my ny; channel ++) {
			double *amplitude = my z [channel];
			double sum = 0.0;
			for (long i = 1; i <= numberOfSamples; i ++) {
				double value = amplitude [i];
				sum += value;
			}
			double mean = sum / my nx, stdev = 0.0;
			for (long i = 1; i <= numberOfSamples; i ++) {
				double value = amplitude [i] - mean;
				stdev += value * value;
			}
			stdev = sqrt (stdev / (my nx - 1));
			MelderInfo_writeLine5 (L"Standard deviation in channel ", Melder_integer (channel), L": ", Melder_single (stdev), L" Pascal");
		}
	}
}