3: Discrete Cosine Transform

Post on 11-Sep-2021

12 views 0 download

transcript

3: Discrete Cosine Transform

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 1 / 14

DFT Problems

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 2 / 14

For processing 1-D or 2-D signals (especially coding), a common method isto divide the signal into “frames” and then apply an invertible transform toeach frame that compresses the information into few coefficients.

The DFT has some problems when used for this purpose:

DFT Problems

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 2 / 14

For processing 1-D or 2-D signals (especially coding), a common method isto divide the signal into “frames” and then apply an invertible transform toeach frame that compresses the information into few coefficients.

The DFT has some problems when used for this purpose:

• N real x[n]↔N complex X[k] : 2 real, N2 − 1 conjugate pairs

DFT Problems

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 2 / 14

For processing 1-D or 2-D signals (especially coding), a common method isto divide the signal into “frames” and then apply an invertible transform toeach frame that compresses the information into few coefficients.

The DFT has some problems when used for this purpose:

• N real x[n]↔N complex X[k] : 2 real, N2 − 1 conjugate pairs

• DFT ∝ the DTFT of a periodic signal formed by replicating x[n] .

DFT Problems

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 2 / 14

For processing 1-D or 2-D signals (especially coding), a common method isto divide the signal into “frames” and then apply an invertible transform toeach frame that compresses the information into few coefficients.

The DFT has some problems when used for this purpose:

• N real x[n]↔N complex X[k] : 2 real, N2 − 1 conjugate pairs

• DFT ∝ the DTFT of a periodic signal formed by replicating x[n] .⇒ Spurious frequency components from boundary discontinuity.

N=20f=0.08

DFT Problems

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 2 / 14

For processing 1-D or 2-D signals (especially coding), a common method isto divide the signal into “frames” and then apply an invertible transform toeach frame that compresses the information into few coefficients.

The DFT has some problems when used for this purpose:

• N real x[n]↔N complex X[k] : 2 real, N2 − 1 conjugate pairs

• DFT ∝ the DTFT of a periodic signal formed by replicating x[n] .⇒ Spurious frequency components from boundary discontinuity.

N=20f=0.08

The Discrete Cosine Transform (DCT) overcomes these problems.

DCT +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 3 / 14

To form the Discrete Cosine Transform (DCT), replicate x[0 : N − 1] but inreverse order and insert a zero between each pair of samples:

0 12 23

y[r]

Take the DFT of length 4N real, symmetric, odd-sample-only sequence.

DCT +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 3 / 14

To form the Discrete Cosine Transform (DCT), replicate x[0 : N − 1] but inreverse order and insert a zero between each pair of samples:

0 12 23

y[r]

Take the DFT of length 4N real, symmetric, odd-sample-only sequence.Result is real, symmetric and anti-periodic:

012

23

Y[k]

DCT +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 3 / 14

To form the Discrete Cosine Transform (DCT), replicate x[0 : N − 1] but inreverse order and insert a zero between each pair of samples:

0 12 23

y[r]

Take the DFT of length 4N real, symmetric, odd-sample-only sequence.Result is real, symmetric and anti-periodic: only need first N values

012

23

Y[k]

÷2−→

DCT +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 3 / 14

To form the Discrete Cosine Transform (DCT), replicate x[0 : N − 1] but inreverse order and insert a zero between each pair of samples:

0 12 23

y[r]

Take the DFT of length 4N real, symmetric, odd-sample-only sequence.Result is real, symmetric and anti-periodic: only need first N values

012

23

Y[k]

÷2−→

Forward DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N for k = 0 : N − 1

DCT +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 3 / 14

To form the Discrete Cosine Transform (DCT), replicate x[0 : N − 1] but inreverse order and insert a zero between each pair of samples:

0 12 23

y[r]

Take the DFT of length 4N real, symmetric, odd-sample-only sequence.Result is real, symmetric and anti-periodic: only need first N values

012

23

Y[k]

÷2−→

Forward DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N for k = 0 : N − 1

Inverse DCT: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

DCT basis functions: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

DCT basis functions: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

DCT basis functions: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

DCT basis functions: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

DCT basis functions: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

DCT basis functions: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

Basis Functions

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 4 / 14

DFT basis functions: x[n] = 1N

∑N−1k=0 X[k]ej2π

kn

N

DCT basis functions: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

DCT of sine wave

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 5 / 14

DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

DCT of sine wave

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 5 / 14

DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

f = mN

x[n]N=20f=0.10

DCT of sine wave

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 5 / 14

DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

f = mN

x[n]N=20f=0.10

|XF [k]|

DCT of sine wave

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 5 / 14

DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

f = mN

f 6= mN

x[n]N=20f=0.10

N=20f=0.08

|XF [k]|

DCT of sine wave

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 5 / 14

DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

f = mN

f 6= mN

x[n]N=20f=0.10

N=20f=0.08

|XF [k]|

DCT of sine wave

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 5 / 14

DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

f = mN

f 6= mN

x[n]N=20f=0.10

N=20f=0.08

|XF [k]|

DFT: Real→Complex; Freq range [0, 1]; Poorly localized unlessf = m

N; |XF [k]| ∝ k−1 for Nf < k ≪ N

2

DCT of sine wave

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 5 / 14

DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

f = mN

f 6= mN

x[n]N=20f=0.10

N=20f=0.08

|XF [k]|

|XC [k]|

DFT: Real→Complex; Freq range [0, 1]; Poorly localized unlessf = m

N; |XF [k]| ∝ k−1 for Nf < k ≪ N

2

DCT of sine wave

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 5 / 14

DCT: XC [k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

f = mN

f 6= mN

x[n]N=20f=0.10

N=20f=0.08

|XF [k]|

|XC [k]|

DFT: Real→Complex; Freq range [0, 1]; Poorly localized unlessf = m

N; |XF [k]| ∝ k−1 for Nf < k ≪ N

2DCT: Real→Real; Freq range [0, 0.5]; Well localized ∀f ;

|XC [k]| ∝ k−2 for 2Nf < k < N

DCT Properties

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 6 / 14

Definition: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

DCT Properties

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 6 / 14

Definition: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

• Linear: αx[n] + βy[n]→ αX[k] + βY [k]

DCT Properties

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 6 / 14

Definition: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

• Linear: αx[n] + βy[n]→ αX[k] + βY [k]

• “Convolution←→Multiplication” property of DFT does not hold /

DCT Properties

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 6 / 14

Definition: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

• Linear: αx[n] + βy[n]→ αX[k] + βY [k]

• “Convolution←→Multiplication” property of DFT does not hold /

• Symmetric: X[−k] = X[k] since cos−αk = cos+αk

DCT Properties

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 6 / 14

Definition: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

• Linear: αx[n] + βy[n]→ αX[k] + βY [k]

• “Convolution←→Multiplication” property of DFT does not hold /

• Symmetric: X[−k] = X[k] since cos−αk = cos+αk

• Anti-periodic: X[k + 2N ] = −X[k]

DCT Properties

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 6 / 14

Definition: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

• Linear: αx[n] + βy[n]→ αX[k] + βY [k]

• “Convolution←→Multiplication” property of DFT does not hold /

• Symmetric: X[−k] = X[k] since cos−αk = cos+αk

• Anti-periodic: X[k + 2N ] = −X[k] because:◦ 2π(2n+ 1)(k + 2N) = 2π(2n+ 1)k + 8πNn+ 4Nπ

◦ cos (θ + π) = − cos θ

DCT Properties

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 6 / 14

Definition: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

• Linear: αx[n] + βy[n]→ αX[k] + βY [k]

• “Convolution←→Multiplication” property of DFT does not hold /

• Symmetric: X[−k] = X[k] since cos−αk = cos+αk

• Anti-periodic: X[k + 2N ] = −X[k] because:◦ 2π(2n+ 1)(k + 2N) = 2π(2n+ 1)k + 8πNn+ 4Nπ

◦ cos (θ + π) = − cos θ

⇒X[N ] = 0 since X[N ] = X[−N ] = −X[−N + 2N ]

DCT Properties

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 6 / 14

Definition: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

• Linear: αx[n] + βy[n]→ αX[k] + βY [k]

• “Convolution←→Multiplication” property of DFT does not hold /

• Symmetric: X[−k] = X[k] since cos−αk = cos+αk

• Anti-periodic: X[k + 2N ] = −X[k] because:◦ 2π(2n+ 1)(k + 2N) = 2π(2n+ 1)k + 8πNn+ 4Nπ

◦ cos (θ + π) = − cos θ

⇒X[N ] = 0 since X[N ] = X[−N ] = −X[−N + 2N ]

• Periodic: X[k + 4N ] = −X[k + 2N ] = X[k]

Energy Conservation

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 7 / 14

DCT: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

IDCT: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

rep→

0 12 23

y[r]

DFT→ 0

1223

Y[k]

÷2→

Energy Conservation

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 7 / 14

DCT: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

IDCT: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

rep→

0 12 23

y[r]

DFT→ 0

1223

Y[k]

÷2→

Energy: E =∑N−1

n=0 |x[n]|2

Energy Conservation

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 7 / 14

DCT: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

IDCT: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

rep→

0 12 23

y[r]

DFT→ 0

1223

Y[k]

÷2→

Energy: E =∑N−1

n=0 |x[n]|2= 1

N|X[0]|

2+ 2

N

∑N−1n=1 |X[n]|

2

Energy Conservation

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 7 / 14

DCT: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

IDCT: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

rep→

0 12 23

y[r]

DFT→ 0

1223

Y[k]

÷2→

Energy: E =∑N−1

n=0 |x[n]|2= 1

N|X[0]|

2+ 2

N

∑N−1n=1 |X[n]|

2

In diagram above: E → 2E→ 8NE→≈ 0.5NE

Energy Conservation

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 7 / 14

DCT: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

IDCT: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

rep→

0 12 23

y[r]

DFT→ 0

1223

Y[k]

÷2→

Energy: E =∑N−1

n=0 |x[n]|2= 1

N|X[0]|

2+ 2

N

∑N−1n=1 |X[n]|

2

In diagram above: E → 2E→ 8NE→≈ 0.5NE

Orthogonal DCT (preserves energy:∑

|x[n]|2 =∑

|X[n]|2)

Note: MATLAB dct() calculates the ODCT

Energy Conservation

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 7 / 14

DCT: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

IDCT: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

rep→

0 12 23

y[r]

DFT→ 0

1223

Y[k]

÷2→

Energy: E =∑N−1

n=0 |x[n]|2= 1

N|X[0]|

2+ 2

N

∑N−1n=1 |X[n]|

2

In diagram above: E → 2E→ 8NE→≈ 0.5NE

Orthogonal DCT (preserves energy:∑

|x[n]|2 =∑

|X[n]|2)

ODCT: X[k] =

1N

∑N−1n=0 x[n] k = 0

2N

∑N−1n=0 x[n] cos 2π(2n+1)k

4N k 6= 0

Note: MATLAB dct() calculates the ODCT

Energy Conservation

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 7 / 14

DCT: X[k] =∑N−1

n=0 x[n] cos 2π(2n+1)k4N

IDCT: x[n] = 1NX[0] + 2

N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

rep→

0 12 23

y[r]

DFT→ 0

1223

Y[k]

÷2→

Energy: E =∑N−1

n=0 |x[n]|2= 1

N|X[0]|

2+ 2

N

∑N−1n=1 |X[n]|

2

In diagram above: E → 2E→ 8NE→≈ 0.5NE

Orthogonal DCT (preserves energy:∑

|x[n]|2 =∑

|X[n]|2)

ODCT: X[k] =

1N

∑N−1n=0 x[n] k = 0

2N

∑N−1n=0 x[n] cos 2π(2n+1)k

4N k 6= 0

IODCT: x[n] =√

1NX[0] +

2N

∑N−1k=1 X[k] cos 2π(2n+1)k

4N

Note: MATLAB dct() calculates the ODCT

Energy Compaction

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 8 / 14

If consecutive x[n] are positively correlated, DCT concentrates energy in afew X[k] and decorrelates them.

Energy Compaction

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 8 / 14

If consecutive x[n] are positively correlated, DCT concentrates energy in afew X[k] and decorrelates them.

Example: Markov Process: x[n] = ρx[n− 1] +√

1− ρ2u[n]where u[n] is i.i.d. unit Gaussian.Then

x2[n]⟩

= 1 and 〈x[n]x[n− 1]〉 = ρ.

Covariance of vector x is Si,j =⟨

xxH⟩

i,j= ρ|i−j|.

Energy Compaction

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 8 / 14

If consecutive x[n] are positively correlated, DCT concentrates energy in afew X[k] and decorrelates them.

Example: Markov Process: x[n] = ρx[n− 1] +√

1− ρ2u[n]where u[n] is i.i.d. unit Gaussian.Then

x2[n]⟩

= 1 and 〈x[n]x[n− 1]〉 = ρ.

Covariance of vector x is Si,j =⟨

xxH⟩

i,j= ρ|i−j|.

Suppose ODCT of x is Cx and DFT is Fx.

Covariance of Cx is⟨

CxxHCH⟩

= CSCH (similarly FSFH )

Diagonal elements give mean coefficient energy.

Energy Compaction

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 8 / 14

If consecutive x[n] are positively correlated, DCT concentrates energy in afew X[k] and decorrelates them.

Example: Markov Process: x[n] = ρx[n− 1] +√

1− ρ2u[n]where u[n] is i.i.d. unit Gaussian.Then

x2[n]⟩

= 1 and 〈x[n]x[n− 1]〉 = ρ.

Covariance of vector x is Si,j =⟨

xxH⟩

i,j= ρ|i−j|.

Suppose ODCT of x is Cx and DFT is Fx.

Covariance of Cx is⟨

CxxHCH⟩

= CSCH (similarly FSFH )

Diagonal elements give mean coefficient energy.

Energy Compaction

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 8 / 14

If consecutive x[n] are positively correlated, DCT concentrates energy in afew X[k] and decorrelates them.

Example: Markov Process: x[n] = ρx[n− 1] +√

1− ρ2u[n]where u[n] is i.i.d. unit Gaussian.Then

x2[n]⟩

= 1 and 〈x[n]x[n− 1]〉 = ρ.

Covariance of vector x is Si,j =⟨

xxH⟩

i,j= ρ|i−j|.

Suppose ODCT of x is Cx and DFT is Fx.

Covariance of Cx is⟨

CxxHCH⟩

= CSCH (similarly FSFH )

Diagonal elements give mean coefficient energy.

• Used in MPEG and JPEG (superseded byJPEG2000 using wavelets)

• Used in speech recognition to decorrelatespectral coeficients: DCT of log spectrum

Energy Compaction

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 8 / 14

If consecutive x[n] are positively correlated, DCT concentrates energy in afew X[k] and decorrelates them.

Example: Markov Process: x[n] = ρx[n− 1] +√

1− ρ2u[n]where u[n] is i.i.d. unit Gaussian.Then

x2[n]⟩

= 1 and 〈x[n]x[n− 1]〉 = ρ.

Covariance of vector x is Si,j =⟨

xxH⟩

i,j= ρ|i−j|.

Suppose ODCT of x is Cx and DFT is Fx.

Covariance of Cx is⟨

CxxHCH⟩

= CSCH (similarly FSFH )

Diagonal elements give mean coefficient energy.

• Used in MPEG and JPEG (superseded byJPEG2000 using wavelets)

• Used in speech recognition to decorrelatespectral coeficients: DCT of log spectrum

Energy compaction good for coding (low-valued coefficients can be set to 0)Decorrelation good for coding and for probability modelling

Frame-based coding

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 9 / 14

• Divide continuous signalinto frames x[n]

X[k] k=30/220

y[n]

y[n]-x[n]

Frame-based coding

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 9 / 14

• Divide continuous signalinto frames

• Apply DCT to each frame

x[n]

X[k] k=30/220

y[n]

y[n]-x[n]

Frame-based coding

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 9 / 14

• Divide continuous signalinto frames

• Apply DCT to each frame

• Encode DCT

◦ e.g. keep only 30 X[k]

x[n]

X[k] k=30/220

y[n]

y[n]-x[n]

Frame-based coding

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 9 / 14

• Divide continuous signalinto frames

• Apply DCT to each frame

• Encode DCT

◦ e.g. keep only 30 X[k]

• Apply IDCT→ y[n]

x[n]

X[k] k=30/220

y[n]

y[n]-x[n]

Frame-based coding

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 9 / 14

• Divide continuous signalinto frames

• Apply DCT to each frame

• Encode DCT

◦ e.g. keep only 30 X[k]

• Apply IDCT→ y[n]

x[n]

X[k] k=30/220

y[n]

y[n]-x[n]

Problem: Coding may create discontinuities at frame boundaries

Frame-based coding

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 9 / 14

• Divide continuous signalinto frames

• Apply DCT to each frame

• Encode DCT

◦ e.g. keep only 30 X[k]

• Apply IDCT→ y[n]

x[n]

X[k] k=30/220

y[n]

y[n]-x[n]

Problem: Coding may create discontinuities at frame boundariese.g. JPEG, MPEG use 8× 8 pixel blocks

8.3 kB (PNG) 1.6 kB (JPEG) 0.5 kB (JPEG)

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]

X0[k]

y0[n]

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]MDCT→ X0[0 : N − 1]

X0[k]

y0[n]

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

MDCT: 2N → N coefficients

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]MDCT→ X0[0 : N − 1]

IMDCT→ y0[0 : 2N − 1]

X0[k]

y0[n]

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

MDCT: 2N → N coefficients, IMDCT: N → 2N samples

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]MDCT→ X0[0 : N − 1]

IMDCT→ y0[0 : 2N − 1]

x[N : 3N − 1]MDCT→ X1[N : 2N − 1]

X0[k]

y0[n]

X1[k]

y1[n]

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

MDCT: 2N → N coefficients, IMDCT: N → 2N samples

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]MDCT→ X0[0 : N − 1]

IMDCT→ y0[0 : 2N − 1]

x[N : 3N − 1]MDCT→ X1[N : 2N − 1]

IMDCT→ y1[N : 3N − 1]

X0[k]

y0[n]

X1[k]

y1[n]

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

MDCT: 2N → N coefficients, IMDCT: N → 2N samples

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]MDCT→ X0[0 : N − 1]

IMDCT→ y0[0 : 2N − 1]

x[N : 3N − 1]MDCT→ X1[N : 2N − 1]

IMDCT→ y1[N : 3N − 1]

x[2N : 4N − 1]MDCT→ X2[2N : 3N − 1]

X0[k]

y0[n]

X1[k]

y1[n]

X2[k]

y2[n]

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

MDCT: 2N → N coefficients, IMDCT: N → 2N samples

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]MDCT→ X0[0 : N − 1]

IMDCT→ y0[0 : 2N − 1]

x[N : 3N − 1]MDCT→ X1[N : 2N − 1]

IMDCT→ y1[N : 3N − 1]

x[2N : 4N − 1]MDCT→ X2[2N : 3N − 1]

IMDCT→ y2[2N : 4N − 1]

X0[k]

y0[n]

X1[k]

y1[n]

X2[k]

y2[n]

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

MDCT: 2N → N coefficients, IMDCT: N → 2N samples

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]MDCT→ X0[0 : N − 1]

IMDCT→ y0[0 : 2N − 1]

x[N : 3N − 1]MDCT→ X1[N : 2N − 1]

IMDCT→ y1[N : 3N − 1]

x[2N : 4N − 1]MDCT→ X2[2N : 3N − 1]

IMDCT→ y2[2N : 4N − 1]

y[n] = y0[n]+ y1[n]+ y2[n]

X0[k]

y0[n]

X1[k]

y1[n]

X2[k]

y2[n]

y[n]

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

MDCT: 2N → N coefficients, IMDCT: N → 2N samplesAdd yi[n] together to get y[n]. Only two non-zero terms far any n.

Lapped Transform +

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 10 / 14

Modified Discrete Cosine Transform (MDCT): overlapping frames 2N long

x[0 : 2N − 1]MDCT→ X0[0 : N − 1]

IMDCT→ y0[0 : 2N − 1]

x[N : 3N − 1]MDCT→ X1[N : 2N − 1]

IMDCT→ y1[N : 3N − 1]

x[2N : 4N − 1]MDCT→ X2[2N : 3N − 1]

IMDCT→ y2[2N : 4N − 1]

y[n] = y0[n]+ y1[n]+ y2[n]

X0[k]

y0[n]

X1[k]

y1[n]

X2[k]

y2[n]

y[n]

y[n]-x[n] = error

x[n]

0 N

N

2N

2N

3N

3N

4N

4N

MDCT: 2N → N coefficients, IMDCT: N → 2N samplesAdd yi[n] together to get y[n]. Only two non-zero terms far any n.Errors cancel exactly: Time-domain alias cancellation (TDAC)

MDCT (Modified DCT)

DSP and Digital Filters (2017-10120) Transforms: 3 – 11 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

MDCT (Modified DCT)

DSP and Digital Filters (2017-10120) Transforms: 3 – 11 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

If x and X are column vectors, then X = Mx

where M is an N × 2N matrix with mk,n = cos 2π(2n+1+N)(2k+1)8N .

MDCT (Modified DCT)

DSP and Digital Filters (2017-10120) Transforms: 3 – 11 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

If x and X are column vectors, then X = Mx

where M is an N × 2N matrix with mk,n = cos 2π(2n+1+N)(2k+1)8N .

MDCT (Modified DCT)

DSP and Digital Filters (2017-10120) Transforms: 3 – 11 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

If x, X and y are column vectors, then X = Mx and y = 1NMTX

where M is an N × 2N matrix with mk,n = cos 2π(2n+1+N)(2k+1)8N .

MDCT (Modified DCT)

DSP and Digital Filters (2017-10120) Transforms: 3 – 11 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

If x, X and y are column vectors, then X = Mx and y = 1NMTX = 1

NMTMx

where M is an N × 2N matrix with mk,n = cos 2π(2n+1+N)(2k+1)8N .

MDCT (Modified DCT)

DSP and Digital Filters (2017-10120) Transforms: 3 – 11 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

If x, X and y are column vectors, then X = Mx and y = 1NMTX = 1

NMTMx

where M is an N × 2N matrix with mk,n = cos 2π(2n+1+N)(2k+1)8N .

Quasi-Orthogonality: The 2N × 2Nmatrix, 1NMTM, is almost the identity:

1NMTM = 1

2

[

I− J 0

0 I+ J

]

with I =

1 · · · 0...

. . ....

0 · · · 1

, J =

0 · · · 1... . .

. ...

1 · · · 0

MDCT (Modified DCT)

DSP and Digital Filters (2017-10120) Transforms: 3 – 11 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

If x, X and y are column vectors, then X = Mx and y = 1NMTX = 1

NMTMx

where M is an N × 2N matrix with mk,n = cos 2π(2n+1+N)(2k+1)8N .

Quasi-Orthogonality: The 2N × 2Nmatrix, 1NMTM, is almost the identity:

1NMTM = 1

2

[

I− J 0

0 I+ J

]

with I =

1 · · · 0...

. . ....

0 · · · 1

, J =

0 · · · 1... . .

. ...

1 · · · 0

When two consective y frames are overlapped by N samples, the second half of thefirst frame has thus been multiplied by 1

2 (I+ J) and the first half of the second frameby 1

2 (I− J). When these y frames are added together, the corresponding x sampleshave been multiplied by 1

2 (I+ J) + 12 (I− J) = I giving perfect reconstruction.

MDCT (Modified DCT)

DSP and Digital Filters (2017-10120) Transforms: 3 – 11 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

If x, X and y are column vectors, then X = Mx and y = 1NMTX = 1

NMTMx

where M is an N × 2N matrix with mk,n = cos 2π(2n+1+N)(2k+1)8N .

Quasi-Orthogonality: The 2N × 2Nmatrix, 1NMTM, is almost the identity:

1NMTM = 1

2

[

I− J 0

0 I+ J

]

with I =

1 · · · 0...

. . ....

0 · · · 1

, J =

0 · · · 1... . .

. ...

1 · · · 0

When two consective y frames are overlapped by N samples, the second half of thefirst frame has thus been multiplied by 1

2 (I+ J) and the first half of the second frameby 1

2 (I− J). When these y frames are added together, the corresponding x sampleshave been multiplied by 1

2 (I+ J) + 12 (I− J) = I giving perfect reconstruction.

Normally the 2N -long x and y frames are windowed before the MDCT and again afterthe IMDCT to avoid any discontinuities; if the window is symmetric and satisfiesw2[i] + w2[i+N ] = 2 the perfect reconstruction property is still true.

MDCT Basis Elements

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 12 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

MDCT Basis Elements

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 12 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

In vector notation: X = Mx and y = 1NMTX = 1

NMTMx

MDCT Basis Elements

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 12 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

In vector notation: X = Mx and y = 1NMTX = 1

NMTMx

The rows of M form theMDCT basis elements.

MDCT Basis Elements

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 12 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

In vector notation: X = Mx and y = 1NMTX = 1

NMTMx

The rows of M form theMDCT basis elements.

Example (N = 4):

M =

0.56 0.20 −0.20 −0.56 −0.83 −0.98 −0.98 −0.83

−0.98 −0.56 0.56 0.98 0.20 −0.83 −0.83 0.20

0.20 0.83 −0.83 −0.20 0.98 −0.56 −0.56 0.98

0.83 −0.98 0.98 −0.83 0.56 −0.20 −0.20 0.56

MDCT Basis Elements

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 12 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

In vector notation: X = Mx and y = 1NMTX = 1

NMTMx

The rows of M form theMDCT basis elements.

Example (N = 4):

M =

0.56 0.20 −0.20 −0.56 −0.83 −0.98 −0.98 −0.83

−0.98 −0.56 0.56 0.98 0.20 −0.83 −0.83 0.20

0.20 0.83 −0.83 −0.20 0.98 −0.56 −0.56 0.98

0.83 −0.98 0.98 −0.83 0.56 −0.20 −0.20 0.56

MDCT Basis Elements

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 12 / 14

MDCT: X[k] =∑2N−1

n=0 x[n] cos 2π(2n+1+N)(2k+1)8N 0 ≤ k < N

IMDCT: y[n] = 1N

∑N−1k=0 X[k] cos 2π(2n+1+N)(2k+1)

8N 0 ≤ n < 2N

In vector notation: X = Mx and y = 1NMTX = 1

NMTMx

The rows of M form theMDCT basis elements.

Example (N = 4):

M =

0.56 0.20 −0.20 −0.56 −0.83 −0.98 −0.98 −0.83

−0.98 −0.56 0.56 0.98 0.20 −0.83 −0.83 0.20

0.20 0.83 −0.83 −0.20 0.98 −0.56 −0.56 0.98

0.83 −0.98 0.98 −0.83 0.56 −0.20 −0.20 0.56

The basis frequencies are {0.5, 1.5, 2.5, 3.5} times the fundamental.

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients◦ Decorrelation: The coefficients are uncorrelated with each other

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients◦ Decorrelation: The coefficients are uncorrelated with each other

• Nice convolution property of DFT is lost /

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients◦ Decorrelation: The coefficients are uncorrelated with each other

• Nice convolution property of DFT is lost /

MDCT: Modified Discrete Cosine Transform• Lapped transform: 2N → N → 2N

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients◦ Decorrelation: The coefficients are uncorrelated with each other

• Nice convolution property of DFT is lost /

MDCT: Modified Discrete Cosine Transform• Lapped transform: 2N → N → 2N• Aliasing errors cancel out when overlapping output frames are added

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients◦ Decorrelation: The coefficients are uncorrelated with each other

• Nice convolution property of DFT is lost /

MDCT: Modified Discrete Cosine Transform• Lapped transform: 2N → N → 2N• Aliasing errors cancel out when overlapping output frames are added• Similar to DCT for energy compaction and decorrelation ,

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients◦ Decorrelation: The coefficients are uncorrelated with each other

• Nice convolution property of DFT is lost /

MDCT: Modified Discrete Cosine Transform• Lapped transform: 2N → N → 2N• Aliasing errors cancel out when overlapping output frames are added• Similar to DCT for energy compaction and decorrelation ,

• Overlapping windowed frames can avoid edge discontinuities ,

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients◦ Decorrelation: The coefficients are uncorrelated with each other

• Nice convolution property of DFT is lost /

MDCT: Modified Discrete Cosine Transform• Lapped transform: 2N → N → 2N• Aliasing errors cancel out when overlapping output frames are added• Similar to DCT for energy compaction and decorrelation ,

• Overlapping windowed frames can avoid edge discontinuities ,

• Used in audio coding: MP3, WMA, AC-3, AAC, Vorbis, ATRAC

Summary

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 13 / 14

DCT: Discrete Cosine Transform• Equivalent to a DFT of time-shifted double-length

[

x ←−x]

• Often scaled to make an orthogonal transform (ODCT)• Better than DFT for energy compaction and decorrelation ,

◦ Energy Compaction: Most energy is in only a few coefficients◦ Decorrelation: The coefficients are uncorrelated with each other

• Nice convolution property of DFT is lost /

MDCT: Modified Discrete Cosine Transform• Lapped transform: 2N → N → 2N• Aliasing errors cancel out when overlapping output frames are added• Similar to DCT for energy compaction and decorrelation ,

• Overlapping windowed frames can avoid edge discontinuities ,

• Used in audio coding: MP3, WMA, AC-3, AAC, Vorbis, ATRAC

For further details see Mitra: 5.

MATLAB routines

3: Discrete Cosine Transform

• DFT Problems

• DCT +

• Basis Functions

• DCT of sine wave

• DCT Properties

• Energy Conservation

• Energy Compaction

• Frame-based coding

• Lapped Transform +

• MDCT (Modified DCT)

• MDCT Basis Elements

• Summary

• MATLAB routines

DSP and Digital Filters (2017-10120) Transforms: 3 – 14 / 14

dct, idct ODCT with optional zero-padding