DSPRelated.com
Forums

FFT VS DCT

Started by senthil_lsk April 26, 2007
I see that all are asking why DCT is better than FFT or DFT.
Where FFT is prepered than DCT? Why ? Is it only for phase information?

_____________________________________
Do you know a company who employs DSP engineers?  
Is it already listed at http://dsprelated.com/employers.php ?
senthil_lsk wrote:

> I see that all are asking why DCT is better than FFT or DFT. > Where FFT is prepered than DCT? Why ? Is it only for phase information?
The difference is boundary conditions. FFT (or DFT) has periodic boundary conditions. DST has f(0)=f(L)=0, DCT has f'(0)=f'(L)=0. For image processing the DCT boundary conditions are less noticeable. (There is an explanation in Numerical Recipes, among others.) -- glen
senthil_lsk wrote:
> I see that all are asking why DCT is better than FFT or DFT. > Where FFT is prepered than DCT? Why ? Is it only for phase information?
Who are the "all" that you see? DCT and DFT are each best for some purpose. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
On Thu, 26 Apr 2007 11:51:25 -0800, glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:

>senthil_lsk wrote: > >> I see that all are asking why DCT is better than FFT or DFT. >> Where FFT is prepered than DCT? Why ? Is it only for phase information? > >The difference is boundary conditions. FFT (or DFT) has periodic >boundary conditions. DST has f(0)=f(L)=0, DCT has f'(0)=f'(L)=0. >For image processing the DCT boundary conditions are less noticeable. > >(There is an explanation in Numerical Recipes, among others.) > >-- glen
And then there's the Hartley transform, which uses cas(x)= sin(x) + cos(x) as the basis function. The DHT has some interesting properties of its own and is real-input real-output like the DST and DCT. 7r4n5f0rm5 R fun! Eric Jacobsen Minister of Algorithms Abineau Communications http://www.ericjacobsen.org
On Apr 26, 3:51 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote:
> senthil_lsk wrote: > > I see that all are asking why DCT is better than FFT or DFT. > > Where FFT is prepered than DCT? Why ? Is it only for phase information? > > The difference is boundary conditions. FFT (or DFT) has periodic > boundary conditions. DST has f(0)=f(L)=0, DCT has f'(0)=f'(L)=0. > For image processing the DCT boundary conditions are less noticeable. > > (There is an explanation in Numerical Recipes, among others.) > > -- glen
I've read that the DCT is preferable for data compression applications because it has good energy-compaction properties; that is, when applying the DCT to a signal, a higher ratio of the energy is concentrated in a small number of coefficients relative to the DFT or other similar transforms. Therefore, it's possible to throw away more frequency bins at the DCT output, resulting in better compression. I'm not sure if this is something that is mathematically proven, or if it's just an empirical observation. Jason
It's true if points in the original data have a correlation with their 
neighbors.

Marco
________________________
Marc Reinig
UCO/Lick Observatory
Laboratory for Adaptive Optics

<cincydsp@gmail.com> wrote in message 
news:1177634320.193076.282730@b40g2000prd.googlegroups.com...
> On Apr 26, 3:51 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: >> senthil_lsk wrote: >> > I see that all are asking why DCT is better than FFT or DFT. >> > Where FFT is prepered than DCT? Why ? Is it only for phase information? >> >> The difference is boundary conditions. FFT (or DFT) has periodic >> boundary conditions. DST has f(0)=f(L)=0, DCT has f'(0)=f'(L)=0. >> For image processing the DCT boundary conditions are less noticeable. >> >> (There is an explanation in Numerical Recipes, among others.) >> >> -- glen > > I've read that the DCT is preferable for data compression applications > because it has good energy-compaction properties; that is, when > applying the DCT to a signal, a higher ratio of the energy is > concentrated in a small number of coefficients relative to the DFT or > other similar transforms. Therefore, it's possible to throw away more > frequency bins at the DCT output, resulting in better compression. I'm > not sure if this is something that is mathematically proven, or if > it's just an empirical observation. > > Jason >
cincydsp@gmail.com writes:

> On Apr 26, 3:51 pm, glen herrmannsfeldt <g...@ugcs.caltech.edu> wrote: >> senthil_lsk wrote: >> > I see that all are asking why DCT is better than FFT or DFT. >> > Where FFT is prepered than DCT? Why ? Is it only for phase information? >> >> The difference is boundary conditions. FFT (or DFT) has periodic >> boundary conditions. DST has f(0)=f(L)=0, DCT has f'(0)=f'(L)=0. >> For image processing the DCT boundary conditions are less noticeable. >> >> (There is an explanation in Numerical Recipes, among others.) >> >> -- glen > > I've read that the DCT is preferable for data compression applications > because it has good energy-compaction properties; that is, when > applying the DCT to a signal, a higher ratio of the energy is > concentrated in a small number of coefficients relative to the DFT or > other similar transforms. Therefore, it's possible to throw away more > frequency bins at the DCT output, resulting in better compression. I'm > not sure if this is something that is mathematically proven, or if > it's just an empirical observation.
I've heard this as well. The Wikipedia article http://en.wikipedia.org/wiki/Discrete_cosine_transform seems to have some relevent information on this aspect. -- % Randy Yates % "She's sweet on Wagner-I think she'd die for Beethoven. %% Fuquay-Varina, NC % She love the way Puccini lays down a tune, and %%% 919-577-9882 % Verdi's always creepin' from her room." %%%% <yates@ieee.org> % "Rockaria", *A New World Record*, ELO http://home.earthlink.net/~yatescr
cincydsp@gmail.com wrote:
(I wrote)

>>The difference is boundary conditions. FFT (or DFT) has periodic >>boundary conditions. DST has f(0)=f(L)=0, DCT has f'(0)=f'(L)=0. >>For image processing the DCT boundary conditions are less noticeable.
> I've read that the DCT is preferable for data compression applications > because it has good energy-compaction properties; that is, when > applying the DCT to a signal, a higher ratio of the energy is > concentrated in a small number of coefficients relative to the DFT or > other similar transforms. Therefore, it's possible to throw away more > frequency bins at the DCT output, resulting in better compression. I'm > not sure if this is something that is mathematically proven, or if > it's just an empirical observation.
I don't think you can separate the questions. The usual use is many little DCTs, such as 8 by 8. You then ask about the quality of the compression as you through away some bins. The DCT boundary condition will be less noticeable at block boundaries even with many bins gone. With FFT or FST, many bins will be needed to make up for the boundary mismatch, and so the compression won't be as good. If instead you do the whole image as one large two dimensional FFT, DCT, or DST, I would again not be surprised that you need more bins to make up for the boundary conditions, unless your source data naturally has FFT (periodic) or DST (zero at the edge) boundary conditions. Then you have to determine the quality as bins are discarded to compare them. -- glen
On Apr 27, 12:34 am, Jerry Avins <j...@ieee.org> wrote:
> senthil_lsk wrote: > > I see that all are asking why DCT is better than FFT or DFT. > > Where FFT is prepered than DCT? Why ? Is it only for phase information? > > Who are the "all" that you see? > > DCT and DFT are each best for some purpose. > > Jerry > -- > Engineering is the art of making what you want from things you can get. > =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF This is all about how well one can pack the energy in fewer number of cofficent. DCT pack the energy is fewer number of cofficent as compair to DFT/ FFT. one can easily seen this by just plotting the energy diagram.
kaushal007@gmail.com wrote:
> On Apr 27, 12:34 am, Jerry Avins <j...@ieee.org> wrote: >> senthil_lsk wrote: >>> I see that all are asking why DCT is better than FFT or DFT. >>> Where FFT is prepered than DCT? Why ? Is it only for phase information? >> Who are the "all" that you see? >> >> DCT and DFT are each best for some purpose.
...
> This is all about how well one can pack the energy in fewer number of > cofficent. > DCT pack the energy is fewer number of cofficent as compair to DFT/ > FFT. > one can easily seen this by just plotting the energy diagram.
That depends on the nature of the material being compressed. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;