Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
ESE 250 – S'12 Kod & DeHon 1
ESE250:
Digital Audio Basics
Week 4
February 2, 2012
Time-Frequency
2
Course Map
Numbers correspond to course weeks
2,5 6
11
13
12
Today
ESE 250 – S'12 Kod & DeHon
ESE 250 – S'12 Kod & DeHon 3
Where Are We Heading After Today? • Week 2
Received signal is o discrete-time-stamped
o quantized
q = PCM[ r ]
= quantL [SampleTs[r] ]
• Week 3 Quantized Signal is
Coded
c =code[ q ]
• Week 4 Sampled signal
o not coded directly
o but rather, “Float” -„ed
o then linearly transformed
o into frequency domain
Q = DFT[ q ]
[Painter & Spanias. Proc.IEEE, 88(4):451–512, 2000]
q
Sample Code Store/
Transmit Decode Produce r(t) p(t)
Generic Digital Signal Processor
q c
c
Q Psychoacoustic Audio Coder
ESE 250 – S'12 Kod & DeHon 4
Teaser: Musical Representation
• With this compact notation Could communicate a sound to pianist
Much more compact than 44KHz time-sample amplitudes (fewer bits to represent)
Represent frequencies
ESE 250 – S'12 Kod & DeHon 5
Week 4: Time-Frequency
• There are other ways to represent Frequency representation particularly efficient
http://en.wikipedia.org/wiki/File:Lead_Sheet.png
t 2.1
t 0
t 2.1
H0 0.6 , 0.6 , 0.6
H1 0.7 , 0 , 0.7
H2 0.4 , 0.8 , 0.4
In this lecture we will learn that the
frequency domain entails
representing time-sampled signals
using a conveniently rotated
coordinate system
ESE 250 – S'12 Kod & DeHon 6
Prelude: Harmonic Analysis • Fourier Transform ( FT )
Fourier (& other 19th Century Mathematicians)
discovered that (real) signals
can always (if they are smooth enough)
be expressed as the sum of harmonics
• Defn: “Harmonics” (Fourier Series) collections of periodic signals (e.g., cos, sin)
whose frequencies are related by integer multiples
arranged in order of increasing frequency
summed in a linear combination
whose coefficients provide
an alternative representation
the job of this
lecture is to
replace this
signals-
analysis
perspective with
a symbols-
synthesis
perspective
ESE 250 – S'12 Kod & DeHon 7
A Sampled (Real) Signal
Sample Data: Sampled Signal: (D e b u g ) O u t[3 7 7 ]=t v
4
5
1
41 5 2 5 5
2
5
1
41 5 10 2 5
0 1
2
5
1
41 5 10 2 5
4
5
1
41 5 2 5 5
ESE 250 – S'12 Kod & DeHon 8
Reconstructing the Sampled Signal • Exact Reconstruction
May be possible
Under the right assumptions
Given the right model
• This example A “harmonic” signal
Sampled in time
Can be reconstructed o exactly
o from the time-sampled values
o given knowledge of the harmonics:
Cos[1t]/p
(5/2)
p(5/2) ¢ Sin[2t]/
p(5/2)
+ =
{ Cos[0t], Sin[1t], Cos[1t], Sin[2t], Cos[2t], Sin[3t], Cos[3t] }
p
(5/2) ¢
ESE 250 – S'12 Kod & DeHon 9
Reconstructing the Sampled Signal • Exact Reconstruction
May be possible
Under the right assumptions
Given the right model
• This example A “harmonic” signal
Sampled in time
Can be reconstructed o exactly
o from the time-sampled values
o given knowledge of the harmonics:
p
(5/2) ¢ Cos[1t]/p
(5/2)
p(5/2) ¢ Sin[2t]/
p (5/2)
+ =
{ Cos[0t], Sin[1t], Cos[1t], Sin[2t], Cos[2t], Sin[3t], Cos[3t] }
ESE 250 – S'12 Kod & DeHon 10
Sequence of Analysis • Given Fundamental frequency: f = 1/2
Sampling Rate: ns = 5
Measured Data:
• Compute “basis” functions
coefficients
• Reconstruct exact function from linear combination of
o “basis elements” (known) o coefficients (computed)
{r(-4/5), r(-2/5), r(02/5) , r(2/5), r(4/5) }
h0(t) = Cos[0t] / p
5 h1s(t) = Sin[1t] /
p (5/2)
h1c(t) = Cos[1t]/ p
(5/2)
h2s(t) = Sin[2t] / p
(5/2)
h2c(t) = Cos[2t]/ p
(5/2)
0
0 p(5/2) p(5/2)
0
r(t) = Cos[t] + Sin[2t] = 0 ¢ h0(t) + 0 ¢ h1s(t) +
p(5/2) ¢ h1c(t)
+ p
(5/2) ¢ h2s(t)
+ 0 ¢ h2c(t)
ESE 250 – S'12 Kod & DeHon 11
Fourier Analysis
Time-Values (D e b u g ) O u t[3 7 7 ]=t v
4
5
1
41 5 2 5 5
2
5
1
41 5 10 2 5
0 1
2
5
1
41 5 10 2 5
4
5
1
41 5 2 5 5
(D e b u g ) O u t[3 8 4 ]=
f A
Cos 0 t 0
Sin t 0
Cos t5
2
Sin 2 t5
2
Cos 2 t 0
Frequency-Amplitudes
FT
(D e b u g ) O u t[3 9 0 ]=
t v
3 0 .1
1 0 .3
0 1 .
1 0 .9
3 1 .8
S
a
m
p
l
e
d
Q
u
a
n
ti
z
e
d
DFT (D e b u g ) O u t[3 9 5 ]=
f A
0 0
1s 0
1c 1.6
2s 1.6
2c 0
(“closed form”)
(computation)
ESE 250 – S'12 Kod & DeHon 12
Reconstruction vs Approximation
• Previous Example received function was “in the span” of the harmonics
reconstruction achieves exact match at all times
• More General Case received function is “close” to the “span”
reconstruction achieves exact match
only at the sampled times
get successively better approximation at all times
o by taking successively more samples
o and using successively higher harmonics
ESE 250 – S'12 Kod & DeHon 13
Another Sampled (Real) Signal
t
v
Sample Data: Sampled Signal:
O u t[2 9 5 ]=
t v6
7
3
281 4 Cos
7Sin
7
4
7
1
142 Sin
7
2
7
1
282 Cos
14
0 0
2
7
1
281 2 Cos
14
4
7
1
141 2 Sin
7
6
7
3
284 Cos
7Sin
7
ESE 250 – S'12 Kod & DeHon 14
• Approximate Reconstruction is always achievable
and more relevant
to our problem
• Example A roughly “harmonic” signal
Sampled in time
Can be approximated
o “arbitrarily” closely
o from the time-sampled values
o using any “good” set of harmonics
Approximating the Sampled Signal
{ Cos[0t], Sin[1t], Cos[1t] , Sin[2t], Cos[2t] , Sin[3t], Cos[3t] }
ESE 250 – S'12 Kod & DeHon 15
Approximate
Reconstruction
(D e b u g ) O u t[3 6 0 ]=
Cos 0 tC o s
1 42 1 3 C o s
7S in
7
7 7
Sin t2 C o s
1 4C o s
3
1 43 S in
7
7 1 4
Cos t1 4 7 5 4 1 1 1 4 1 3 1 4 5 1 5 1 4 1 9 1 4 4 1 1 1 1 4
1 4 1 4
Sin 2 tC o s
1 43 C o s
3
1 42 S in
7
7 1 4
Cos 2 t1 9 1 4 1 2 1 1 7 3 1 2 7 3 1 3 7 2 1 4 7 1 5 7
1 4 1 4
Sin 3 t3 C o s
1 42 C o s
3
1 4S in
7
7 1 4
Cos 3 t1 9 1 4 1 2 1 1 7 3 1 2 7 3 1 3 7 2 1 4 7 1 5 7
1 4 1 4
(Successively Thinner
Green Dashed Curves
Denote Successively
Fewer Harmonic
Components)
Sum up the (black) harmonics using
the (green) coefficients:
ESE 250 – S'12 Kod & DeHon 16
More Harmonics are Better
(D e b u g ) O u t[3 6 9 ]=
Cos 0 t2 C o s
2 23 C s c
2 2S in
1 14 C o s
3
2 2S in
3
2 25 S in
2
1 12 C o s
2
1 1S in
2
1 1
1 1 1 1
Sin t2 0 C s c
2 26 4 C s c
3
2 2C s c
5
2 2S in
1 14 S in
2
1 1
4 4 2 2
Cos t1
1 1
2
1 13 Sin
2 2Sin
1 14 Cos
3
2 2Sin
3
2 2
25 Cos
1 1Sin
2
1 12 Cos
2
1 1
2Sin
2
1 12 Cos
2 2Sin
5
2 24
Cos5
2 2Sin
5
2 2
2
Sin 2 t2 4 C s c
2 21 6 4 C s c
3
2 2C s c
5
2 2S in
1 14 0 S in
2
1 1
8 8 2 2
Cos 2 t3 2 C s c
2 28 2 5 C s c
3
2 2C s c
5
2 2S in
1 12 4 S in
2
1 1
8 8 2 2
Sin 3 t1 6 C s c
2 24 1 0 3 C s c
3
2 2C s c
5
2 2S in
1 13 2 S in
2
1 1
8 8 2 2
Cos 3 t1
1 2 22 6 1
1 1 11
2 1 13 1
3 1 14 1
4 1 14 1
6 1 13 1
7 1 11
8 1 16 1
9 1 12 1
1 0 1 1
2 2 2 2
Sin 4 t3 2 C s c
2 28 2 5 C s c
3
2 2C s c
5
2 2S in
1 12 4 S in
2
1 1
8 8 2 2
Cos 4 t8 C s c
5
2 2S in
1 1C s c
2 2C s c
3
2 2S in
1 12 3 C s c
2
1 1C s c
5
2 2S in
1 11 6 S in
2
1 18 0 S in
3
2 2S in
2
1 1
8 8 2 2
Sin 5 t4 C s c
2 21 0 3 2 C s c
3
2 2C s c
5
2 2S in
1 18 S in
2
1 1
4 4 2 2
Cos 5 t1 1 2 2 1 8 1 1 1 1 6 1 2 1 1 7 1 3 1 1 2 1 4 1 1 2 1 6 1 1 7 1 7 1 1 6 1 8 1 1 8 1 9 1 1 1 1 0 1 1
2 2 2 2
(D e b u g ) O u t[3 6 3 ]=
t v10
11
5
441 2 Sin
2
11
8
11
1
114 Cos
5
22Sin
5
22
6
11
1
443 6 Sin
11
4
11
1
224 Cos
3
22Sin
3
22
2
11
1
444 Cos
2
11Sin
2
11
0 0
2
11
1
441 4 Cos
2
11Sin
2
11
4
11
1
221 4 Cos
3
22Sin
3
22
6
11
3
442 Sin
11
8
11
1
111 2 Cos
22
10
11
5
442 Sin
2
11
7 Samples; 7 Harmonics 11 Samples 15 Samples; 15 Harmonics ; 11 Harmonics
ESE 250 – S'12 Kod & DeHon 17
Usually Computed, Not “Solved” 7 Samples; 7 Harmonics 11 Samples 15 Samples; 15 Harmonics ; 11 Harmonics
(D e b u g ) O u t[3 9 8 ]=
t v
2 .9 0
2 .3 0 .3
1 .7 0 .1
1 .1 0 .4
0 .6 0 .2
0 0
0 .6 0 .1
1 .1 0 .1
1 .7 0 .3
2 .3 0 .9
2 .9 0 .7
DFT
(D e b u g ) O u t[3 9 7 ]=
f A
0 0.4
1s 0.6
1c 0.8
2s 0.3
2c 0.2
3s 0.2
3c 0.4
4s 0.2
4c 0.1
5s 0.2
5c 0
(D e b u g ) O u t[4 0 0 ]=
t v
2 .9 0 .1
2 .5 0 .3
2 .1 0 .2
1 .7 0 .1
1 .3 0 .3
0 .8 0 .3
0 .4 0 .1
0 0
0 .4 0
0 .8 0 .1
1 .3 0
1 .7 0 .3
2 .1 0 .7
2 .5 0 .9
2 .9 0 .7
(D e b u g ) O u t[3 9 9 ]=
f A
0 0.5
1s 0.7
1c 0.9
2s 0.4
2c 0.2
3s 0.2
3c 0.5
4s 0.2
4c 0.2
5s 0.2
5c 0.1
6s 0.2
6c 0
7s 0.1
7c 0
(D e b u g ) O u t[4 0 4 ]=
t v2.7 0.2
1.8 0
0.9 0.3
0 0
0.9 0.1
1.8 0.4
2.7 0.9
(D e b u g ) O u t[4 0 5 ]=
f A
0 0.4
1s 0.5
1c 0.7
2s 0.3
2c 0.2
3s 0.2
3c 0.2
DFT DFT
the “spectrum” is often plotted as a function of frequency
ESE 250 – S'12 Kod & DeHon 18
Yet Another Sampled
(Real) Signal
t
v
Measured Data:
Sampled Signal:
(D e b u g ) O u t[4 2 0 ]=
t v14
15
1
2
4
5
1
2
2
3
1
2
8
15
1
2
2
5
1
2
4
15
1
2
2
15
1
2
01
2
2
15
1
2
4
15
1
2
2
5
1
2
8
15
1
2
2
3
1
2
4
5
1
2
14
15
1
2
ESE 250 – S'12 Kod & DeHon 19
• Approximate Reconstruction although always achievable
may require a lot of samples
to get good performance
from “poorly chosen”
harmonics
• Different “bases” match different “data”
better or worse
(sometimes time is better than
frequency)
Some Signals Dislike
Some Harmonics
15 Samples & Harmonics
21 Samples & Harmonics
31 Samples & Harmonics
ESE 250 – S'12 Kod & DeHon 20
t 2.1
t 0
t 2.1
H0 0.6 , 0.6 , 0.6
H1 0.7 , 0 , 0.7
H2 0.4 , 0.8 , 0.4
Choice of Basis • What is a “harmonic”?
we could have used periodic “pulse trains” o previous signal would be reconstructed exactly
o with one or two pulse-train harmonics
but “sound-like” signals o would typically require a very large number
o of “pulse-train” harmonics
• Fourier Theory (and generalizations) permits very broad choice of harmonics
such choices amount to the selection of a model
• Today‟s Lecture interprets the choice of harmonics
o as a selection of coordinate reference frame
o in the space of received (sampled,quantized) data
lends (geometric) insight to high-dimensional phenomena
introduces arsenal of linear algebraic computation
encourages “learning” data-driven models
ESE 250 – S'12 Kod & DeHon 21
Intuitive Concept Inventory
(D e b u g ) O u t[3 6 9 ]=
Cos 0 t2 C o s
2 23 C s c
2 2S in
1 14 C o s
3
2 2S in
3
2 25 S in
2
1 12 C o s
2
1 1S in
2
1 1
1 1 1 1
Sin t2 0 C s c
2 26 4 C s c
3
2 2C s c
5
2 2S in
1 14 S in
2
1 1
4 4 2 2
Cos t1
1 1
2
1 13 Sin
2 2Sin
1 14 Cos
3
2 2Sin
3
2 2
25 Cos
1 1Sin
2
1 12 Cos
2
1 1
2Sin
2
1 12 Cos
2 2Sin
5
2 24
Cos5
2 2Sin
5
2 2
2
Sin 2 t2 4 C s c
2 21 6 4 C s c
3
2 2C s c
5
2 2S in
1 14 0 S in
2
1 1
8 8 2 2
Cos 2 t3 2 C s c
2 28 2 5 C s c
3
2 2C s c
5
2 2S in
1 12 4 S in
2
1 1
8 8 2 2
Sin 3 t1 6 C s c
2 24 1 0 3 C s c
3
2 2C s c
5
2 2S in
1 13 2 S in
2
1 1
8 8 2 2
Cos 3 t1
1 2 22 6 1
1 1 11
2 1 13 1
3 1 14 1
4 1 14 1
6 1 13 1
7 1 11
8 1 16 1
9 1 12 1
1 0 1 1
2 2 2 2
Sin 4 t3 2 C s c
2 28 2 5 C s c
3
2 2C s c
5
2 2S in
1 12 4 S in
2
1 1
8 8 2 2
Cos 4 t8 C s c
5
2 2S in
1 1C s c
2 2C s c
3
2 2S in
1 12 3 C s c
2
1 1C s c
5
2 2S in
1 11 6 S in
2
1 18 0 S in
3
2 2S in
2
1 1
8 8 2 2
Sin 5 t4 C s c
2 21 0 3 2 C s c
3
2 2C s c
5
2 2S in
1 18 S in
2
1 1
4 4 2 2
Cos 5 t1 1 2 2 1 8 1 1 1 1 6 1 2 1 1 7 1 3 1 1 2 1 4 1 1 2 1 6 1 1 7 1 7 1 1 6 1 8 1 1 8 1 9 1 1 1 1 0 1 1
2 2 2 2
(D e b u g ) O u t[3 6 3 ]=
t v10
11
5
441 2 Sin
2
11
8
11
1
114 Cos
5
22Sin
5
22
6
11
1
443 6 Sin
11
4
11
1
224 Cos
3
22Sin
3
22
2
11
1
444 Cos
2
11Sin
2
11
0 0
2
11
1
441 4 Cos
2
11Sin
2
11
4
11
1
221 4 Cos
3
22Sin
3
22
6
11
3
442 Sin
11
8
11
1
111 2 Cos
22
10
11
5
442 Sin
2
11
11 Samples;
Q = FT(q)
11 Harmonics
Time Domain Frequency Domain
r (received signal)
q Q
ESE 250 – S'12 Kod & DeHon 22
(D e b u g ) O u t[3 9 6 ]=
t v
3 0
2 0 .3
2 0 .1
1 0 .4
1 0 .2
0 0
1 0 .1
1 0 .1
2 0 .3
2 0 .9
3 0 .7
Intuitive Concept Inventory 11 Samples;
Q = DFT(q)
11 Harmonics
Time Domain Frequency Domain
Flo
ating P
oin
t Flo
atin
g P
oin
t
r (received signal)
Sampling & Quantization
q Q
this
week’s
idea
Perceptual coding
(D e b u g ) O u t[3 9 7 ]=
f A
0 0.4
1s 0.6
1c 0.8
2s 0.3
2c 0.2
3s 0.2
3c 0.4
4s 0.2
4c 0.1
5s 0.2
5c 0
ESE 250 – S'12 Kod & DeHon 23
Interlude: Audio Communications
Close Encounters
../../RepositoryMaterial/2010/week4/interlude.close_encouters.avi
ESE 250 – S'12 Kod & DeHon 24
Technical Concept Inventory
• Floating Point Quantization a symbolic representation
admitting a mimic of continuous arithmetic
• Vectors sampled signals are points
in a (high dimensional) vector space
• Linear Algebra the “Swiss Army Knife” of high dimensions
provides a logical, geometric, and computational
toolset for manipulating vectors
• Change of Basis DFT is a high dimensional rotation
in the vector space of time-sampled signals
ESE 250 – S'12 Kod & DeHon 25
Technical Concept Inventory
• Floating Point Quantization a symbolic representation
admitting a mimic of continuous arithmetic
• Vectors sampled signals are points
in a (high dimensional) vector space
• Linear Algebra the “Swiss Army Knife” of high dimensions
provides a logical, geometric, and computational
toolset for manipulating vectors
• Change of Basis DFT is a high dimensional rotation
in the vector space of time-sampled signals
ESE 250 – S'12 Kod & DeHon 26
6 4 2 2 4 6
2
1
1
2
r(t)
q1
q2 q3
q4 q5
Float-Quantized Symbols Act “Real” • q = PCM[ r(t) ] = Float(b,p,E) [SampleTs[r(t)] ]
eliminates continuous time dependence
discretizes continuous values o cannot represent an uncountable collection of functions
o with a countable (of course, in fact, finite!) set of “symbols”
• Floating Point Representation and Computer Arithmetic Choose: Base (b), Precision (p), Magnitude (E)
o q = be ¢ [d0 + d1 ¢ b-1 + … + dp-1 ¢ b
-(p-1)]
o - E · e · E
o 0 < di < b
Non-uniform quantization o bp different “mantissas”
o 2E different exponents
o ~ Log2[2E] + Log2[bp] bits
Associated Flop Arithmetic op 2 { +, -, *, /} [ { Sqrt, Mod, Flint}
) Flop(x,y) = Float[ op(x,y) ]
Archetypal Computation: Inner product o x = (x1, .., xn), y = (y1, … , yn)
o hx,yi = x1¢y1 + x2¢y2 + … + xn¢ yn
Crucially important operation for signal processing applications ! [Widrow, et al., IEEE TIM’96]
ESE 250 – S'12 Kod & DeHon 27
Technical Concept Inventory
• Floating Point Quantization a symbolic representation
admitting a mimic of continuous arithmetic
• Vectors sampled signals are points
in a (high dimensional) vector space
• Linear Algebra the “Swiss Army Knife” of high dimensions
provides a logical, geometric, and computational
toolset for manipulating vectors
• Change of Basis DFT is a high dimensional rotation
in the vector space of time-sampled signals
ESE 250 – S'12 Kod & DeHon 28
• Sampled received signal
• Is a discrete sequence of time-stamped floats
q = (q1, q2, … qns)
= Float( r(T0+Ts), r(T0 + 2Ts), …. , r(T0 + nsTs))
of “real” (i.e. Float‟ed) values
at each of the ns time-stamps
• Think of each of the time-stamps as an “axis”
of “real” (float) values
6 4 2 2 4 6
2
1
1
2
Time Functions
are Vectors
r(t)
q1
q2
q3 q4
q5
ESE 250 – S'12 Kod & DeHon 29
Time Functions
are Vectors • Think of each of the time-
stamps as an “axis” of “real” (float) values
• E.g., for three time stamps, ns = 3, we can record the values
arrange each axis located perpendicular
to the other two in space
mark their values
and interpret them as a vector
t 6.28
t 0.69
t 4.9
t 6.28
t 0.69
t 4.9
ESE 250 – S'12 Kod & DeHon 30
• Think of each of the time-stamps as an “axis” of “real” (float) values E.g., for two time stamps, ns = 2,
o we can draw both axes
o on “graph paper”
… for a greater number of time stamps …
o we can “imagine” arranging each axis
o in a mutually perpendicular direction
o in space of appropriately high dimension
t = - 6.28
t = 2.5
q1
q2 q
b1 b2
Time Functions
are Vectors
ESE 250 – S'12 Kod & DeHon 31
Technical Concept Inventory
• Floating Point Quantization a symbolic representation
admitting a mimic of continuous arithmetic
• Vectors sampled signals are points
in a (high dimensional) vector space
• Linear Algebra the “Swiss Army Knife” of high dimensions
provides a logical, geometric, and computational
toolset for manipulating vectors
• Change of Basis DFT is a high dimensional rotation
in the vector space of time-sampled signals
ESE 250 – S'12 Kod & DeHon 32
Linear Algebra: “Swiss Army Knife” • We cannot “see” in high
dimensions
• Linear Algebra enables us in high dimensions to
reason precisely
think geometrically
compute
• Essential Ideas Basis expansion
Change of basis
Ingredients
o Orthonormality
o Inner Product h ¢ , ¢ i
t = - 6.28
t = 2.5
q1
r(t) q1
q2
BT = { b1 , b2 } = { (1,0), (1,0)}
q2
q = (q1, q2)
= (0.8, - 0.9)
= 0.8 ¢ (1,0) – 0.9 ¢ (1,0)
= 0.8 ¢ b1 + (– 0.9) ¢ b2
= hq,b1i¢ b1 + hq,b2i ¢ b2
= q1 ¢ b1 + q2 ¢ b
2
q
b1 b2
where
hx,yi = x1y1 + x2y2 hq,b1i = 0.8 ¢ 1 + (-0.9) ¢ 0 = 0.8
hq,b2i = 0.8 ¢ 0 + (-0.9) ¢ 1 = - 0.9
(computational definition):
ESE 250 – S'12 Kod & DeHon 33
Linear Algebra: “Swiss Army Knife” • Orthonormal Basis
set of unit length
vectors
each
“perpendicular” to
all the others
total number given
by dimension of the
space
• Inner Product (scaled) cosine of
relative angle
scales unit length
t = - 6.28
t = 2.5
q
b1
b2 q1 = hq,b
1i = Length(q ) ¢ Cos [Å(q,b1)]
Å(q,b1)
Å(q,b2)
q2 = hq,b2i = Length(q ) ¢ Cos [Å(q,b2)]
Generally: hr, si = Length(r) ¢ Length(s) ¢ Cos [Å(r,s)] ) hr, ri = Length(r)2
geometric re-interpretation of computational definition: hx,yi = x1y1 + x2y2
ESE 250 – S'12 Kod & DeHon 34
Technical Concept Inventory
• Floating Point Quantization a symbolic representation
admitting a mimic of continuous arithmetic
• Vectors sampled signals are points
in a (high dimensional) vector space
• Linear Algebra the “Swiss Army Knife” of high dimensions
provides a logical, geometric, and computational
toolset for manipulating vectors
• Change of Basis DFT is a high dimensional rotation
in the vector space of time-sampled signals
ESE 250 – S'12 Kod & DeHon 35
Change of Coordinates
[Google Maps]
Vs.
Independence Hall
500 Chestnut St.
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=19104&sll=37.0625,-95.677068&sspn=31.013085,45.703125&ie=UTF8&hq=&hnear=Philadelphia,+Pennsylvania+19104&ll=39.948964,-75.150647&spn=0.01464,0.022316&z=15&pw=2
ESE 250 – S'12 Kod & DeHon 36
Why Change Basis ?
• Efficiency data sets often lie along
lower dimensional subspaces
Of high dimensional data space
• Decoupling receiver model may
“prefer”
a specific basis
ESE 250 – S'12 Kod & DeHon 37
Linear Algebra: Change of Basis • Goal
Re-express q
In terms of BH
• Notation use new symbol, Q denoting different computational
representation even though vector is geometrically
unchanged
• Check: “good” basis? both unit length?
mutually perpendicular vectors?
• Further geometric Interpretation if old basis is orthonormal
then new basis is also if and only if it is
o A “rotation” o Away from the old
BH = { H1 , H2 }
= { (1/p2 , 1/p2), (- 1/p2 , 1/p2)}
Q
H1 H2
Length(H1)2 = h H1, H1 i = 1/
p (2 ¢ 2) + 1/
p (2 ¢ 2)
= ½ + ½
= 1
Length(H2)2 = h H2, H2 i = 1/
p (2 ¢ 2) + 1/
p (2 ¢ 2)
= ½ + ½
= 1
hH1, H2i = h11 h2
1 + h1
2 h2
2 = - 1/
p 2 ¢ 2 + 1/
p 2 ¢ 2
= 0
t = - 6.28
t = 2.5
b2
b1
ESE 250 – S'12 Kod & DeHon 38
Linear Algebra: Change of Basis • Goal
Re-express q = (q1, q2) o specified by coordinate
representation
o in terms of the old basis, BT
As Q= [Q1, Q2] o Specified by coordinate
representation
o In terms of rotate basis, BH
• Idea: recall geometric meaning
of q = (q1, q2)
o scale b1 by q1 = h b1, q i
o scale b2 by q2 = h b2, q i o form the resultant vector
• Compute Q= [Q1, Q2] using same geometric idea
reveals how to obtain [Q1, Q2]
o scale H1 by Q1 = hq,H1i
o scale H2 by Q2 = hq,H2i
o form the resultant vector
q = (q1, q2) = q1 ¢ b
1 + q2 ¢ b2
= hq, b1i¢ b1 + hq, b2i ¢ b2
) Q1 = hq , H1i =h (0.8, - 0.9), (1/
p2, 1/p
2)i
= (0.8/1.1 - 0.9/1.1) ¼ - 0.11
Q = [Q1, Q2]
= hQ,H1i¢ H1 + hQ,H2i ¢ H2
= hq,H1i¢ H1 + hq,H2i ¢ H2
) Q2 = hq , H2i =h (0.8, - 0.9), (-1/
p2, 1/p
2)i
= - (0.8/1.1 + 0.9/1.1) ¼ - 1.6
t = - 6.28
t = 2.5
b2
b1
Q
H1 H2
- Q2
-Q1
ESE 250 – S'12 Kod & DeHon 39
1 .0
0 .5
0 .0
0 .5
1 .0
t 2.1 , v 0.4
1 .0
0 .5
0 .0
0 .5
1 .0
t 0 , v 0.8
1 .00 .50 .00 .51 .0
t 2.1 , v 0.4
1 .0
0 .5
0 .0
0 .5
1 .0
t 2.1 , v 0.7
1 .0 0 .5 0 .0 0 .5 1 .0
t 0 , v 0
1 .0
0 .5
0 .0
0 .5
1 .0
t 2.1 , v 0.7
Generalize to ns = 3 Samples h0(t) = Cos[0t]/p3
h1(t) = 2 Sin[t]/p3
h2(t) = 2 Cos[t]/p3
1 .0
0 .5
0 .0
0 .5
1 .0
t 2.1 , v 0.6
1 .0 0 .50 .0 0 .5 1 .0
t 0 , v 0.6
1 .0
0 .5
0 .0
0 .5
1 .0
t 2.1 , v 0.6
H0 = Float[ h0(-2/3), h0(0/3), h0(2/3)]
H1 = Float[ h1(-2/3), h1(0/3), h1(2/3)]
H2 = Float[ h2(-2/3), h2(-0/3), h2(2/3)]
The 3-sample DFT:
• take inner products
• of sampled signal
• with each harmonic
ESE 250 – S'12 Kod & DeHon 40
Generalize to ns = 3 Samples h0(t) = Cos[0t]/p3
h1(t) = 2 Sin[t]/p3
h2(t) = 2 Cos[t]/p3 t 2.1
t 0
t 2.1
H0 0.6 , 0.6 , 0.6
H1 0.7 , 0 , 0.7
H2 0.4 , 0.8 , 0.4
ESE 250 – S'12 Kod & DeHon 41
(D e b u g ) O u t[3 9 6 ]=
t v
3 0
2 0 .3
2 0 .1
1 0 .4
1 0 .2
0 0
1 0 .1
1 0 .1
2 0 .3
2 0 .9
3 0 .7
11 Samples;
Q = DFT(q)
11 Harmonics
Time Domain Frequency Domain
Flo
ating P
oin
t Flo
atin
g P
oin
t
r (received signal)
Sampling & Quantization
q Q
this
week’s
idea
Perceptual coding
(D e b u g ) O u t[3 9 7 ]=
f A
0 0.4
1s 0.6
1c 0.8
2s 0.3
2c 0.2
3s 0.2
3c 0.4
4s 0.2
4c 0.1
5s 0.2
5c 0
Generalize to Arbitrary Samples
ESE 250 – S'12 Kod & DeHon 42
… for more understanding…. • Courses
ESE 325 !
(Math 240) ) Math 312 !!!
• Reading Quantization
B. Widrow, I. Kollar, and M. C. Liu. Statistical theory of quantization.
IEEE Transactions on Instrumentation and Measurement, 45(2):353–
361, 1996.
Floating Point
D. Goldberg. What every computer scientist should know about
floating-point arithmetic. ACM Computing Surveys, 23(1), 1991.
Linear Algebra for Frequency Transformations
o G. Strang. The discrete cosine transform. SIAM Review, 41(1):135–
147, 1999
ESE 250 – S'12 Kod & DeHon 43
ESE250:
Digital Audio Basics
End Week 4 Lecture
Time-Frequency