Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: DCT with sliding window (Read 5188 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

DCT with sliding window

Hello,
perhaps someone can help me on this subject.
I convert an input-stream sample by sample but need to transform for every sample
the last-N samples with a DCT (N is power of 2).
I don't want to calculate the complete DCT for every new sample, because this is
a huge speed penalty.
Is there a possibility to calculate the DCT for example recursive and modify the
actual coefficients in present of the new data?

regards and thanks for any help

DCT with sliding window

Reply #1
Hello,
perhaps someone can help me on this subject.
I convert an input-stream sample by sample but need to transform for every sample
the last-N samples with a DCT (N is power of 2).

Why would you want to do that?
There might be other ways to achieve what you want.

I don't want to calculate the complete DCT for every new sample, because this is
a huge speed penalty.
Is there a possibility to calculate the DCT for example recursive and modify the
actual coefficients in present of the new data?

You need a 2n sample ringbuffer for that where you only store the last n samples and zero the remaining buffer. You gotta compute the DFT on the whole 2n ring buffer (can be done incrementally). From the DFT coefficients you can compute the DCT coeffs. Time complexity: O(n) per sample.

DCT with sliding window

Reply #2
Quote
Why would you want to do that?


i am trying to orthogonalize a simple adaptive filter.
i thought it could be faster than a complete recursive-least-squares-filter.

Quote
You need a 2n sample ringbuffer for that where you only store the last n samples and zero the remaining buffer. You gotta compute the FFT on the whole 2n ring buffer (can be done incrementally). From the FFT coefficients you can compute the DCT coeffs. Time complexity: O(n) per sample.


that was fast! going to implement 

real thanks

DCT with sliding window

Reply #3
i am trying to orthogonalize a simple adaptive filter.
i thought it could be faster than a complete recursive-least-squares-filter.

I don't see why this would be of any help. Then again, adaptive filters are not my specialty.

 

DCT with sliding window

Reply #4
Quote
i am trying to orthogonalize a simple adaptive filter.


that was bs then
the dct is only a step to preprocess and decorrelate the data in the actual history of the filter.

edit: the improved orthogonalization relates to the autocorrelation matrix of the input