コード例 #1
0
ファイル: LPC.cpp プロジェクト: Crisil/praat
Matrix LPC_downto_Matrix_rc (LPC me) {
	try {
		autoMatrix thee = Matrix_create (my xmin, my xmax, my nx, my dx, my x1, 0.5, 0.5 + my maxnCoefficients, my maxnCoefficients, 1, 1);
		autoNUMvector<double> rc (1, my maxnCoefficients);
		for (long j = 1; j <= my nx; j++) {
			LPC_Frame lpc = & my d_frames[j];
			NUMlpc_lpc_to_rc (lpc -> a, lpc -> nCoefficients, rc.peek());
			for (long i = 1; i <= lpc -> nCoefficients; i++) {
				thy z[i][j] = rc[i];
			}
		}
		return thee.transfer();
	} catch (MelderError) {
		Melder_throw (me, ": no Matrix with relection coefficients created.");
	}
}
コード例 #2
0
ファイル: LPC.cpp プロジェクト: DsRQuicke/praat
autoMatrix LPC_downto_Matrix_area (LPC me) {
	try {
		autoMatrix thee = Matrix_create (my xmin, my xmax, my nx, my dx, my x1, 0.5, 0.5 + my maxnCoefficients, my maxnCoefficients, 1.0, 1.0);
		autoNUMvector<double> rc (1, my maxnCoefficients);
		autoNUMvector<double> area (1, my maxnCoefficients);
		for (long j = 1; j <= my nx; j++) {
			LPC_Frame lpc = & my d_frames[j];
			NUMlpc_lpc_to_rc (lpc -> a, lpc -> nCoefficients, rc.peek());
			NUMlpc_rc_to_area (rc.peek(), lpc -> nCoefficients, area.peek());
			for (long i = 1; i <= lpc -> nCoefficients; i++) {
				thy z[i][j] = area[i];
			}
		}
		return thee;
	} catch (MelderError) {
		Melder_throw (me, U": no Matrix with areas created.");
	}
}