/Users/richardeakin/projects/libsms/trunk/src/synthesis.c File Reference

main synthesis routines More...

#include "sms.h"
Include dependency graph for synthesis.c:

Functions

static void SineSynthIFFT (SMS_Data *pSmsData, SMS_SynthParams *pSynthParams)
 synthesis of one frame of the deterministic component using the IFFT
void sms_deterministic (SMS_Data *pSmsData, SMS_SynthParams *pSynthParams)
 synthesis of one frame of the deterministic component using the IFFT
static int StocSynthApprox (SMS_Data *pSmsData, SMS_SynthParams *pSynthParams)
 synthesis of one frame of the stochastic component by apprimating phases
int sms_stochastic (SMS_Data *pSmsData, SMS_SynthParams *pSynthParams)
 synthesis of one frame of the residual component, modeled as stochastic, by approximating phases
void sms_synthesize (SMS_Data *pSmsData, sfloat *pFSynthesis, SMS_SynthParams *pSynthParams)
 synthesizes one frame of SMS data

Detailed Description

main synthesis routines


Function Documentation

static void SineSynthIFFT ( SMS_Data pSmsData,
SMS_SynthParams pSynthParams 
) [static]

synthesis of one frame of the deterministic component using the IFFT

Parameters:
pSmsData pointer to SMS data structure frame
pSynthParams pointer to structure of synthesis parameters

References INV_TWO_PI, SMS_SynthParams::iSamplingRate, SMS_Data::nTracks, SMS_SynthParams::pFDetWindow, SMS_Data::pFSinAmp, SMS_Data::pFSinFreq, SMS_Data::pFSinPha, PI_2, SMS_SynthParams::prevFrame, SMS_SynthParams::pSpectra, SMS_SynthParams::pSynthBuff, sfloat, SMS_SynthParams::sizeHop, sms_ifft(), sms_random(), sms_sinc(), sms_sine(), and TWO_PI.

Referenced by sms_synthesize().

Here is the call graph for this function:

void sms_deterministic ( SMS_Data pSmsData,
SMS_SynthParams pSynthParams 
)

synthesis of one frame of the deterministic component using the IFFT

I made this function trying to pull the ifft out of the SineSynthIFFT that part of the code is in the main sms_synthesize function below Next would be sms_stochastic, so they could be summed and synthesized with only one fft, but the problem is that it needs to be 'pre-inverse-windowed' before the stochastic can be summed.

Parameters:
pSmsData pointer to SMS data structure frame
pSynthParams pointer to structure of synthesis parameters

References INV_TWO_PI, SMS_SynthParams::iSamplingRate, SMS_Data::nTracks, SMS_Data::pFSinAmp, SMS_Data::pFSinFreq, SMS_Data::pFSinPha, PI_2, SMS_SynthParams::prevFrame, SMS_SynthParams::pSpectra, sfloat, SMS_SynthParams::sizeHop, sms_random(), sms_sinc(), sms_sine(), and TWO_PI.

Referenced by sms_synthesize().

Here is the call graph for this function:

int sms_stochastic ( SMS_Data pSmsData,
SMS_SynthParams pSynthParams 
)

synthesis of one frame of the residual component, modeled as stochastic, by approximating phases

computes a linearly interpolated spectral envelope to fit the correct number of output audio samples. Phases are generated randomly.

Todo:
needs to be pre-windowed to match the windowing effect of the deterministic, so when they are summed then they can be ifft'ed and overlap-added properly
Parameters:
pSmsData pointer to the current SMS frame
pSynthParams pointer to a strucure of synthesis parameters
Returns:

Todo:
why is it also multiplied by 2? Why aren't the coeffecients just stored with gain already multiplied?

References SMS_SynthParams::iOriginalSRate, SMS_SynthParams::iSamplingRate, SMS_Data::nCoeff, SMS_Data::pFStocCoeff, SMS_Data::pFStocGain, SMS_SynthParams::pMagBuff, SMS_SynthParams::pPhaseBuff, SMS_SynthParams::pSpectra, SMS_SynthParams::sizeHop, sms_PolarToRect(), sms_random(), sms_spectralApprox(), and TWO_PI.

Here is the call graph for this function:

void sms_synthesize ( SMS_Data pSmsData,
sfloat *  pFSynthesis,
SMS_SynthParams pSynthParams 
)

synthesizes one frame of SMS data

Parameters:
pSmsData input SMS data
pFSynthesis output sound buffer
pSynthParams synthesis parameters

<

Todo:
use a comb filter of harmonics to better combine the signal here

References SMS_SynthParams::iDetSynthType, SMS_SynthParams::iSamplingRate, SMS_SynthParams::iStochasticType, SMS_SynthParams::iSynthesisType, SMS_SynthParams::pFDetWindow, SMS_SynthParams::prevFrame, SMS_SynthParams::pSpectra, SMS_SynthParams::pSynthBuff, sfloat, SineSynthIFFT(), SMS_SynthParams::sizeHop, sms_deEmphasis(), SMS_DET_IFFT, sms_deterministic(), sms_ifft(), sms_sineSynthFrame(), SMS_STOC_IFFT, SMS_STYPE_ALL, SMS_STYPE_DET, and StocSynthApprox().

Here is the call graph for this function:

static int StocSynthApprox ( SMS_Data pSmsData,
SMS_SynthParams pSynthParams 
) [static]

synthesis of one frame of the stochastic component by apprimating phases

computes a linearly interpolated spectral envelope to fit the correct number of output audio samples. Phases are generated randomly.

Parameters:
pSmsData pointer to the current SMS frame
pSynthParams pointer to a strucure of synthesis parameters
Returns:
Todo:
cleanup returns and various constant multipliers. check that approximation is ok

References SMS_SynthParams::iOriginalSRate, SMS_SynthParams::iSamplingRate, SMS_Data::nCoeff, SMS_Data::pFStocCoeff, SMS_Data::pFStocGain, SMS_SynthParams::pFStocWindow, SMS_SynthParams::pMagBuff, SMS_SynthParams::pPhaseBuff, SMS_SynthParams::pSynthBuff, SMS_SynthParams::sizeHop, sms_invQuickSpectrumW(), sms_random(), sms_spectralApprox(), and TWO_PI.

Referenced by sms_synthesize().

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Thu Oct 29 04:08:07 2009 for libsms by  doxygen 1.6.1