Professional Documents
Culture Documents
Software For Mathematical Analysis Video Data Compression
Software For Mathematical Analysis Video Data Compression
D.L. Hench
Imaging Systems Application Company
717 E. Rainier
Orange, CA
7141998-2691
Abstract- An important type of software package that Mathematica can perform are. numeric, symbolic,
that belongs in the engineering workplace is a math- and graphical. In symbolic processing, variables rep-
ematical analysis package. Popular packages include resent more than locations to store numbers, so that,
MATLAB, Mathematica, Mathcad and Maple V. y = 2++1 can be solved as = i g - 4 without assigning
The various packages are compared and contrasted a value to c or y .
here with regard to the insight that they can provide
Mathcad provides a unique new way to work with
for a topic of current interest.
formulas, numbers. text and graphs. It allows formulas
The selected topic is cosine-transform data-
compression as specified in the MPEG standard for to be entered using WYSIWYG (what you see is what
video data compression. This problem is f i s t intro- you get). These formulas can either be used for cal-
duced and the outputs of the various packages are culations in a manner as versatile as a spreadsheet or
shown with an emphasis on the insight to the prob- incorporated into documents, eliminating the need for
lem that can be gained by using an approach that is an equation word processor such as T)i$[5], which was
natural to the software package under consideration. used for this paper.
Keywords- MPEG, DCT, MATLAB, Mathematica, Maple V uses the symbolic engine developed by Wa-
Mathcad, Maple V terloo Maple Software Inc. in Ontario, Canada. It in-
cludes libraries for algebra, group theory, linear algebra.
statistics, optimization, number theory, and other areas
1.O INTRODUCTION of mathematics. It is designed for deriving and simpli-
fying formulas.
Software packages for mathematical visualization, The evaluation was carried out on a 486DX computer
data reduction, and even derivation of equations us- with b Mbytes of RAM and running Windows 3.1.
ing symbolic processing are an important part of an I would like to thank: (1) Tom Iiush (508-653-1415)
engineer’s toolkit. These packages include the matrix of the Math Works, Inc. for providing a copy of
oriented MATLAB [l], the symbolic processing oriented the MATLAB EXPO; (2) Jane Rich (217-398-0700) of
Mathematica [2], the simpler “engineering speadsheet” Wolfram Research for supplying an evaluation copy of
oriented Mathcad [3], and symbolic processing oriented Mathematica 2.2 for Windows (enhanced) and the Elec-
Maple V [4]. trical Engineering Pack; (3) Robert Kelly( 800-628-4223
In this paper we will compare and contrast these x792) of MathSoft for providing evaluation copies of
packages in terms of the insight that they provide to Mathcad Plus 5.0 for Windows and Maple V, Release
a subject of current interest in video data compression. 2.
This subject is the application of the Discrete Cosine
Tkansform ( DCT).
2.U ,\IPE;G VIDEOCOMPRESSION
MATLAB [l] is designed as an interactive program
to help with numeric computation and data visualiza-
tion. Fundamentally, MATLAB is built upon a foun- A popular video data compression technique devel-
dation of sophisticated matrix software for analyzing oped for the coded representation of moving pictures
linear systems of equations. The tools springing from and associated audio on digital storage media is spec-
these numerical foundations have proven to be versatile ified by the MPEG-1 standard [6]. MPEG stands for
and useful in engineering, applied mathematics, statis- Motion Picture Expert Group. This standard provides
tical analysis, and finance. This package seenu best VHS qualit1 imager!- using oiily 1.5 Mbit,s/sec. An
suited to the problem at hand and is referenced the MPEG-2 standard [$I is now available which is said
most. to yrovidr broadcast quality at about 5 Mbits/sec. In
Mathematica is a general system for doing mathemal- wiit,rasi. st i c d i o digital imagery conforming to standard
ical computation. The three major types of calculatioiis ( ’( ‘1H ROI ir] at 720+;$60( color) pixels/line by 485 lines
258
using 8 bitslpixel and 30 franies/sec requires about 80 10 tht decoder to produce acceptable encoding. The
F ( u ,U)
1
= -4 C(.)C(U)
z=o
?
cm
?
y=o
Y)
Representing the quantized DCT by FQ and the re-
constructed image by fQ,we have using Eq’s (3 t o 4)
259
Figure 1: MPEG-1 Conipression Applied t,o an Edge
An original 8 pixel x 8 pixel edge image is shown in (a). This edge after reconstruction with q = (1, 2,1} is
shown in (b), (c), and ( d ) respectively.
260
2-
1-
4-
5-
-6-
7-
4-
91 8 1
0 2 4 6
symbolic, and graphical calculation. We will concen- is used where 6 represents the Kronecker 6 which is
trate on the numeric and graphical processing and show unity when the arguments are zero and zero elsewhere.
symbolic processing under Maple V. The result is the basis function T4,5 of Fig 7 (the co-
Mathematica has a full matrix capability and any of efficients there are unit based; here zero based) and is
the previous figures could have been generated in Math- given by
ematica (or in Mathcad). The speed of calculation, even
for 8 by 8 matrices, is noticibly slower than MATLAB f ( z ,y ) = 0.25 * cos( 1 . 1 7 8 1 ~+ 0.58905)
and the syntax is more like a normal programming lan- x cos( 1.5708 + 0.78540) . (13)
guage.
The original function is recovered for f ( 3 , 4 ) . It is
Calculations in Mathematica are organized as “Note-
books” with formulas grouped as cells. A notebook that possible to generate an array of values or to unassign
displays the reconstructed edge of Fig. IC as a 3D plot F1(U. U ) and get a symbolic answer.
is shown in Fig. 6.
7.0 CONCLUSIONS
5.0 MATHCAD
In the author’s opinion you need: ( 1 ) MATLAB if
you wish to do heavy duty number crunching with stan-
A demonstration that T is Hermetian is shown in Fig.
dard mathematics . ( 2 ) Mathematica for general math-
8 using Mathcad. A complete window (MicroSoft Win-
ematics including symbolic manipulation, ( 3 ) Mathcad
dows) is shown with the formatting buttons. Hotkeys
if you wish to include equations and results in reports
can be used for rapid formatting.
and don’t wish to learn an equation word processor like
Mathcad is designed to easily export the information
QX. and ( 4 ) Maple V if you are on the cutting edge
shown here to standard word processors so that mathe-
of equation maupulation and derivation. The list costs
matics can be incorporated in reports. It has a limited
are: ( 1 ) $1.695 for MATLAB for Windows and $400-900
symbolic facility borrowed from Maple V and can im-
per toolbox, ( 2 ) $995 for Mathematica 2.2 (enhanced)
port Maple V data.
($595 standard) for Windows and $195 for the Electri-
cal Engineering Pack. ( 2 ) $299.95 for Mathcad Plus
6.0 MAPLE V 5.0, and ( 3 ) $835 for Maple V release 2 for Windows.
9. Both the DCT and the IDCT are coded with the References
DCT coded in the form of Eq. 1 . A DCT transform of
the form [l] The MATLAB EXPO. The Math Works, Inc., Nat-
F(u,v ) = 6( U - 3. U - 4 ) . (12) ick. MA, 1993.
26 1
Figure 7: Selected Basis Functions
Eight of the 64 basis images for the DCT are shown. These are F12.F147F16vF187F239 F457F673F88 for
a,b,c,d,e,f,g,h respectively.
Ca[~_1:-1f~~--O.l/Surt~2.l,i.i
Tdct=Table[N[0.5 Ca[jlCos~Pi(2.i+l.)j~16.11
(i~O,7)#1j,O,7)1
#
Ilaage=Table~Iftj~0.5+~5./7.)i,63.,191.I,[i,O,7),
( j , 0.71 I
Dct-Transpose[Tdctl.Iaage.Tdct
Imot=Tdct.Dct.Tranepoee[Tdct]
Qn=1(8 .16.19,22.26.27.29,34),
~16.16,22,14.27,29,34,37),
(19.22.26,27.29.34.34,38),
(22,~2.26.27.29.34,37,40),
f22,26,27,29,32,35,40.48),
126.27.29.32.35.40.48.58).
126.27.29.34,38,46,56,69),
(27.29,35.38.46,56,69.83))
Quantize[value-,el:-a Round[value/ql
Coef=Table[
Quantize[
~ t ~ ~ i . j l l . I f [ i = = l . & h j = = 1 . , 8 ,QnIIi.jll
~ 1
I . 1i.1.8). (j,1,8)1
Imot=Tdct.Coef.Transpose[Tdctl
ListPlot3D[Transpose[Imot]]
262
> C:=proc(u) if us0 then llsqrt(2) else 1 fi end;
> DCT:=proc(u,v,f) sum('0.25'C(u)'cos(Pi*(2'x+1 )'u/l6)
> *sum('f(x,y)'C(v)'cos(Pi'(2*y+l )'v/l6)','y'=0..7)'
> ,'x'=O..7) end;
> IDCT:=proc(x,y,F) sum('0.25'C(u)'cos(Pi'(2'x+l)'o/16)
> *sum('F(u,v)'C(v)'cos( Pi'(S*y+l)'v/16)','~'=0..7)'
> ,'u'=O..7) end;
&J J [
T. . :=0.5C:cos n.(2,i+ 11.L
161 ,
York. 1992
263