Hi,

I need some pointers to which libraries would be most appropriate to use.

I want to use some DFTs and DCTs for processing 1-D real data - I am completely new to the Blackfin architecture so I am trying to work as much as possible in C or with function calls.

For doing the DFT I am managing with the "rfft_fr16" functions in VisualDSP++. The "N" for my data is always a power of 2 and performance is good. However I also need to do a DCT on sets of samples where the buffer size "N" is not a power of 2. Are there any reasonably efficient library functions out there to implement this (or which I could implement using a padded buffer of say N=128)?

The only DCT library I found on analog.com is the one implementing the 8x8 DCT for image compression purposes, namely "r8x8dct.asm" but of course this doesn't handle 1-D data.

If no libraries exist I might have to roll my own function, but of course there are performance concerns there!

Thanks in advance for any hints.

Regards,

N

Hi

Could you please write out the DCT formula in math exactly? Also, is your input to DCT always real?

There are many variants of DCTs. But basically, a DCT can be viewed as a DFT of an even real function. So I suspect that a relatively efficient method to do DCT is to somehow convert the problem into some kind of DFT. Then compute the DFT using the existing library code. Finally get the desired DCT result by taking the appropriate portion of DFT.

Best Regards,

Guolin