## Understanding Discrete Cosine Transformation

### Remember to vote up questions/answers you find interesting or helpful (requires 15 reputation points)

I'm currently working on some software and a key component is 2D DCT. But my question is more general, as I'm trying to understand the DCT in general, let's say from engineers point of view.
For start, I know that there are 8 types of DCT, and that many authors use different notation, sometimes even different parameterization, but that's doesn't matter as I'm not going to implement DCT, I only want to understand it.

I will stick to formula, scavenged from http://www.cs.cf.ac.uk/Dave/Multimedia/node231.html.

DCT is defined as following: $$F(u) = \left ( \frac{2}{N} \right )^\frac{1}{2} \sum_{i=0}^{N-1} \Lambda (i)cos\left [ \frac{\pi\cdot u}{2N}(2i+1) \right ]f(i)$$ $N$ is count of samples.
$i$ is index of particular sample and $f(i)$ it's value.
$\Lambda$- well I'm not sure, but it's only a weight coefficient, so it does not affect the principle of the DCT.

What I'm struggling to understand are values $u$ and $F(u)$. I know that DCT transform data to frequency domain, but I have not found the meaning of this values. My guess is that $u$ is particular frequency and $F(u)$ is amount of this frequency in data, e.g. for signal with 8kHz frequency (for example whistle), the DCT would return $0$ for all values of $u$ and some great value for $u=8000$. (this is an ideal case, I know this is overcast example).
I've also deducted, that maximum frequency in DCT result will be limited by number of samples, e.g. for sound sampled at 44100kHz there won't be any coefficient for frequency higher than 44100kHz, due to Nyquist criterium.

So are my conclusions right, or completely off track? Thanks in advance.

-

Your question would probably fit one of the other sites mentioned in the FAQ. – Douglas Zare Oct 19 at 12:53

## 2 Answers

You're very close. $u$ corresponds to frequency and $|F(u)|$ is frequency content in the signal. Let me explain relation between variable $u$ and the frquency it corresponds to:-

A signal is being sampled at time period of $T_{p}$, then maximum frequency that it can successfully represent is $1/2T_{p}$. Here $f=1/T_{p}$ is sampling rate and that in case of audio signal is 44.1 KHz (so that it can represent 22KHz signal which is close to hearing limit of human ears).

Now, what all frequency it can represent depends on $N$ i.e. number of samples that you take.

Frequency in this case will take discrete values from $0,f/N,2f/N...(N-1)f/N$ and these frequency will correspond to $u=0,1,2,..N-1$. Frequency beyond that will alias back to one those frequencies. And so more number of samples you take you can represent more number of frequency.

-

### You can accept an answer to one of your own questions by clicking the check mark next to it. This awards 15 reputation points to the person who answered and 2 reputation points to you.

This question would better suit being asked on the dsp stack I believe.

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 20, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9541428089141846, "perplexity_flag": "middle"}