This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

C5515 eZdsp Buffer Switch problem



Hi,

i'm using c5515 eZdsp in order to acquire a dsbsc modulated signal. My goal is to demodulate the signal.

The signal acquisition is made using ping pong buffer (only input left channel), taken from C5515_Audio_Filter demo code.

My algo is: FFT, frequency ***, IFFT.

The demodulation succeeds, but in the transition from an input buffer from another i have a bad spike that distances my output signal:

in main.c:

while(1)
        if(CurrentRxL_DMAChannel == 2)
        {
                buff_copy(RcvL1,BufferL1,XMIT_BUFF_SIZE);
                dsb_sc_demod(BufferL1);
                buff_copy(BufferL1,&FilterOutL1[0], XMIT_BUFF_SIZE);
        }
        else if(CurrentRxL_DMAChannel == 1)
        {
                buff_copy(RcvL2,BufferL2,XMIT_BUFF_SIZE);
                dsb_sc_demod(BufferL2);
                buff_copy(BufferL2,&FilterOutL2[0], XMIT_BUFF_SIZE);
        }
}

dsb_sc_demod():

void dsb_sc_demod(Int16 *input){
    Uint8 i;
    Uint8 idx;
    const Uint8 iMAX = FFT_LENGTH/2;
    if(freq == FREQ_32)
        idx = CARRIER_32_IDX;
    else
        idx = CARRIER_42_IDX;
    do_fft(input, realL, imagL, 1);
    for(i = 0 ; i < iMAX; i++){
        *(realL + i) = *(realL + i + idx);
        *(imagL + i) = *(imagL + i + idx);
    }
    for (i = 1; i < FFT_LENGTH/2; i++) {
        *(realL + FFT_LENGTH - i) = *(realL + i );
        *(imagL + FFT_LENGTH - i) = -*(imagL + i );
    }
    do_ifft(realL, imagL, input, 0);
}

In the following image you will see a spike:

Do you have any suggestion to avoid this?

Thanks

Paolo