Ejemplo n.º 1
0
Ltas Sound_to_Ltas (Sound me, double bandwidth) {
	try {
		autoSpectrum thee = Sound_to_Spectrum (me, TRUE);
		autoLtas him = Spectrum_to_Ltas (thee.peek(), bandwidth);
		double correction = -10.0 * log10 (thy dx * my nx * my dx);
		for (long iband = 1; iband <= his nx; iband ++) {
			his z [1] [iband] += correction;
		}
		return him.transfer();
	} catch (MelderError) {
		Melder_throw (me, ": LTAS analysis not performed.");
	}
}
Ejemplo n.º 2
0
Ltas Sound_to_Ltas (Sound me, double bandwidth) {
	Spectrum thee = NULL;
	Ltas him = NULL;
	long iband;
	double correction;
	thee = Sound_to_Spectrum (me, TRUE); cherror
	him = Spectrum_to_Ltas (thee, bandwidth); cherror
	correction = -10 * log10 (thy dx * my nx * my dx);
	for (iband = 1; iband <= his nx; iband ++) {
		his z [1] [iband] += correction;
	}
end:
	iferror forget (him);
	forget (thee);
	return him;
}