From d15e78188a9cdbd70640ac57e42d4a598c89b532 Mon Sep 17 00:00:00 2001 From: John Glover Date: Fri, 6 Jul 2012 14:53:01 +0100 Subject: [residual] Add C++ implementation of SMSResidual. --- src/sms/synthesis.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/sms/synthesis.c') diff --git a/src/sms/synthesis.c b/src/sms/synthesis.c index bc739d0..35e91a4 100644 --- a/src/sms/synthesis.c +++ b/src/sms/synthesis.c @@ -195,7 +195,9 @@ void sms_approxResidual(int sizeResidual, sfloat* residual, /* generate random phases */ for(i = 0; i < residualParams->sizeStocMagSpectrum; i++) + { residualParams->stocPhaseSpectrum[i] = TWO_PI * sms_random(); + } /* IFFT with 50% overlap */ sms_invQuickSpectrumW(residualParams->stocMagSpectrum, @@ -208,7 +210,9 @@ void sms_approxResidual(int sizeResidual, sfloat* residual, /* output */ for(i = 0; i < sizeApprox; i++) + { approx[i] = residualParams->approx[i] * residualParams->windowScale; + } } /*! \brief synthesizes one frame of SMS data -- cgit v1.2.3