Skip to main content

Questions tagged [dct]

The Discrete Cosine Transform expresses a sequence of finitely many data points in terms of a sum of cosine functions oscillating at different frequencies.

Filter by
Sorted by
Tagged with
22 votes
5 answers
28k views

Fast Cosine Transform via FFT

I want to implement the Fast Cosine Transform. I read on wikipedia, that there is a fast version of the DCT which is similarly computed to the FFT. I tried to read the cited Makhoul* paper, for the ...
Framester's user avatar
  • 321
11 votes
3 answers
12k views

Is this a correct interpretation of the DCT step in MFCC calculation?

This is a continuation of the discussion here. I would comment there, but I don't have 50 rep so I'm asking a new question. Here's how I understand the DCT step in the MFCC calculation process: The ...
orangebanana3's user avatar
107 votes
4 answers
95k views

What is the difference between a Fourier transform and a cosine transform?

In speech recognition, the front end generally does signal processing to allow feature extraction from the audio stream. A discrete Fourier transform (DFT) is applied twice in this process. The first ...
Nate Glenn's user avatar
  • 1,187
17 votes
2 answers
3k views

Could a DCT be used for an audio magnitude spectrum rather than DFT?

From what I understand, the DCT has half the bin size as a DFT of the same size N. The DFT also includes phase information, but often this is not needed when only the magnitude spectrum is desired. ...
Jacob's user avatar
  • 361
8 votes
1 answer
2k views

Can the Walsh Hadamard transform be computed for non power of 2 sizes?

Can the walsh hadamard transform be calculated for odd image block sizes such as 5x5 or 7x7? Most of the examples I've seen are for 4x4 and 8x8? I fear it probably can't from the description I read ...
trican's user avatar
  • 509
0 votes
2 answers
687 views

DCT and mean difference of an image

If we subtract the mean of image from the DCT coefficients of an image what does it signifies? and what type of distribution does it follow? Example in MATLAB: ...
usman's user avatar
  • 63
7 votes
1 answer
1k views

Why is the DFT used for spectrograms rather than the DCT?

Related to Could a DCT be used for an audio magnitude spectrum rather than DFT?, but more on the (audio) spectrogram side of things I've been reading about the DCT (such as from here) and it ...
小太郎's user avatar
  • 171
6 votes
1 answer
203 views

Discrete Cosine Transform (DCT) as the limit of Principal Component Analysis (PCA)

On the Wikipedia article about Discrete cosine transform it is said: For strongly correlated Markov processes, the DCT can approach the compaction efficiency of the Karhunen-Loève transform (which is ...
Weier's user avatar
  • 181
6 votes
1 answer
3k views

Computation of the Inverse DCT (IDCT) Using DCT Or IFFT

Is there a way to compute the inverse discrete cosine transform (type-2) by leveraging either a DCT, FFT, or IFFT algorithm? I have seen ways to compute the DCT using FFTs, and I've seen ways to ...
user2913869's user avatar
6 votes
1 answer
819 views

How does DCT decorrelate images?

I've read in multiple places that DCT decorrelates Toeplitz matrices and images usually have Toeplitz structure. Can you explain with an example how DCT decorrelates a Toeplitz matrix? Example for DFT:...
Nagabhushan S N's user avatar
3 votes
2 answers
2k views

Online DFT Algorithm

I have a discrete audio stream $x$ that needs to be processed in real-time. Specifically, as the each new sample is received, I would like to compute a Fourier transform of the last $n$ samples of the ...
jon_simon's user avatar
  • 185
3 votes
1 answer
581 views

What are the cosine functions in JPEG's DCT-II table?

As I understand it from this video, in a JPEG image an 8x8-pixel block is made up of weighted cosine waves, calculated using DCT-II. There are lots of visualizations of these waves, such as this one ...
JeffThompson's user avatar
2 votes
1 answer
324 views

KLT vs DCT basis restriction error

I want to implement 8x8 DCT and 8x8 KLT matrices to the 8-length vectors of 256x256 Lena image (e.g. each row of image there is 32 vectors 256/8 = 32 and for all rows 256x32 = 8192). I do the eigen ...
sfw monster's user avatar
2 votes
2 answers
1k views

1D DCT matlab code

I was writing MATLAB code to compute 1D DCT of sample y. On computing DCT for y=[0,1,2], code generates coefficient ...
Prabal Devkota's user avatar
2 votes
1 answer
774 views

Why do we use scaling factors in DCT? Are they important?

I don't understand the use of scale factors, why do we need them? Can we not use them or are they essential? The wikipedia page on DCT II shows this: https://en.wikipedia.org/wiki/...
Nicolas du Roy's user avatar
2 votes
2 answers
281 views

How does using DCT help in image compression

I once learnt that the Huffman Encoding is used to rid of redundant information, thus reducing file size. I am not sure how using a DCT, or FFT on an image can help in reducing file size. It does not ...
quantum231's user avatar
1 vote
1 answer
349 views

How can extract the cosine transform formula used for 2D by scipy.fft.dct

For the 1D cosine transform the documentation is clear in here, and I can reproduce it easily: The formula is: $$y_k= 2 \sum_{n=0}^{N-1}x_n \cos \left( \frac{\pi k(2n + 1)}{2N}\right)$$ and here it is ...
Antoni Parellada's user avatar
1 vote
2 answers
2k views

DCT vs DFT why do we need/want phase?

Why do we use complex exponentials in the Fourier transform, why do we want the phase part? As opposed to in DCT where there is no phase and only magnitude? Moreover, what does this phase concretely ...
SheppLogan's user avatar
1 vote
2 answers
101 views

number of cosine waves in DCT

Why is it $N\cdot N$ a sufficient number of cosine waves equal to the size of the image or to a portion of it to describe it (or a portion of it) completely without losing information applying the DCT....
smark's user avatar
  • 13