Finite-Length Discrete Transforms
Orthogonal Transforms
Let x[n] denote a length-N time [k ]with domain sequence denoting the coefficient of its Npoint orthogonal transform. The general form of the orthogonal transform pair is of the form
N1
N 1
n= 0
[ k, n ] [ l,n ] = 1, l=k 0 l k
{ }
x [ k ]=
x [ n ] [ k, n ] , 0 k N 1
The above condition are said to be orthogonal to each other The verification of this equation in book page 200
n= 0
1 x [ n ]= N
N 1
x [ n ] [ k, n ] , 0 k N 1
n= 0
Referred to as the analysis and synthesis equation respectively.
2
The Discrete Transform
Definition - The simplest relation between a length-N sequence x[n], defined for 0nN-1, and its DTFT X(ej) is obtained by uniformly sampling X(ej) on the -axis between 02 at k= 2k/N, 0kN-1
From the definition of the DTFT we thus have
N1 n=0
Note: X[k] is also a length-N sequence in the frequency domain The sequence X[k] is called the discrete Fourier transform (DFT) of the sequence x[n] Using the notation WN= e-j2/N the DFT is usually expressed as:
N1
X [ k ]=
j2k / N
X [ k ]= x [ n ] e
x [ n ] W kn N , 0 k N 1
, 0 k N 1
n=0
The Discrete Transform
The inverse discrete transform (IDFT) is given by
1 x [ n ]= N
N 1
Fourier
Example - Consider the length-N sequence defined for 0 n N-1
kn X [ k ] W N , 0 n N 1
x [ n ]= cos( 2 r n N ) , 0 n N 1
Where is r is an integer in the range 0 n N-1
k= 0
As can be seen from the above expression, the inverse DFT x[n] can be a complex sequence even when the DFT X[k] is real sequence.
Using a trigonometric identity, we can write as
X [k ]
1 j2rn / N j2rn / N x [ n ]= (e +e ) 2 1 rn rn (W +W N N) 2
4
The Discrete Transform
The N-point DFT of g[n] is thus given by
N1
Matrix Relations
The DFT samples defined by
N1
X [ k ]= 1 2
g [ n ] W kn N
N1
n=0
N 1 n= 0
( r k ) n W + N
r+k ) n W (N
n= 0
X [ k ]=
x [ n ] W kNn , 0 k N 1
n=0
0 k N 1
can be expressed in matrix form as
Making use of the identity
N 1
X=DN x
( k ) n W = N
n= 0
N,fork =rN,ran int eger 0, otherwise
Where X is the vector composed of the N DFT samples and x is the vector of N input samples
we get
N / 2, fork=r G [ k ]= N / 2, fork=N r 0 otherwis 0 k N 1
X=[ X [ 0 ] X [ 1 ] X [ N 1 ]]t x=[ x [ 0 ] x [ 1 ] x [ N 1 ]]t
5
The Discrete Transform
and DN is the NN DFT matrix given by
can be expressed in matrix form as
1 x=D N X
DN = 1 1
1 1
1 W1 N W2 N W (NN 1 )
1 W2 N W4 N
( N 1) W2 N
1 W (NN 1 )
( N 1) W2 N
W (NN 1 )
where DN1 is the NN DFT matrix Where
Likewise, the IDFT relation given by
DN = 1
1 1
1 1 W N
2 W N
1 2 W N
4 W N
1
(N1) W N 2( N 1) W N
( N 1) W N
2
( N 1) 2( N 1) 1 W W N N
]
6
1 x [ n ]= N
N 1
kn X [ K ]W N , 0 n N 1
Note
1 D N =
k= 0
1 D N N
Relation Between the DTFT and the DFT and Their Inverses Relation with DTFT
The FT e
jn
of length-N sequence x[n]
j
Numerical Computation of the DTFT using the DFT
A practical approach to the numerical computation of the DTFT of a finite-length sequence.
Let X(ej) be the DTFT of a length-N sequence x[n] We wish to evaluate X(ej) at a dense grid of frequencies k=2k/M, 0kM-1,where M >> N:
X (e )=
N 1 n= 0
n=
x[ n]e
jn
= x [ n ] e jn
limit the extent of the summation to N points and evaluate the continuous function of frequency at N equally spaced points
N 1
X (e
2 =X = k N
( k ) =X k =
x [ n ] e
j2kn / N
n=0
Relation Between the DTFT and the DFT and Their Inverses
X (e
j k
N1
)=
x[ n]e
n=0
jk n
N1
x [ n ] e j2kn/ M
n= 0
Thus is essentially an Mpoint DFT Xe[k] of the length-M sequence xe[n] The DFT Xe[k] can be computed very efficiently using the FFT algorithm if M is an integer power of 2 The function freqz employs this approach to evaluate the frequency response at a prescribed set of frequencies of a DTFT expressed as a rational function in e-j
X (e )
j k
Define a new sequence
x e [ n ]= x [ n ] , 0 n N 1 0, N n M 1
Then
X (e
j k
M1
)=
x e [ n ] e j2kn / M
n= 0
Relation Between the DTFT and the DFT and Their Inverses
DTFT from DFT by Interpolation
The N-point DFT X[k] of a length-N sequence x[n] is simply the frequency samples of its DTFT X(ej) evaluated at N uniformly spaced frequency points Thus
N 1
X ( e j )=
N 1
=k = 2k / N , 0 k N 1
Given the N-point DFT X[k] of a length-N sequence x[n], its DTFT X(ej) can be uniquely determined from X[k]
1 N
n= 0 N 1
1 N
n= 0 N 1
x [ n ] e jn
kn jn X [ k ]W N ]e N 1 j ( 2k / N ) n
k= 0
X [k] e
k= 0
n= 0
S
5.3 Relation Between the DTFT and the DFT and Their Inverses
To develop a compact expression for the sum S, let Hence
r=e
Then
j ( 2k / N )
S= r n
From the above
1 r N 1 e j (N 2k ) S= = 1 r 1 e j [ ( 2k / N ) ] N 2k sin 2 e j [ 2k / N )][( N 1 )/ 2 ] N 2k sin 2N
( (
) )
rS= r n = 1 + r n +r N 1 rn +r N 1 =S+r N 1
Or, equivalently,
Therefore
X ( e j ) 1 N
N 1
S rS= ( 1 r ) S= 1 r
sin X [k] sin
k= 0
( (
N 2k 2 N 2k 2N
) )
e j [ 2k / N ) ][( N 1)/ 2 ]
Relation Between the DTFT and the DFT and Their Inverses
Sampling the Fourier Transform
Consider a sequence x[n] with a DTFT X(ej)
We sample X(ej) at N equally spaced points k=2k/N, 0kN-1 developing the N frequency samples
Thus
j k
Y [ k ] =X ( e
) =X ( e j2k / N ) =
x[ ]e
j2k / N
x [ ] W k N
An IDFT of Y[k] yields
{X ( e j )}
k
y [ n ]=
1 N
N1 k 0
N1
Y [ k ] W Nkn
kn x [ ]W k N WN
These N frequency samples can be considered as an N-point DFT Y[k] whose N- point IDFT is a length-N sequence y[n] now
1 y [ n ]= N
=
k 0 = N 1
1 N
k= 0
x[ ]
W Nk ( n )
X ( e )=
x[ ]e
1 N
N 1 n 0
1, forr=n+mN k ( n r ) = ( W N 0, otherwise
Relation Between the DTFT and the DFT and Their Inverses
we arrive at the desired relation Thus if x[n] is a length-M sequence with MN, then y[n]= x[n] , for 0nN-1 Example 5.6 Let {x[n]}={0 1 2 3 4 5}
y [ n ]=
m=
x [ n+mN ] , 0 n N 1
Thus y[n] is obtained from x[n] by adding an infinite number of shifted replicas of x[n], with each replica shifted by an integer multiple of N sampling instants, and observing the sum only for the interval 0nN-1 To apply
By
sampling its DTFT X(ej) at k=2k/4, 0k3 and then applying a 4-point IDFT to these samples, we arrive at the sequence y[n] given by
0n3
y [ n ]=
m=
x [ n+mN ] , 0 n N 1
y[n]= x[n]+ x[n+4]+x[n-4]
To finite-length sequences, we assume that the samples outside the specified range are zeros
i.e. {y[n]}={4 6 2 3} {x[n]} cannot be recovered from {y[n]}
Circular Convolution
This operation is analogous to linear In computing yL[n] we have assumed that both length-N sequence have convolution, but with a subtle been zero-padded to extend their difference lengths to 2N-1 Consider two length-N sequences, The longer form of y [n] results from L g[n] and h[n], respectively the time-reversal of the sequence h[n] and its linear shift to the right
Their linear convolution results in a length-(2N-1) sequence yL[n] given The first nonzero value of yL[n] is by yL[0]= g[0]h[0] ,and the last nonzero value is
N1
y L [ n ]=
g [ m ] h [ n m ] , 0 n 2N 2
yL[2N-2]= g[N-1]h[N-1]
m=0
Circular Convolution
Definition: To develop a convolution-like operation resulting in a length-N sequence yC[n] , we need to define a circular time-reversal, and then apply a circular time-shift Since the operation defined involves two length-N sequences, it is often referred to as an N-point circular convolution, denoted as
y[n] = g[n] h[n]
Resulting operation, called a circular convolution, is defined by
N1
The circular commutative, i.e.
convolution
is
y C [ n ]=
m=0
g [ m ] h [ n m N ] ,
g[n] h[n] = h[n] g[n]
0 n N 1
5.4 Circular Convolution
The N-point circular convolution can be written in matrix form as
Tabular Method
Consider the evaluation of y[n]= h[n] g[n] where {g[n]} and {h[n]} are length-4 sequences First, the samples of the two sequences are multiplied using the conventional multiplication method as shown on the next slide
[ ][
yC [ 0 ] h[ 0 ] h [ N 1 ] h[ N 2 ] yC [ 1 ] h[ 1 ] h[ 0 ] h [ N 1] h[ 1] h[ 0 ] yC [ 2 ] = h [ 2 ] yC [ N 1 ] h [ N 1 ] h[ N 2] h [ N 3]
h[1] g[ 0] h[ 2 ] g [ 1 ] h[3] g[ 2] h[ 0 ] g [ N 1 ]
][ ]
Note: The elements of each diagonal of the NN matrix are equal
Such a matrix is called a circulant matrix
Circular Convolution
The partial products generated in the 2nd, 3rd, and 4th rows are circularly shifted to the left as indicated above
Circular Convolution
The modified table after circular shifting is shown below
Thus
yc[0]=g[0]h[0]+ g[3]h[1]+ g[2]h[2]+ g[1]h[3] yc[1]=g[1]h[0]+ g[0]h[1]+ g[3]h[2]+ g[2]h[3] yc[2]=g[2]h[0]+ g[1]h[1]+ g[0]h[2]+ g[3]h[3] yc[3]=g[3]h[0]+ g[2]h[1]+ g[1]h[2]+ g[0]h[3] The definition of circular conjugatesymmetric sequence and circular conjugate-antisymmetric sequence.
The samples of the sequence { yc[n]} are obtained by adding the 4 partial products in the column above of each sample
Circular conjugate-symmetry
Circular conjugate-antisymmetry
Classifications of Finite-Length Sequences
Classifications Based on Conjugate Symmetry Any complex length-N sequence x[n] can be expressed as:
For a real sequence x[n], it can be expressed as:
Where, Xcs[n] is its circular conjugate-symmetric part and Xca[n] is its circular conjugate-antisymmetric part, defined by:
Where, Xev[n] is its circular even part and Xca[n] is its circular odd part, defined by:
Classifications of Finite-Length Sequences
Classifications Based on Geometric Symmetry Two types of geometric symmetries are usually defined:For a real
(1) Symmetric sequence
(2) Antisymmetric sequence Type1: Symmetric impulse response with odd length. Type2: Symmetric impulse response Since the length N of a sequence with even length can be either even or odd, four types Type1: Anti-symmetric impulse of geometric symmetry are defined: response with odd length. Type1: Anti-symmetric response with even length. impulse
Classifications of Finite-Length Sequences
Type 1 Symmetry with Odd Length Type 1 symmetric sequence, with N=9, is x[n]= x[0]+ x[1]+ x[2]+ x[3]+ x[4]+ x[5]+ x[6]+ x[7]+ x[8] The Fourier transform is Factoring out e-j4 in the right hand side Taking e-j4 as a common factor in each group of.
Classifications of Finite-Length Sequences
Notice that the quantity inside the braces, { }, is a real function of and can assume positive or negative values in the range 0 The of the sequence is given by () = 4 + where is either 0 or , and hence the phase is a linear function of Type 2 Symmetry with Even Length Similarly, the Fourier transform of Type 2 symmetric sequence, with N=8, can be written.
where the phase is given by
In general, for Type 1 linear-phase sequence of length-N
In general, for Type 2 linear-phase sequence of length-N
Classifications of Finite-Length Sequences
Type 3 Antisymmetry with Odd Length The Fourier transform of Type 3 antisymmetric sequence, with N=9, is (notice that x[4]=0) Multiplying by j=ej/2 and 2, we obtain
which results in
Now, x[0]=-x[8], x[1]=-x[7], x[2]=-x[6], x[3]=-x[5] and x[4]=0 The phase is now The antisymmetry introduces a phase shift of /2
Classifications of Finite-Length Sequences
Type 4 Antisymmetry with Even Length In general, the Fourier transform of Type 3 linear phase antisymmetric sequence of odd length-N is Multiplying by j=ej/2 and 2, we obtain
which results in
Similarly, the Fourier transform of Type 4 linear phase antisymmetric sequence of even length-N is
The phase is now The antisymmetry introduces a phase shift of /2
In both cases, phase shift of /2
j=ej/2 introduces a
DFT Symmetry Relations
In general, the DFT X[k] of a finite sequence x[n] is a sequence of complex numbers and can be expressed as
its DFT can be found as:
X [ k ]= X re [ k ] + j
X im [ k ]
Real and imaginary parts of the DFT sequence can be found as:
Assuming that the original time-domain signal is complex
Therefore, real and imaginary parts of the DFT sequence are:
DFT Symmetry Relations
Symmetry Properties of the DFT of a complex sequence
Symmetry Properties of the DFT of a real sequence
Discrete Fourier Transform Theorems
The DFT satisfies a number of properties that are useful in signal processing. All time domain sequences are assumed to be of length-N with N-point DFT. Circular Frequency Shifting Theorem The inverse DFT of the circularly frequency shifting DFT is given by
Duality Theorem If the N-point DFT of the length-N sequence g[n] is G[k], then
Linearity Theorem Consider a sequence x[n] obtained by a linear combination of g[n] and h[n]
Circular Convolution Theorem The N-point DFT Y[k] of the length Nsequence is given by
Circular Time Shifting Theorem The DFT of the circularly time shifting sequence x[n] is given by
Computation of the DFT of Real Sequence
Modulation Theorem The N-point DFT Y[k] of the length-N product sequence is given by a circulation of their DFTs N-point DFTs of two Real Sequences using a single N-point DFT Let g[n] and h[n] be two length-N real sequences with G[k] and H[k] denoting their respective N-point DFTs These two N-point DFTs can be computed efficiently using a single Npoint DFT Define a complex length-N sequence The inverse DFT of the circularly frequency shifting DFT is given by
Parsevals Theorem The total energy of a length-N sequence g[n] can be computed by summing the square of the absolute values of the DFT.
Let X[k] denote the N-point DFT of x[n]
Note that for 0 k N 1,
Computation of the DFT of Real Sequence
2N-point DFT of a Real Sequence using a single N-point DFT Let v[n] be a length-N real sequence with a 2N-point DFT V[k] Define two length-N real sequences g[n] and h[n] as follows: Thus
Linear Convolution using the DFT Since a DFT can be efficiently implemented using FFT algorithms, it is of interest to develop methods for the implementation of linear convolution using the DFT Let g[n] and h[n] be two finite-length sequences of length N and M, respectively Define two length-L (L = N + M 1) sequences
Let G[k] and H[k] denote their espective N-point DFTs Define a length-N complex sequence
with an N-point DFT X[k]
Thus
Linear Convolution using the DFT
The corresponding implementation scheme is illustrated below Linear Convolution of a Finite-Length Sequence with an infinite Length Sequence Overlap-Add Method We first segment x[n], assumed to be a causal sequence here without any loss of generality, into a set of contiguous finite-length subsequences of length N each:
We next consider implementation of
the
DFT-based
Where
where h[n] is a finite-length sequence of length M and x[n] is an infinite length (or a finite length sequence of length much greater than M)
Thus
where
Linear Convolution using the DFT
The desired linear convolution y[n] = h[n] x[n] is broken up into a sum of infinite number of short-length linear convolutions of length N + M 1 each: ym[n] = h[n] xm[n]
Consider implementing the following convolutions using the DFT-based method, where now the DFTs (and the IDFT) are computed on the basis of (N + M 1) points
In general, there will be an overlap of M 1 samples between the samples of the short convolutions h[n] xr-1[n] and h[n] xm[n] for (r 1)N n rN + M 2
Linear Convolution using the DFT
Therefore, y[n] obtained by a linear convolution of x[n] and h[n] is given by Overlap-Save Method In implementing the overlap-add method using the DFT, we need to compute two (N + M 1)-point DFTs and one (N + M 1)-point IDFT for each short linear convolution It is possible to implement the overall linear convolution by performing instead circular convolution of length shorter than (N + M 1) To this end, it is necessary to segment x[n] into overlapping blocks xm[n], keep the terms of the circular convolution of h[n] with that corresponds to the terms obtained by a linear convolution of h[n] and xm[n], and throw away the other parts of the circular convolution
The above procedure is called the overlap-add method since the results of the short linear convolutions overlap and the overlapped portions are added to get the correct final result
Linear Convolution using the DFT
To understand the correspondence between the linear and circular convolutions, consider a length-4 sequence x[n] and a length-3 sequence h[n] Let yL[n] denote the result of a linear convolution of x[n] with h[n] The six samples of yL[n] are given by If we append h[n] with a single zerovalued sample and convert it into a length-4 sequence he[n], the 4-point circular convolution yC[n] of he[n] and x[n] is given by
Next form
Linear Convolution using the DFT
Or equivalently
Computing the above for m = 0, 1, 2, 3, . . . , and substituting the values of xm[n] we arrive at Then, we reject the first M 1 samples of wm[n] and abut the remaining M M + 1 samples of wm[n] to form yL[n], the linear convolution of h[n] and x[n] If ym[n] denotes the saved portion of wm[n], i.e.,
Linear Convolution using the DFT
The approach is called overlap-save method since the input is segmented into overlapping sections and parts of the results of the circular convolutions are saved and abutted to determine the linear convolution result
Discrete Cosine Transform
In general, the N-point DFT X[k] of length-N real sequence is a complex sequence satisfying the symmetry condition
* X[k] = X kN
The DFT of a real symmetric and antisymmetric finite sequence is a product of a linear phase term and a real amplitude function.
For N even, the DFT samples X[0] and X[N-2]/2 are real and distinct. The remaining N-2 DFT samples are complex and only half of these samples are distinct For N odd, the DFT samples x[0] is real and the remaining N-1 DFT samples are complex, of which only half of these samples are distinct
Orthogonal transform is based on converting an arbitrary sequence into either a symmetric or an anti-symmetric sequence and then extracting the real orthogonal transform coefficients from the DFT, the transform develop via this approach is called discrete cosine transform (DCT)
Discrete Cosine Transform
To develop the expression for the DCT for symmetric periodic sequence, consider type 1 DCT.
let x[n] be a length-N sequence defined for 0nN-1. First, x[n] is extended to a length-2N sequence by zero padding.
{ x[n] } = { a bc d }
then the extracted periodic is given by
x [ n ],0 n N 1 x [ n ] e xe [n] 0 , N n 2 N 1
Next, type-2 symmetric sequence y[n] of length 2N is formed from xe[n] according to
{ y[n] } = { a b cdcb }
To develop the Type-2 DCT, extract y[n] of the symmetric periodic sequence
y [ n ]x [ n ] x [ 2 N 1 n ] e e 0 n 2 N 1
{ y[n] } = { a b c d d c b a }
x [ n ], 0 n N 1 x [ 2 N 1 n ], N n 2 N 1
Discrete Cosine Transform
By making a change of variables, the DFT Y[k] can be expressed as
N1 N1 kn 2 N kn k (2 N1 ) x [ n ] W W , 2 N 2 N n0 kn k/2 kn k/2 x [ n ]W W W W 2 N 2 N 2 N 2 N
The generated sequence satisfies the symmetry property.
y[n]
y [ n ]y [ 2 N 1 n ]
the 2N-point DFT Y[k] of the length2N sequence y[n] is thus
2 N 1 kn Y [ k ] y [ n ] W , 0 n 2 N 1 2 N n 0
Y [ k ]
x [ n ] W
n0
W W
N1 kn 2 N n0
N1 k/2 2 N n0
2 x [ n ]cos
k ( 2 n1 ) , 2 N
0 k 2 N1
The Type-2 N point DCT,
N 1
rewrite
N 1 2 N 1 kn y [ n ] W 2 N, n0 2 N 1 kn x [ 2 N1 n ] W , 2 N n0
Y [ k ]
kn y [ n ] W 2 N n0 N 1 kn x [ n ] W , 2 N n0
X DCT [ k ]=
2x [ n ] cos
n= 0
k ( 2n + 1 ) , 2N
0 k 2N 1
The samples of XDCT[k] are real for real sequence x[n]
0k 2 N1
Discrete Cosine Transform
The inverse discrete cosine transform (IDCT) of an N-point DCT XDCT[k] is given by
N 1 1 k ( 2 n 1 ) x [ n ] [ k ] X [ k ] cos , DCT N 2 N n 0 0 k 2 N 1
In other words, the basis sequence
k ( 2 n1 ) cos 2 N
are orthogonal to each other. To verify that x[n] is indeed the IDCT of XDCT[k]
where 1 / 2 [ k ] 1
k 0 1 kN 1
DCT
a DCT pair may often be denoted as
N 1 N 1 2 l ( 2 n 1 ) k ( 2 n 1 ) X [ k ] [ l ] X [ l ] cos cos DCT DCT N 2 N 2 N n 0l0 N 1 1 l ( 2 n 1 ) k ( 2 n 1 ) 2 [ l ] X [ l ] cos cos DCT N 2 N 2 N l0 l0 N 1
x [ k ] X DCT [ k ]
it can be shown that
N 1 1 k ( 2 n1 ) m ( 2 n1 ) cos cos N 2 N 2 N n0
0 kN 1
The IDCT of an N-point DCT XDCT[k] can also be computed using the DFT
k / 2 W X [ k ] 2 N DCT
1 , k m0 , 1 /2 , k m0 , 0 , k m ,
0 k N 1 k N ,
Y [ k ]0 ,
k / 2 W X [ 2 N k ], N 1 k 2 N 1 , 2 N DCT
Discrete Cosine Transform
The 2N-point IDFT y[n] of Y[k] is given by DCT Properties The DCT satisfies a number of
2 N 1 1 kn y [ n ] y [ k ] W , 0 n 2 N 1 properties that are useful in certain 2 N 2 N k 0 application. Assume all time domain
We get
1 1 N 1 2 N 1 ( n ) k1 ( n ) k 1 2 2 y [ n ] X [ k ] W X [ 2 N k ] W DCT 2 N DCT 2 N 2 N 2 N k 0 k N 1
sequences to be length N with an Npoint DCT. DCT
g [ n ] G [ k ] DCT
DCT
1 1 X [ k ] W X [ k ] W 2 N 2 N
1 2 N 1 ( n ) k 2 DCT 2 N k 0
N 1
1 1 N 1 ( n ) k ( n )( 2 N k ) 2 2 DCT 2 N DCT 2 N k 0 k 1 1 N 1 ( n ) 2 DCT 2 N k 1
h [ n ] H [ k ] DCT
Linearity Property
The DCT XDCT[k] of a sequence obtained by a linear combination of two sequences, g[n] and h[n]. Where and arbitrary constants.
DCT
1 1 X [ k ] W X [ k ] W 2 N 2 N
N 1 X [ 0 ]1 k ( 2 n 1 ) DCT X [ k ] cos DCT 2 NN 2 N k 1 0 n 2 N 1
The length-N IDCT x[n] of the N-point DCT
g [ n ]h [ n ] G [ k ]H [ k ] DCT DCT
x [ n ]y [ n ]0 n N 1
The Haar Transform
Symmetry Properties The DCT of the conjugate sequence is given by
The Haar Transform The discrete-time Haar transform is derived by sampling the continousetime Haar function.
The set of Haar function hl(t) contains N numbers, with N a power-of-2 positive integer: that is N=2v+1, where v 0. In defining the Haar function, the integer subscript l is uniquely represented as a function of two non negative integer variable, r and s.
r l 2 s1
g [ n ] G[ k ]
DCT * DCT
Energy Preservation Property The energy preservation property of the DCT is similar to the persevals relation for the DFT.
N 1
N 1 1 2 | g [ n ] | [ k ] | G [ k ] | DCT 2 N n 0 k 0 2
Where variables r and s have ranges 0 r v; 0 s 2r
The Haar Transform
h ( t )h ( t ) 1 , 0 t1 0 0 , 0
s1 s 0 . 5 2 , t , r r 2 2 . 5 s r/2 s 0 2 t r r 2 2 0 otherwise for 0 t 1
r/2
To derive transform
the
high
order
Haar
H v 2 1
, v 1 . 2 I 1 1
v / 2 v 2
H 1 1 v 2
h t) h t) l( r ,s(
Where denotes the kronecker product and IK is the KK identity. The N-point transform XHaar of length N sequence x[n] is given by
Definition The NN discrete-time Haar transform matrix HN is obtained by discretizing the Haar functions at discrete values of t, given by t = n/N, 0 n N-1 where
h H . x , Haar N
l = 2r + s 1
T
h X [ 0 ] X [ 1 ]... X [ N 1 ] Haar Haar Haar Haar
xx [ 0 ] x [ 1 ]... x [ N 1 ]
T
The Haar Transform
Haar Transform Properties
The inverse Haar transform is give by 1 x H X N Haar
2 2 normalized Haar ransform matrix is given by
Orthogonality Property The Haar transform orthogonal and hence
1 H N
matrix
is
1 1 2 2 x 1 1 2 2 Higher order normalized transform is given by
1 t H N N
Haar transform expression reduced to
x
Haar
1t H X N Haar N
If denote the (k, l)-th element of HN as hN(k,l) then
N 1 1 x [ n ] h ( k , l ) X [ k ] N Haar N k0 0n N 1
H v 2 , n H v1 2 I v 2
1 2 1 2
1 2 1 2
, v0 .
The Haar Transform
Energy conservation property The expression is similar to the Parsevals relation for the DFT also exists for the Haar transform
N 1 2 | x [ n ] | n 0
Consider the energy compaction proper of the DFT, the DCT and the Haar transform. The Discrete Fourier Transform
1 2 | H [ k ] | Haar N k 0
N 1
N-point DFT, the high frequency indices around
Energy Compaction Properties If L samples of the transform with X [ k ], 0 k DFT 2 indices in the range R are set to zero N1 L N1 L with L < < N and if x(m) [n] denotes the ( m ) X [ k ] 0 , k inverse of the modified transform, then DFT 2 2 a measure of the energy compaction N1 L X [ k ], k N1 property DFT
N1 L
N 1 1 ( m ) 2 ( L ) | x [ n ]x [ n ] | N k 0
The Energy Compaction Properties
The original time domain sequence x[n] is obtained by computing the IDFT The original time domain sequence x[n] is obtained by computing the IDCT
1 ( m ) kn X [ n ] X [ k ] W DFT N k 0
( m ) DFT
N 1
1 k ( 2 n 1 ) ( m ) X [ n ] [ k ] X [ k ] cos DCT N 2 N
Hence the approximation error is
N 1 1 ( m ) 2 ( L ) | x [ n ]x [ n ] | DCT N k 0
N 1 L ( m ) DCT k 0
The corresponding error is given by
approximation
N 1 1 ( m ) 2 ( L ) | x [ n ]X [ n ] | DFT N k 0
The Haar Transform The modified Haar transform obtained
The Discrete Cosine Transform
The high frequency samples have high indices and thus the modified DCT obtained
X [ k ]
Haar ( m ) Haar
X [ k ] 0 k N 1 L N L k N 1
The x[n] is obtained by computing the IDCT N 1 L
1 ( m ) x [ n ] h [ k , n ] X [ k ] Haar Haar N k 0
N 1 1 ( m ) 2 ( L ) | x [ n ]x [ n ] | Haar N k 0
X [ k ]
DCT ( m ) DCT
X [ k ] 0 k N 1 L N L k N 1