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.i | |
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.i')
-rw-r--r-- | sms/sms.i | 21 |
1 files changed, 7 insertions, 14 deletions
@@ -31,7 +31,6 @@ %apply(int DIM1, double* INPLACE_ARRAY1) {(int sizeAmp, double* pAmp)}; %apply(int DIM1, double* INPLACE_ARRAY1) {(int sizeMag, double* pMag)}; %apply(int DIM1, double* INPLACE_ARRAY1) {(int sizePhase, double* pPhase)}; -%apply(int DIM1, double* INPLACE_ARRAY1) {(int sizeRes, double* pRes)}; %apply(int DIM1, double* INPLACE_ARRAY1) {(int sizeCepstrum, double* pCepstrum)}; %apply(int DIM1, double* INPLACE_ARRAY1) {(int sizeEnv, double* pEnv)}; %apply(int DIM1, double* INPLACE_ARRAY1) {(int sizeTrack, double* pTrack)}; @@ -39,6 +38,11 @@ %apply(int DIM1, double* IN_ARRAY1) {(int sizeInArray, double* pInArray)}; %apply(int DIM1, double* INPLACE_ARRAY1) {(int sizeOutArray, double* pOutArray)}; %apply(int DIM1, double* INPLACE_ARRAY1) {(int sizeHop, double* pSynthesis)}; +%apply(int DIM1, double* INPLACE_ARRAY1) +{ + (int sizeResidual, double* residual), + (int sizeApprox, double* approx) +} %apply(int DIM1, double* IN_ARRAY1) { (int numamps, double* amps), @@ -504,26 +508,15 @@ { void getResidual(int sizeArray, sfloat *pArray) { - if(sizeArray < $self->residualSize) + if(sizeArray < $self->hopSize) { sms_error("numpy array not big enough"); return; } int i; - for(i = 0; i < $self->residualSize; i++) + for(i = 0; i < $self->hopSize; i++) pArray[i] = $self->residual[i]; } - void getApprox(int sizeArray, sfloat *pArray) - { - if(sizeArray < $self->nCoeffs) - { - sms_error("numpy array not big enough"); - return; - } - int i; - for(i = 0; i < $self->nCoeffs; i++) - pArray[i] = $self->approxEnvelope[i]; - } } %extend SMS_ModifyParams |