+/**
+ * Reconstructs LPC coefficients from the line spectral pair frequencies
+ * and performs bandwidth expansion.
+ *
+ * @param lspf line spectral pair frequencies
+ * @param lpc linear predictive coding coefficients
+ *
+ * @note: bandwidth_expansion_coeff could be precalculated into a table
+ * but it seems to be slower on x86
+ *
+ * TIA/EIA/IS-733 2.4.3.3.5
+ */
+static void lspf2lpc(const float *lspf, float *lpc)
+{
+ double lsp[10];
+ double bandwidth_expansion_coeff = QCELP_BANDWIDTH_EXPANSION_COEFF;
+ int i;
+
+ for (i=0; i<10; i++)
+ lsp[i] = cos(M_PI * lspf[i]);
+
+ ff_acelp_lspd2lpc(lsp, lpc);
+
+ for (i=0; i<10; i++)
+ {
+ lpc[i] *= bandwidth_expansion_coeff;
+ bandwidth_expansion_coeff *= QCELP_BANDWIDTH_EXPANSION_COEFF;
+ }
+}
+