diff options
author | John Glover <glover.john@gmail.com> | 2011-01-06 11:54:26 +0000 |
---|---|---|
committer | John Glover <glover.john@gmail.com> | 2011-01-06 11:54:26 +0000 |
commit | 0c141d4c9a03d4839e2a8626961bd6bbdd3e7f26 (patch) | |
tree | 33c6f276f0b9ace8d96535f4afb89926ec33e7bc /sms/sms.h | |
parent | 17c5625449888117208447dd4f86504281357013 (diff) | |
download | simpl-0c141d4c9a03d4839e2a8626961bd6bbdd3e7f26.tar.gz simpl-0c141d4c9a03d4839e2a8626961bd6bbdd3e7f26.tar.bz2 simpl-0c141d4c9a03d4839e2a8626961bd6bbdd3e7f26.zip |
Fixed SMSResidual. Also removed blank frames produced by sms at the beginning of analysis which was causing synthesised audio to be out of sync with the original.
Diffstat (limited to 'sms/sms.h')
-rw-r--r-- | sms/sms.h | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -196,15 +196,20 @@ typedef struct typedef struct { int samplingRate; + int hopSize; int residualSize; sfloat *residual; - sfloat *residualWindow; + sfloat *fftWindow; + sfloat *ifftWindow; + sfloat windowScale; sfloat residualMag; sfloat originalMag; int nCoeffs; sfloat *stocCoeffs; int sizeStocMagSpectrum; sfloat *stocMagSpectrum; + sfloat *stocPhaseSpectrum; + sfloat *approx; sfloat *approxEnvelope; sfloat fftBuffer[SMS_MAX_SPEC * 2]; } SMS_ResidualParams; @@ -589,13 +594,17 @@ void sms_arrayScalarTempered(int sizeArray, sfloat *pArray); /* function declarations */ void sms_setPeaks(SMS_AnalParams *pAnalParams, int numamps, sfloat* amps, int numfreqs, sfloat* freqs, int numphases, sfloat* phases); -int sms_findPeaks(int sizeWaveform, sfloat *pWaveform, SMS_AnalParams *pAnalParams, SMS_SpectralPeaks *pSpectralPeaks); +int sms_findPeaks(int sizeWaveform, sfloat *pWaveform, + SMS_AnalParams *pAnalParams, SMS_SpectralPeaks *pSpectralPeaks); int sms_findPartials(SMS_Data *pSmsFrame, SMS_AnalParams *pAnalParams); int sms_findResidual(int sizeSynthesis, sfloat* pSynthesis, int sizeOriginal, sfloat* pOriginal, SMS_ResidualParams *residualParams); -void sms_approxResidual(SMS_ResidualParams *residualParams); -int sms_analyze(int sizeWaveform, sfloat *pWaveform, SMS_Data *pSmsData, SMS_AnalParams *pAnalParams); +void sms_approxResidual(int sizeResidual, sfloat* residual, + int sizeApprox, sfloat* approx, + SMS_ResidualParams *residualParams); +int sms_analyze(int sizeWaveform, sfloat *pWaveform, SMS_Data *pSmsData, + SMS_AnalParams *pAnalParams); void sms_analyzeFrame(int iCurrentFrame, SMS_AnalParams *pAnalParams, sfloat fRefFundamental); int sms_init(); @@ -615,6 +624,8 @@ void sms_getWindow(int sizeWindow, sfloat *pWindow, int iWindowType); void sms_scaleWindow(int sizeWindow, sfloat *pWindow); int sms_spectrum(int sizeWindow, sfloat *pWaveform, sfloat *pWindow, int sizeMag, sfloat *pMag, sfloat *pPhase, sfloat *pFftBuffer); +int sms_spectrumW(int sizeWindow, sfloat *pWaveform, sfloat *pWindow, int sizeMag, + sfloat *pMag, sfloat *pPhase, sfloat *pFftBuffer); int sms_invSpectrum(int sizeWaveform, sfloat *pWaveform, sfloat *pWindow , int sizeMag, sfloat *pMag, sfloat *pPhase, sfloat *pFftBuffer); /* \todo remove this once invSpectrum is completely implemented */ |