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
76
votes
4answers
59k 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 ...
15
votes
3answers
18k 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 ...
13
votes
2answers
2k 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. ...
12
votes
1answer
4k views

Relationship between DCT and PCA

I have a basic implementation knowledge of the 2D 8x8 DCT used in image & video compression. Whilst reading about Principle Component Analysis, I can see a lot of similarity, albeit PCA is clearly ...
9
votes
3answers
8k 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 ...
7
votes
2answers
361 views

JPEG steganography

Aside from Jsteg of Derek Upham, Outguess of Neils Provos, and F5 (improvement of F3 and F4) of Pfitzmann and Westfeld, What other methods can you use in information hiding in JPEG images? The ...
7
votes
3answers
898 views

DCT and Hard Thresholding

If I have an Image and i find the DCT and then apply hard thresholding on the coefficients and then IDCT then I have attenuated the noise. Can someone please explain in detail or point me to the ...
7
votes
1answer
1k views

Fast DCT implementation

I'm having trouble figuring out how to follow the fast 8x8 DCT algorithm diagrams found in the following two papers: (1) A Fast Computational Algorithm for the Discrete Cosine Transform by Chen et al....
6
votes
1answer
449 views

Non-orthogonal basis which offers better energy compaction in image compression

I am aware of image-independent basis, i.e. DCT, and image-dependent basis, i.e. Karhunen–Loève, which are used in compacting energies for image compression. These bases are orthorgonal. Are there ...
5
votes
4answers
2k views

Do the DCT coefficients correspond to particular pixels?

Getting the DCT coefficient based on what I've read, is usually done through a matrix, usually 8x8 or 16x16 using these formulas: $$B_{pq}=\alpha_p\alpha_q\sum_{m=0}^{M-1}\sum_{n=0}^{N-1}A_{mn}\cos\...
5
votes
1answer
1k 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 ...
4
votes
4answers
2k views

Why are there only a few high frequency components in the Discrete Cosine Transform?

I am learning about the Discrete Cosine Transform (DCT) and I read somewhere that, in general, images have very few high frequency components. Can someone give me an intuitive explanation for why this ...
4
votes
2answers
11k views

Why zig zag manner scan is used in DCT for image compression?

I am not sure why zig zag manner scan is used in DCT. I can guess that might because it moves from low frequency component to high frequency component and as most of the energy is stored in low ...
3
votes
2answers
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 ...
3
votes
2answers
731 views

Do DCT results contain phase spectrum?

I've been working much with numpy.fft lately where just like the documentation says: When the input a is a time-domain signal and ...
3
votes
1answer
371 views

Determining the resulting pixel value before creating a compressed JPEG image

Is it possible to determine the resulting pixel values and modify them before the compressed jpeg image is actually created? For example, I'm at the stage where I already have the quantized DCT ...
3
votes
1answer
927 views

DCT Steganograhy

I'm trying to implement a simple steganography algorithm (similar to JSteg algorithm) for hiding data in LSB of DCT coefficients in Matlab, and I ran into a problem. a. I apply DCT. b. modify LSB ...
3
votes
1answer
722 views

Illustration of time domain aliasing cancellation (TDAC, MDCT, lapped transform)

Can someone find or make a visual illustration of how time domain aliasing cancellation works in lapped transforms such as the MDCT? I think a graphic would make it a lot easier to understand, and I ...
3
votes
2answers
229 views

Why motion cannot be estimated in DCT domain using block match?

In all video coding standards, motion estimation is always done in pixel domain using block matching. I wonder why it cannot be estimated in DCT(Discrete cosine transform) domain using block matching ...
3
votes
1answer
181 views

Why is the Fourier (or cosine) transform decorrelating?

The discrete Fourier transform (DFT) and the discrete cosine transform (DCT) both decompose a signal into its frequency-domain spectrum. One property that I have seen praised across various domains ...
3
votes
2answers
135 views

How to discard coefficients in the frequency domain without losing too much quality?

I was reading a text that shows that one can throw away 66% of the coefficients and gets an image that is still acceptable. I tried to replicate it using python (last example) and selectively ...
3
votes
1answer
352 views
3
votes
1answer
337 views

FFTW: Logical array size in r2r transform?

I'm taking a multidimensional discrete cosine transform (FFTW_REDFT11) in FFTW, and am unsure how to compute the scaling factor. According to the documentation, ...
3
votes
2answers
1k views

Conversion between DCT to DFT frequency domains

It is well known that the DFT can be interpreted as a filter bank. The same can be done for the DCT, for instance Fig. 3.29, pag. 129 in [1] shows a plot of the frequency response of a DCT filter bank....
3
votes
1answer
145 views

Recursive DCT implementation

I am trying to understand the recursive implementation of the DCT on the input signal (used for LMS filtering) according to the pictures below. The pictures and formulas are taken from the paper: "...
2
votes
3answers
1k views

What does the negative sign mean in the image frequency domain?

When I transform an image from the spatial domain to the frequency domain, some frequencies are negative. What is the meaning of the negative sign? For example:
2
votes
1answer
202 views

Understanding the DCT

I have been trying to understand the definition of the DCT and found a really good website describing its definition. Here is the link DCT. What I don't understand is the part of the DFT. Why is the ...
2
votes
2answers
177 views

Data representation of largest DCT coefficients

In many examples of data compression, we take the S largest coefficients of a signal in a sparse basis (eg. 1% of largest DCT coefficients) and set the rest to zero. How do we practically represent ...
2
votes
3answers
707 views

Difference between compressive sensing and DCT-based compression?

I am working on transmitting EEG signals over wireless body area network. I have applied two different compression techniques: DCT-based and compressive sensing (CS-based) approach. I noticed that the ...
2
votes
2answers
289 views

DCT: Alternatives to quantization

When using the discrete cosine transform are there commonly used alternatives to quantization to decide which dct components to keep/are important? If not, how do people come up with quantization ...
2
votes
1answer
638 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 ...
2
votes
1answer
1k views

DCT of 4x4 checkerboard matrix - what's the correct result?

I'm trying to work out what the correct solution is for a DCT of a 4x4 checkerboard matrix (let's call it A) and for a matrix of ones (let's call it B). So A is: ...
2
votes
1answer
78 views

What are the cosine functions in JPEG's DCTII 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 DCTII. There are lots of visualizations of these waves, such as this one ...
2
votes
1answer
2k views

discrete cosine transformation (dct-II) own implementation with loops

I want to implement the DCT-2, the dctmtx: $$X[k] = \sum_\limits{n=0}^{N-1} x[n] \,\cos \left(\frac{\pi}{N} \left(n+\tfrac12 \right)k \right) ~~~,~~ \;k=0,1, \dots N-1$$ ...
2
votes
1answer
255 views

Need help implementing DCT Type 4 algorithm

I'm trying to implement Algorithm 2 from this paper: Xuancheng Shao and Steven G. Johnson: Type-IV DCT, DST, and MDCT algorithms with reduced numbers of arithmetic operations, https://arxiv.org/...
2
votes
1answer
2k views

How to find first 25 coefficients of DCT in Matlab?

I need first $25 \times 25$ coefficients of DCT to encrypt an image in Matlab. How do I obtain them ? I used this code to compute DCT of an image : ...
2
votes
2answers
676 views

What is the DCT used for in Computer Vision?

DCT, what is the benefit of using it for image processing? I noticed that it is used in JPEG compression. Can i use it for something else? Is it useful for motion detection? Is it useful for ...
2
votes
2answers
1k views

Why would you use DCT as oppose to DFT for detecting oscillation in a signal?

For my project, I needed to detect the primary oscillation frequency in a signal data. As I googled around, it turns out that DCT is the best tool to find this (http://www.mech.pku.edu.cn/robot/...
2
votes
1answer
162 views

Is discrete cosine transform differentiable?

Is DCT differentiable? I.e. is $\frac{\mathrm{d}\mathrm{DCT}(x)}{\mathrm{d} x}$ defined? I've seen a few implementations in automatic differentiation software packages, so I suppose the answer is ...
2
votes
1answer
132 views

Which of DFT, DCT and DWT transforms is more robust to noise and geometric transformations in image processing [closed]

I am currently studying about image watermarking and I have been testing these 3 domains to embed the watermark at. My question is, how do these domains hold up to noise addition or geometric ...
2
votes
1answer
97 views

How to zoom an image using DCT transform

I am familiar with zoom using fourrier transform on an Image. I am also aware that DCT is used mainly to compress images. Meanwhile, how can someone use this transform to zoom an image?
2
votes
1answer
234 views

In 1D DCT, why is the input a vector?

The question is specific to this document: Image Compression. It is chapter 6 from book "A First Course in Applied Mathematics" by Jorge Rebaza. It is, a to the point explaination of DCT that is ...
2
votes
1answer
330 views

Is there a way to evaluate block size when doing image processing or video processing

I am currently doing foreground segmentation in image sequences. A DCT 8 by 8 feature is extracted for each pixel. Now i want to explore dynamic block size for different scenes. Is there any rules ...
2
votes
0answers
199 views

How to iplement fast DCT-III (for inverse of DCT-II) using FFT or iFFT

I have to implement DCT-II and its inverse which is equivalently given by a forward DCT-III. All from real to real. I have been checking some paper where it is specified how to do it. However, I ...
1
vote
2answers
652 views

Why discrete cosine transform may not maintain locality

In paper Convolutional neural network for speech recognition, they say I didn't understand the highlighted sentence.
1
vote
1answer
52 views

validation of a pseudo jpeg compression

I've done something which is not exactly the jpeg algorithm. What I've done is that given an image $I$ of $N\times N$ size, I have computed the DCT of individual $8\times 8$ blocks. Once this has ...
1
vote
1answer
1k views

Why Wavelet based Transform Is More Suitable for Image Compression Compared to DCT?

Everyone knows that JPEG2000 can obtain much better compression result than JPEG. The fundamental transform behind JPEG2000 is wavelet while the basic transform in JPEG is DCT. So my question is why ...
1
vote
2answers
132 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 ...
1
vote
1answer
800 views

High energy coefficients in 1d DCT for audio

I've been reading a little bit about how DCT works in image compression using the 2D transform, however I don't know how this applies to audio using a 1D transform. Suppose I have an audio segment, I ...
1
vote
1answer
87 views

Why do we quantize high frequencies coarsely, shouldn't it be the opposite?

Also, in Huffman Coding, why do we use fewer bits for high frequency data. I don't get the intuition. Shouldn't it be the opposite or does this have to do something with the psychoacoustic model of ...