PRODUCTS
Products Overview
Mathematica
Mathematica Student Edition
Mathematica Home Edition
Wolfram
CDF Player
(free download)
Computable Document Format (CDF)
web
Mathematica
grid
Mathematica
Wolfram
Workbench
Wolfram
SystemModeler
Wolfram
Finance Platform
Mathematica
Add-Ons
Wolfram|Alpha Products
SOLUTIONS
Solutions Overview
Engineering
Aerospace Engineering & Defense
Chemical Engineering
Control Systems
Electrical Engineering
Image Processing
Industrial Engineering
Materials Science
Mechanical Engineering
Operations Research
Optics
Petroleum Engineering
Biotechnology & Medicine
Bioinformatics
Medical Imaging
Finance, Statistics & Business Analysis
Actuarial Sciences
Data Analysis & Mining
Econometrics
Economics
Financial Engineering & Mathematics
Financial Risk Management
Statistics
Software Engineering & Content Delivery
Authoring & Publishing
Interface Development
Software Engineering
Web Development
Science
Astronomy
Biological Sciences
Chemistry
Environmental Sciences
Geosciences
Social & Behavioral Sciences
Design, Arts & Entertainment
Game Design, Special Effects & Generative Art
Education
STEM Education Initiative
Higher Education
Community & Technical College Education
Primary & Secondary Education
Students
Technology
Computable Document Format (CDF)
High-Performance & Parallel Computing (HPC)
See Also: Technology Guide
PURCHASE
Online Store
Other Ways to Buy
Volume & Site Licensing
Contact Sales
Software
Service
Upgrades
Training
Books
Merchandise
SUPPORT
Support Overview
Mathematica
Documentation
Knowledge Base
Learning Center
Technical Services
Community & Forums
Training
Does My Site Have a License?
Wolfram User Portal
COMPANY
About Wolfram Research
News
Events
Wolfram Blog
Partnerships
Employment Opportunities
History of
Mathematica
Stephen Wolfram's Home Page
Contact Us
OUR SITES
All Sites
Wolfram|Alpha
Demonstrations Project
MathWorld
Integrator
Wolfram Functions Site
Mathematica Journal
Wolfram Media
Wolfram
Tones
Wolfram Science
Stephen Wolfram
DOCUMENTATION CENTER SEARCH
User's Guide
Image Transforms
8.4 Discrete Cosine Transform
The discrete cosine transform (DCT) is an important transform in 2D signal processing. It is known to be close to optimal in terms of its energy compaction capabilities and can be computed via a fast algorithm. The DCT is used in two international image/video compression standards, Joint Photographic Experts Group (JPEG), and Motion Picture Experts Group (MPEG) [
Pen90
,
Pen93
].
Transform
Short
DiscreteCosineTransform
[
img
]
DCT[
img
]
discrete cosine transform of
img
InverseDiscreteCosineTransform
[
coef
]
IDCT[
coef
]
inverse discrete cosine transform of
coef
CosineMatrix
[
n
]
returns an
n
×
n
matrix of
n-
point cosine basis sequences
Cosine transform functions.
The 1D discrete cosine transform (1D DCT)
X[k] of a sequence x[n] of length N is defined as
The inverse DCT is defined as
where in both Equations (8.4.1) and (8.4.2)
[k] is defined as
The basis sequences of the 1D DCT are real, discrete-time sinusoids defined by
This loads the package.
In[1]:=
The series form of the 2D discrete cosine transform (2D DCT) pair of formulas is
for k
1
= 0,1,...,N
1
-1 and k
2
= 0,1,...,N
2
-1 and
for n
1
= 0,1,...,N
1
-1 and n
2
= 0,1,...,N
2
-1, with
[k] defined as in Equation (8.4.3). Equation (8.4.6) is called the analysis formula or the forward transform, while Equation (8.4.7) is the synthesis formula or inverse transform. The DCT is separable and so may be computed using 1D DCT row and column operations.
We conclude this section with examples of 1D and 2D DCTs of some simple signals. Consider the following sequence x[n] :
Here is the N=32 point DCT of this sequence.
In[2]:=
Out[2]=
Next, we show the 2D DCT of a box sequence.
This plots the result.
In[3]:=
Out[3]=
Here we demonstrate the DCT magnitude spectrum of an example image.
In[4]:=
Here is the original image and its discrete cosine transform.
In[6]:=
Out[6]=
Particularly note the concentration of large DCT coefficients in the low-frequency zone. The DCT is known to have excellent energy compaction properties.
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.