Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
2 views

Module 4 - Special Transforms

Module 4 covers various special transforms in digital signal processing, including Short Time Fourier Transform (STFT), Discrete Cosine Transform (DCT), Continuous Wavelet Transform (CWT), and Discrete Wavelet Transform (DWT). Each transform is explained in terms of its mathematical formulation, applications, and advantages, such as resolution trade-offs in STFT and energy compaction in DCT. The module also discusses inverse transformations and practical applications of wavelets in signal processing.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Module 4 - Special Transforms

Module 4 covers various special transforms in digital signal processing, including Short Time Fourier Transform (STFT), Discrete Cosine Transform (DCT), Continuous Wavelet Transform (CWT), and Discrete Wavelet Transform (DWT). Each transform is explained in terms of its mathematical formulation, applications, and advantages, such as resolution trade-offs in STFT and energy compaction in DCT. The module also discusses inverse transformations and practical applications of wavelets in signal processing.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

Module 4: Special Transforms

Hernán Darı́o Vargas Cardona, PhD

Digital Signal Processing (DSP)


Biomedical Engineering
Electronic Engineering
Pontificia Universidad Javeriana Cali
Content

Short time Fourier transform (STFT)

Discrete cosine transform (DCT)

Continuous Wavelet transform (CWT)

Discrete Wavelet transform (DWT)


Content

Short time Fourier transform (STFT)

Discrete cosine transform (DCT)

Continuous Wavelet transform (CWT)

Discrete Wavelet transform (DWT)


Short time Fourier transform (STFT)

Short-Time Fourier Transform (STFT) is used to determine the


frequency and phase content in local sections of a signal, as well as
their changes over time.

The need for STFT arises because the Fourier transform (FT) is
limited to static signals, i.e., those that do not change their
frequency components (spectrum) over time. In other words, the
FT only provides information about the frequency spectrum
regardless of time.
Continuous time STFT

In the continuous case, the STFT is expressed as follows:


Z ∞
ST FT {x(t)} = X (τ, ω) = x(t)w (t − τ ) exp−jωt dt
−∞

Where w (t) is a window function. Commonly used windows


include Hamming, Hanning, or Gaussian. x(t) is the signal to be
transformed, and X (τ, ω) is the Fourier transform of x(t)w (t − τ ),
being a complex-valued function indexed in both time and
frequency. The squared magnitude of the STFT results in the
spectrogram, which is the graphical representation:

Espectrogram {x(t)} = |X (τ, ω)|2


Discrete time STFT

In the discrete case, the information to be transformed is divided


into chunks or frames (usually overlapping to reduce irregularities
at the boundary), with each chunk being a Fourier transform. The
complex result is then added to a matrix that stores magnitude
and phase for each point in time and frequency. This can be
expressed as:

X
ST FT {x[n]} = X (m, ω) = x[n]w [n − m] exp−jωn
n=−∞

Where x[n] is the signal, and w [n] is the window. In this case, m is
discrete, and ω is continuous.
Inverse STFT

The STFT is invertible, meaning that the original signal can be


recovered from the transformation. The most widely accepted
method for inverting the STFT is using the overlap-add method:
Z ∞ Z ∞ 
1 jωt
x(t) = X (τ, ω) exp dω dτ
−∞ 2π −∞
For the discrete case:
Z π
1
x[n] = X (ω) expjωn dω
2π −π
Resolution problems

One of the issues with the STFT is that it has fixed resolution.
The width of the window function is related to the signal
representation, determining the trade-off between frequency and
time resolution. A wide window provides better frequency
resolution but poor time resolution, whereas a narrow window
offers good time resolution but poor frequency resolution.

Good resolution in time Good resolution in frequency


Low resolution in frequency Low resolution in time
Example STFT
The signal x(t) is defined as follows:

 cos(2π5t), 0 ≤ t < 5(sec)

cos(2π10t), 5 ≤ t < 10(sec)

x(t) =

 cos(2π15t), 10 ≤ t < 15(sec)
cos(2π20t), 15 ≤ t < 20(sec)

The spectrogram of this signal is:


Content

Short time Fourier transform (STFT)

Discrete cosine transform (DCT)

Continuous Wavelet transform (CWT)

Discrete Wavelet transform (DWT)


Discrete cosine transform (DCT)
It is a transform based on the DFT but using only real numbers.
This transform expresses a finite sequence of multiple points as the
result of various cosineoidal signals, with different frequencies and
amplitudes.

Formally, the DCT is a linear and invertible function that maps


from one real domain to another: RN → RN . The most commonly
used form is as follows:

N
X h π i
y [k] = w [k] x[n] cos [2n − 1][k − 1] , k = 1, 2, ..., N
2N
n=1

√1
(
, k=1
w [k] = qN
2
N, 2≤k ≤N
Useful features for compression

I The DCT has good energy compaction capability in the


transformed domain, meaning that the cosine transform
manages to concentrate most of the information in a few
coefficients.
I The transformation is data-independent. The algorithm
applied does not vary with the data it receives, as is the case
with other compression algorithms.
I There are formulas for the fast calculation of the algorithm.
I It produces few errors in compression, whether for images or
signals.
I Applications: Dolby Digital (AC-3), JPEG, MPEG-1,
MPEG-2, MPEG-4.
Inverse DCT

The inverse DCT reconstructs a time sequence from the DCT


coefficients:

N  
X π[2n − 1][k − 1]
x[n] = w [k]y [k] cos , n = 1, 2, ..., N
2N
k=1

√1
(
, k=1
w [k] = qN
2
N, 2≤k ≤N
Example DCT
Content

Short time Fourier transform (STFT)

Discrete cosine transform (DCT)

Continuous Wavelet transform (CWT)

Discrete Wavelet transform (DWT)


Continuous Wavelet transform (CWT) I

The Wavelet transform is the decomposition of a function f (t),


into a set of functions ψs,τ (t) that form a basis and are called
wavelets. It is defined as:
Z ∞
Wf (s, τ ) = f (t)ψs,τ (t)dt
−∞

Wavelets are generated from the translation and scaling of the


same function ψ(t), called the mother wavelet, and are defined as:
 
1 t −τ
ψs,τ (t) = √ ψ
s s
Continuous Wavelet transform (CWT) II

Where s is the scaling factor and τ is the translation factor. The


wavelets ψs,τ (t) generated from the same mother function ψ(t)
have different scales s y locations τ , but the same shape. The
wavelets are dilated when the scale s > 1 and contracted when
s < 1. Thus, changing s covers different frequency ranges.
Examples of Wavelet functions I
a. Wavelet Haar

 1, 0 < t < 0.5
ψ(t) = −1, 0.5 ≤ t < 1
0, otherwise

Examples of Wavelet functions II
b. Wavelet Morlet

t2
 
ψ(t) = exp − cos(5t)
2

t
Examples of Wavelet functions III
c. Mexican hat
 2
2 t
ψ(t) = √ exp − (1 − t 2 )
3π 1/4 2

t
Examples of Wavelet functions IV

d. Other families:
I Daubechies: db1, db2, db3,...,
I Coiflet: coif1, coif2, coif3,...,
I Symmlet: sym1, sym2, sym3,...,
I Shannon: shan1, shan2, shan3,...,
Inverse Wavelet

When the function is continuous and the wavelets are continuous


with discrete scale and translation factors, f (t) can be
reconstructed as follows:
XX
f (t) = A Wf (s, τ )ψs,τ (t)
s τ

Where A is a constant that does not depend of f (t).


Example 1 CWT
Example 2 CWT
Content

Short time Fourier transform (STFT)

Discrete cosine transform (DCT)

Continuous Wavelet transform (CWT)

Discrete Wavelet transform (DWT)


Discrete Wavelet transform (DWT) I

The simplest way to implement the DWT is through the filter bank
scheme:

2
2
2 ....
2

Where h[n] and g [n] are low-pass and high-pass filters, respectively,
and depend on the type of mother wavelet. The coefficients ci and
di are known as approximation and detail coefficients.
Discrete Wavelet transform (DWT) II

Mathematically, it can be expressed as follows:

X
ci [k] = h[n − 2k]ci−1 [n]
n
X
di [k] = g [n − 2k]ci−1 [n]
n
Discrete Wavelet transform (DWT) III

The graphical representation of the DWT is known as a scalogram.


In the discrete case, it has the following form:

The above is known as multi-resolution analysis.


Inverse discrete Wavelet transform (iDWT) I

Similarly, signals can be reconstructed level by level:

2 +
+

Mathematically:

X X
ci−1 [n] = ci [k]h̄[n − 2k] + di [k]ḡ [n − 2k]
k k
g [n] = (−1)−n h̄[n]
ḡ [n] = (−1)−n h[n]
Example 1 DWT
Wavelet applications

I Detection of discontinuities in signals and fault points


I Data compression
I Suppression of unwanted signals and noise elimination
I Detection of similarities
I Feature extraction

You might also like