modify sms data More...
#include "sms.h"
Functions | |
void | sms_initModify (SMS_Header *header, SMS_ModifyParams *params) |
initialize a modifications structure based on an SMS_Header | |
void | sms_initModifyParams (SMS_ModifyParams *params) |
initialize modification parameters | |
void | sms_freeModify (SMS_ModifyParams *params) |
free memory allocated during initialization | |
void | sms_interpEnvelopes (int sizeEnv, sfloat *env1, sfloat *env2, float interpFactor) |
linear interpolation between 2 spectral envelopes. | |
void | sms_applyEnvelope (int numPeaks, sfloat *pFreqs, sfloat *pMags, int sizeEnv, sfloat *pEnvMags, int maxFreq) |
apply the spectral envelope of 1 sound to another | |
void | sms_resGain (SMS_Data *frame, sfloat gain) |
scale the residual gain factor | |
void | sms_transpose (SMS_Data *frame, sfloat transpositionFactor) |
basic transposition Multiply the frequencies of the deterministic component by a constant | |
void | sms_transposeKeepEnv (SMS_Data *frame, sfloat transpositionFactor, int maxFreq) |
transposition maintaining spectral envelope | |
void | sms_modify (SMS_Data *frame, SMS_ModifyParams *params) |
modify a frame (SMS_Data object) |
modify sms data
void sms_applyEnvelope | ( | int | numPeaks, | |
sfloat * | pFreqs, | |||
sfloat * | pMags, | |||
int | sizeEnv, | |||
sfloat * | pEnvMags, | |||
int | maxFreq | |||
) |
apply the spectral envelope of 1 sound to another
Changes the amplitude of spectral peaks in a target sound (pFreqs, pMags) to match those in the envelope (pCepEnvFreqs, pCepEnvMags) of another, up to a maximum frequency of maxFreq.
Referenced by sms_modify(), and sms_transposeKeepEnv().
void sms_freeModify | ( | SMS_ModifyParams * | params | ) |
free memory allocated during initialization
params | pointer to parameter structure |
void sms_initModify | ( | SMS_Header * | header, | |
SMS_ModifyParams * | params | |||
) |
initialize a modifications structure based on an SMS_Header
params | pointer to parameter structure | |
header | pointer to sms header |
References SMS_Header::iMaxFreq, SMS_ModifyParams::maxFreq, SMS_Header::nEnvCoeff, SMS_ModifyParams::ready, sfloat, SMS_ModifyParams::sinEnv, SMS_ModifyParams::sizeSinEnv, and sms_error().
void sms_initModifyParams | ( | SMS_ModifyParams * | params | ) |
initialize modification parameters
params | pointer to parameters structure |
References SMS_ModifyParams::doResEnv, SMS_ModifyParams::doResGain, SMS_ModifyParams::doSinEnv, SMS_ModifyParams::doTranspose, SMS_ModifyParams::ready, SMS_ModifyParams::resEnvInterp, SMS_ModifyParams::resGain, SMS_ModifyParams::sinEnvInterp, SMS_ModifyParams::sizeResEnv, SMS_ModifyParams::sizeSinEnv, and SMS_ModifyParams::transpose.
Referenced by sms_initSynthParams().
void sms_interpEnvelopes | ( | int | sizeEnv, | |
sfloat * | env1, | |||
sfloat * | env2, | |||
float | interpFactor | |||
) |
linear interpolation between 2 spectral envelopes.
The values in env2 are overwritten by the new interpolated envelope values.
Referenced by sms_modify().
void sms_modify | ( | SMS_Data * | frame, | |
SMS_ModifyParams * | params | |||
) |
modify a frame (SMS_Data object)
Performs a modification on a SMS_Data object. The type of modification and any additional parameters are specified in the given SMS_ModifyParams structure.
References SMS_ModifyParams::doResGain, SMS_ModifyParams::doSinEnv, SMS_ModifyParams::doTranspose, SMS_ModifyParams::maxFreq, SMS_Data::nEnvCoeff, SMS_Data::nTracks, SMS_Data::pFSinAmp, SMS_Data::pFSinFreq, SMS_Data::pSpecEnv, SMS_ModifyParams::resGain, SMS_ModifyParams::sinEnv, SMS_ModifyParams::sinEnvInterp, SMS_ModifyParams::sizeSinEnv, sms_applyEnvelope(), sms_interpEnvelopes(), sms_resGain(), sms_transpose(), and SMS_ModifyParams::transpose.
void sms_resGain | ( | SMS_Data * | frame, | |
sfloat | gain | |||
) |
scale the residual gain factor
frame | pointer to sms data | |
gain | factor to scale the residual |
References SMS_Data::nCoeff, and SMS_Data::pFStocCoeff.
Referenced by sms_modify().
void sms_transpose | ( | SMS_Data * | frame, | |
sfloat | transpositionFactor | |||
) |
basic transposition Multiply the frequencies of the deterministic component by a constant
References SMS_Data::nTracks, SMS_Data::pFSinFreq, and sms_scalarTempered().
Referenced by sms_modify(), and sms_transposeKeepEnv().
void sms_transposeKeepEnv | ( | SMS_Data * | frame, | |
sfloat | transpositionFactor, | |||
int | maxFreq | |||
) |
transposition maintaining spectral envelope
Multiply the frequencies of the deterministic component by a constant, then change their amplitudes so that the original spectral envelope is maintained
References SMS_Data::nEnvCoeff, SMS_Data::nTracks, SMS_Data::pFSinAmp, SMS_Data::pFSinFreq, SMS_Data::pSpecEnv, sms_applyEnvelope(), and sms_transpose().