Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 9

Technische Universita¨ t Mu¨ nchen

Algorithms of Scientific Computing


Discrete Sine Transform (DST)
Tobias Neckel, Dirk Pflu¨ ger
Summer Term 2010

Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing


Discrete Sine Transform (DST), Summer Term 2010 1
Technische Universita¨ t Mu¨ nchen

DFT and Symmetry


INPUT TRANSFORM

real symmetry fn is real → Real-valued DFT (RDFT)

even symmetry fn = f − n → Discrete Cosine Transform


(DCT)
odd symmetry fn = −f − n → Discrete Sine Transform (DST)

Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing


Discrete Sine Transform (DST), Summer Term 2010 2
Technische Universita¨ t Mu¨ nchen

Real-valued Input Data with “Odd” Symmetry


Given: 2N input data f − N + 1 , . . . , fN , all fn ∈ R, with

f − n = −fn, in particular f0 = fN = f − N = 0 The

DFT has the following form:

1 ΣN
Fk f n ω −nk
2N
2N
= n=− N+1
 
1  Σ 1.
N−
= f0 + − nk nk
Σ fnω2N + f− n ω2N + fN − Nk 
2N x s ˛¸ ω2N
n=1 = 0

N−
Σ 1 . N−
Σ 1 x. Σ
1 − nk nk −i πnk
= .
2N fn Σω2N − ω
2N = fn sin N
n=1 N n=1

Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing


Discrete Sine Transform (DST), Summer Term 2010 3
Technische Universita¨ t Mu¨ nchen

Symmetry in the Coefficients


Transform to fn with symmetry f − n = −fn gives:
N− 1 . Σ
−i Σ
for k = −N + 1, . . . ,
Fk = πnk fn sin N
N n=1 N.
Same symmetrie in the coefficients Fk :
N− 1 N−
Σ 1 . Σ
−i Σ . Σ πnk
πn(−k ) = −Fk
F− k = fn sin = fn − sin N
N n=1 N n=1
−i
N
⇒ leads to the same (up to scaling) sine transform

Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing


Discrete Sine Transform (DST), Summer Term 2010 4
Technische Universita¨ t Mu¨ nchen

Discrete Sine Transform (DST)


From DFT of real-valued, odd symmetric data:
N− 1 . Σ
i Σ
, k = 1, . . . N −
Fk = − πnk fn sin N
N n=1 1.
Analogue calculation for IDFT gives:
N−
Σ 1 . Σ
πnk
fn = 2i Fk sin , n = 1, . . . N −
N
k 1.
=1
⇒ definition of the discrete sine transform (F^ k:= iF ):k
N− 1 . Σ N−
Σ 1 . Σ
^ 1 Σ ^ πnk
Fk = πnk fn sin N , f n = 2 F k sin ,
N N
n=1 k
=1

Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing


Discrete Sine Transform (DST), Summer Term 2010 5
Technische Universita¨ t Mu¨ nchen

Computation of the Discreten Sine Transform


Via pre-/postprocessing:
(1) generate 2N vector with odd symmetry

x − k = −xk
for k = 1, . . . N − 1
x0 = xN = 0

(2)
(3) postprocessing: X^fast,
coefficients Xk via real-valued FFT on vector x
k = −Im{Xk } for k = 1, . . . , N −
(4) if necessary: scaling 1.

Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing


Discrete Sine Transform (DST), Summer Term 2010 6
Technische Universita¨ t Mu¨ nchen

Summary: Survey on DCT/DST Variants


Symmetry properties ⇔ how is data continued at boundaries:

beg. \ end even odd


even x x
odd x x

⇒ 4 possibilities

beg. \ end mirror copy


mirror x x
copy x x

⇒ 4 possibilities

⇒ total: 16 possibilities (8 DCT, 8 DST)

Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing


Discrete Sine Transform (DST), Summer Term 2010 7
Technische Universita¨ t Mu¨ nchen

Summary: Survey on DCT/DST Variants (2)


Common schemes of DCT (left) and DST (right) (source: wikipedia):

Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing


Discrete Sine Transform (DST), Summer Term 2010 8
Technische Universita¨ t Mu¨ nchen

Application: DCT/DST for PDE (Spectral Methods)


nice application in exercise sessions: DST for Fast Poisson Solver
space frequency
domain domain

problem Problem

DST/DCT

solution Solution

Attention: also limits/problems for using DFT with PDE:


• irregular (i.e. non-rectangular) domains
• variable coefficients in problem
⇒ other methods: FVM, FEM (fast linear solvers, multigrid, etc.)
Tobias Neckel, Dirk Pflu¨ ger: Algorithms of Scientific Computing
Discrete Sine Transform (DST), Summer Term 2010 9

You might also like