Understanding Discrete Cosine Transformation - MathOverflow most recent 30 from http://mathoverflow.net 2013-05-24T17:08:52Z http://mathoverflow.net/feeds/question/110083 http://www.creativecommons.org/licenses/by-nc/2.5/rdf http://mathoverflow.net/questions/110083/understanding-discrete-cosine-transformation Understanding Discrete Cosine Transformation sutr90 2012-10-19T09:16:55Z 2012-12-15T04:22:00Z <p><br> 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.<br> 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.<br><br> I will stick to formula, scavenged from <a href="http://www.cs.cf.ac.uk/Dave/Multimedia/node231.html" rel="nofollow">http://www.cs.cf.ac.uk/Dave/Multimedia/node231.html</a>.</p> <p>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.<br> $i$ is index of particular sample and $f(i)$ it's value.<br> $\Lambda$- well I'm not sure, but it's only a weight coefficient, so it does not affect the principle of the DCT.<br></p> <p>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).<br> 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.<br> <br> So are my conclusions right, or completely off track? Thanks in advance.</p> http://mathoverflow.net/questions/110083/understanding-discrete-cosine-transformation/110124#110124 Answer by Zarken for Understanding Discrete Cosine Transformation Zarken 2012-10-19T23:50:03Z 2012-10-19T23:50:03Z <p>This question would better suit being asked on the dsp stack I believe.</p> http://mathoverflow.net/questions/110083/understanding-discrete-cosine-transformation/110125#110125 Answer by zimbra314 for Understanding Discrete Cosine Transformation zimbra314 2012-10-20T00:50:48Z 2012-10-20T00:50:48Z <p>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:-</p> <p>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). </p> <p>Now, what all frequency it can represent depends on $N$ i.e. number of samples that you take. </p> <p>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.</p>