Hi,

I'm trying to create an aliasing free multiplication of two signals.
As far as I remember from my days at the university (long time gone) a multiplication in the time domain can be replaced by / is the same as a convolution in the frequency domain.
And the convolution can help to avoid aliasing.

So for testing I create 2 band limited signals in the frequency domain that don't lead to aliasing when multiplied and converted them to the time domain wit an fft and multiplied them to have a reference.

Then my program does a convolution of the two buffers in the frequency domain with the very raw C++ code below. And everything works fine until one of the buffers contains a signal at the first frequency bin (freq=0).

Probably I've got a big misunderstanding of "convolution in the frequency domain" or even worse - theres just a bug in my convolution code.

Thanks in advance for any help,

Thomas


float * CConvTest::ConvolutionInF(float * pfA, float * pfB, long lSize)
{
memset(m_pFConvDest, 0, lSize * sizeof(float));
for(long ixa = -lSize + 1; ixa < lSize; ixa ++)
{
        float fA = pfA[abs(ixa)];
        for(long ixb = -lSize + 1; ixb < lSize; ixb ++)
        {
                long ixDest = ixa + ixb;
                if(ixDest >= 0 && ixDest < lSize)
                        m_pFConvDest[ixDest] += fA * pfB[abs(ixb)];
        }
}
return m_pFConvDest;
}


--
dupswapdrop -- the music-dsp mailing list and website:
subscription info, FAQ, source code archive, list archive, book reviews, dsp 
links
http://music.columbia.edu/cmc/music-dsp
http://music.columbia.edu/mailman/listinfo/music-dsp

Reply via email to