0% found this document useful (0 votes)
43 views27 pages

Appendix B - Digital Signal Processing

1) Digital signal processing is important for processing earthquake records and generating artificial records. 2) Sampling discretizes a continuous signal at regular intervals. The sampling rate must be fast enough to preserve the signal's information, as determined by the Nyquist-Shannon sampling theorem. 3) If the sampling rate is too low, aliasing can occur where higher frequencies are misinterpreted as lower frequencies in the sampled signal.

Uploaded by

Sepideh Khaleghi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views27 pages

Appendix B - Digital Signal Processing

1) Digital signal processing is important for processing earthquake records and generating artificial records. 2) Sampling discretizes a continuous signal at regular intervals. The sampling rate must be fast enough to preserve the signal's information, as determined by the Nyquist-Shannon sampling theorem. 3) If the sampling rate is too low, aliasing can occur where higher frequencies are misinterpreted as lower frequencies in the sampled signal.

Uploaded by

Sepideh Khaleghi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

A P P

B
Digital Signal Processing
E N D I X

Some important topics in digital signal processing that are particularly relevant to
earthquake engineering are briefly introduced in this Appendix. The objective is to
highlight the important concepts, features, and challenges that may be encountered in
processing real earthquake records and generating artificial earthquake time-histories.
Software packages, such as Matlab, are available to perform many of the essential
tasks in digital signal processing.

B.1 Sampling
Consider a continuous signal X(t) with Fourier transform (spectrum) X( F ). Discretize
it at regular interval of s , i.e., at time instances tn = ns , −∞ < n < +∞. Fs = 1/s
is called the sampling rate. The subscript “s” stands for “sampling”. Hence, a sequence
of discrete values is obtained

Xn = X(tn ) = X(ns ), −∞ < n < +∞.

The discrete-time Fourier transform (spectrum) of the discrete sequence is Xs ( F ). The


most important question on sampling is how fast must a given continuous signal be
sampled (discretized) in order to preserve its desired information characteristics.
Consider a harmonic function X(t) = sin(2π F0 t) of frequency F0 (Hz). Its sampled
value at tn = n s is

Xn = X(tn ) = sin(2π F0 · n s ) = sin(2π F0 · n s + 2mπ ), m = integer,


  m  
= sin 2π F0 + ns .
ns

568
b.1 sampling 569

X(t) 10 Hz 130 Hz f0 = 70 Hz
1.0

0.5

t
0.0
0.02 0.04 0.06 0.08 0.1

−0.5

−1.0
s = 60
1 = 0.01667 s s s s s

Figure B.1 Aliasing in sampling (time domain).

Xs( f )

60Hz 60Hz 60Hz

f
−75 −50 −30Hz −15 10 30 Hz 45 70 105 130

60Hz 60 Hz 60Hz
Figure B.2 Aliasing in sampling (frequency domain).

Letting m be an integer multiple of n, i.e., m = Kn, yields


 
Xn = sin 2π( F0 +K Fs )ns , K = 0, ±1, ±2, . . . , (B.1.1)

which implies that if Xn is a sampled value of a harmonic function of frequency F0 ,


then it is also exactly a sample value of harmonic functions of frequencies F0 +K Fs ,
K = ±1, ±2, . . . . Therefore, equation (B.1.1) means that a sequence of sampled values
X0 , X1 , . . . , XN representing a harmonic function of frequency F0 also represents
exactly harmonic functions of frequencies F0 +K Fs , K = ±1, ±2, . . . . As a result, when
sampling at rate Fs , it is impossible to distinguish between a harmonic function of
frequency F0 and a harmonic of frequency F0 +K Fs , K = ±1, ±2, . . . .
As an illustration, consider a sinewave with frequency F0 = 70 Hz as shown in
Figure B.1. If it is sampled at rate Fs = 60 Hz, then the sampled values could come
from the sinewave with frequency F0 − Fs = 70−60 = 10 Hz, or from the sinewave
with frequency F0 + Fs = 70+60 = 130 Hz. That means, when sampled at 60 Hz, it
is impossible to distinguish sinewaves with frequencies 10 Hz, 70 Hz, 130 Hz. If this
discrete sequence X1 , X2 , . . . , XN is applied to excite an SDOF oscillator with frequency
10 Hz, then the sinewave would be recognized by the oscillator to have a frequency of 10
Hz, and resonance will occur. In other words, a sinewave of 70 Hz with the real name
“70 Hz” is recognized by its alias of “10 Hz”. In fact, all sinewaves with frequencies
70+60K, K = 0, ±1, ±2, . . . , will be recognized as having a frequency of 10 Hz when
sampled at 60 Hz.
570 appendix b. digital signal processing

X( f ) Continuous spectrum

f
f0

Xs( f ) Discrete spectrum

fs fs fs fs

f
f0 −2 fs f0 − f s fs f0 fs f0 + f s f0 +2 fs
2 2
fs fs fs fs
Figure B.3 Continuous and discrete spectra.

In general, the phenomenon that a signal appears to have a lower frequency than it
actually has is called aliasing.
Figure B.2 shows aliasing in the frequency domain. It is clearly seen that, when
sampled at 60 Hz, a 10 Hz harmonic is alias of −50 Hz, 70 Hz, and 130 Hz harmonics,
and a −15 Hz harmonic is alias of −75 Hz, 45 Hz, and 100 Hz harmonics.
Equation (B.1.1) further implies that the spectrum of a discrete sequence of sam-
pled values contains periodic replications of the original continuous spectrum. The
period between these spectral replicas in the frequency domain is Fs , and the spectral
replicas repeat throughout the frequency domain. For example, consider a signal with
continuous spectrum as shown in Figure B.3. Suppose that it is sampled at rate Fs . A
harmonic component with frequency F0 will also appear at frequencies . . . , F0 −2 Fs ,
F0 − Fs , F0 + Fs , F0 +2 Fs , . . . as shown, because sampling at rate Fs cannot distinguish
harmonics with frequencies F0 ±K Fs , K = 0, ±1, ±2, . . . . As a result, the continuous
spectrum repeats periodically with period Fs in the discrete spectrum.
 
If the frequency range of interest is restricted in  F   F max , it is important to know
what harmonic components will be aliased into this frequency band.

Nyquist-Shannon Sampling Theorem


If a continuous signal X(t) is band-limited with its highest frequency component
being B, then X(t) can be completely recovered from its sampled values if the
sampling rate Fs is greater than the Nyquist rate (frequency) F Nyquist = 2B, i.e.,
Fs  F Nyquist or Fs  2B.

Referring to Figure B.4, for a continuous signal with frequency band −B  F  B, if


the signal is sampled at rate Fs  2B, then adjacent spectral replicas are separated in
b.1 sampling 571
X( f ) Continuous spectrum

f
−B B

Xs( f ) Discrete spectrum fs 2B

f
fs −B B f
s
2 2
fs fs fs fs

Xs( f ) Discrete spectrum fs 2B


Aliasing Aliasing Aliasing Aliasing Aliasing Aliasing

f
−B B
fs fs
2 2
fs fs fs fs

Figure B.4 Sampling of band-limited signal.

X( f ) Continuous spectrum

Noise Noise
f
−B B

Xs( f ) Discrete spectrum

Aliasing Aliasing

f
fs −B B f
s
2 2
fs fs fs fs

Figure B.5 Sampling of band-limited signal with high-frequency noise.

the discrete spectrum, and there is no distortion or corruption in the frequency band
−B  F  B. However, if Fs < 2B, adjacent spectral replicas overlap: portions of the
spectral replicas are combined with the original spectrum, resulting in aliasing errors.
According to the Nyquist-Shannon Sampling Theorem, if the highest frequency
component of interest of a continuous signal is F max , then the signal must be sampled
at rate Fs  2 F max . However, in the following two cases
• the signal is not band-limited having components with frequency beyond F max ,
572 appendix b. digital signal processing

• the signal is band-limited but there are high-frequency noises beyond the band-
limit F max = B,
even when the signal is sampled at rate Fs  2 F max , there will be aliasing errors due to
these high-frequency components or noises, as shown in Figure B.5. To resolve this
problem, the signal should be passed through a low-pass filter to remove components
with frequencies higher than F max before sampling (see Section B.4 for digital filters).

B.2 Fourier Series and Fourier Transforms


B.2.1 Fourier Series
A periodic function X(t) of period T can be expressed in Fourier series in the complex
form



X(t) = CK e i Kωt , ω= . (B.2.1)
K=−∞ T
Using the Euler’s formula e i θ = cosθ + i sinθ, equation (B.2.1) can be written as


X(t) = C0 + CK e i Kωt + C−K e−i Kωt
K=1
∞  
= C0 + CK ( cosKωt + i sinKωt) + C−K ( cosKωt − i sinKωt)
K=1
∞  
= C0 + (CK +C−K ) cosKωt + i (CK −C−K ) sinKωt
K=1


= 1
2 a0 + aK cosKωt + BK sinKωt , (B.2.2)
K=1

which is Fourier series in the real form, and

a0 = 2C0 , aK = CK +C−K , BK = i (CK −C−K ), CK = 1


2 (aK − iBK ).

On the other hand, because X(t) is real, X̄(t) = X(t) and




X̄(t) = C̄0 + C̄K e−i Kωt + C̄−K e i Kωt . (B.2.3)
K=1

Comparing the coefficients leads to

C̄0 = C0 , C̄K = C−K , C̄−K = CK .

To determine the coefficients of the Fourier series, multiply equation (B.2.1) by


e−i nωt and integrate with respect to t from 0 to T = 2π/ω:
 T  T
−i nωt
∞
X(t) e dt = CK e i (K−n)ωt dt = Cn T. (B.2.4)
0 K=−∞ 0
b.2 fourier series and fourier transforms 573

Hence,
 T
1
CK = X(t) e−i Kωt dt, (B.2.5)
T 0
 T  T
2 2 2πK
aK = X(t) cosKωt dt = X(t) cos t dt, (B.2.6)
T 0 T 0 T
 T  T
2 2 2πK
BK = X(t) sinKωt dt = X(t) sin t dt. (B.2.7)
T 0 T 0 T

B.2.2 Fourier Transform


Consider function X(t), which can be real or complex and is not necessarily periodic.
Select a time 2T that is large compared to the duration of X(t), and construct an
artificially periodic function:

X2T (t) = X(t), 0  t  2T,


(B.2.8)
X2T (t±2T) = X2T (t),

which is periodic with period 2T. Then the periodic function F2T (t) can be represented
as a Fourier series
  

1  ∞
2π 2π
X2T (t) = CK e i K ω̂t = (2TCK ) e i (K ω̂)t , ω̂ = , (B.2.9)
K=−∞ 2π K=−∞ 2T 2T

where
 T
1
CK = X2T (t) e−i K ω̂t dt. (B.2.10)
2T −T

2π 2π
Let ω = K ω̂, ω = ω̂ = . When T→∞, ω = →0. The discrete spectrum
2T 2T
becomes continuous, and


∞ +∞
→ and X2T (t) → X(t).
K=−∞ −∞

Equations (B.2.9) and (B.2.10) become


 +∞  
1
X(t) = lim X2T (t) = lim (2TCK ) e i ωt dω,
T→∞ 2π −∞ T→∞
 ∞
lim (2TCK ) = X(t) e−i ωt dt = X(ω),
T→∞ −∞

which result in the Fourier transform (FT) and the inverse Fourier transform (IFT)
 ∞
X(ω) = F X(t) =
 
FT X(t) e−i ωt dt, (B.2.11)
−∞
574 appendix b. digital signal processing

 +∞
F −1
  1
IFT X(t) = X(ω) = X(ω)e i ωt dω. (B.2.12)
2π −∞
 
Because X( F ) is generally complex, a plot of the modulus X( F ) as a function of
frequency F is called a Fourier amplitude spectrum (FAS).
Using equation (B.2.12), the total energy e of X(t) is given by
 +∞  +∞  +∞   +∞ 
 2 1
e=  
X(t) dt = X(t) X̄(t)dt = X(t) i ωt
X(ω)e dω dt
−∞ −∞ −∞ 2π −∞
 +∞  +∞   +∞
1 i ωt 1
= X(ω) X(t) e dt dω = X(ω) X̄(ω)dω,
2π −∞ −∞ 2π −∞

which gives Parseval’s theorem


 +∞  
 +∞  
e= X(t)2 dt = 1  X(ω) 2 dω. (B.2.13)
−∞ 2π −∞

Parseval’s theorem (B.2.13) states that the total energy e in a continuous signal is the
same whether it is evaluated in the time domain, in terms of X(t), or in the frequency
domain, in terms of X(ω). Parseval’s theorem also describes how the energy in the
 2
signal is distributed over the frequency range by the function  X(ω) , which is also
called the energy spectral density (ESD) function.

Convolution Integral
Consider the convolution of functions X(t) and Y(t) defined as
 +∞
C(t) = X(t) ∗ Y(t) = X(τ ) Y(t−τ ) dτ. (B.2.14)
−∞

Its FT is
 +∞  +∞ 
C (ω) = F
 
C(t) = X(τ ) Y(t−τ ) dτ e−i ωt dt. (B.2.15)
−∞ −∞

Letting s = t−τ yields


 +∞  +∞
C (ω) = X(τ ) Y(s) e−i ω(s+τ ) dτ ds
−∞ −∞
 +∞  +∞
−i ωτ
= X(τ ) e dτ Y(s) e−i ωs ds = X(ω) Y(ω). (B.2.16)
−∞ −∞

Similarly, consider the convolution of the FT X(ω) and Y(ω):


 +∞
1 1
C (ω) = X(ω) ∗ Y(ω) = X(ν) Y(ω −ν) dν. (B.2.17)
2π 2π −∞
b.2 fourier series and fourier transforms 575

i−
IIFs( F )
− s(t)
III δ( f −n fS )
δ(t −nS)
⇒⇒
t f

S fS =1/S

Figure B.6 Fourier transform pair of the Dirac comb.

WT ( f )
WTB(t) T
1
⇒⇒ T sinc(πT f )

t f
−T/2 T/2
−1/T 1/T
WB(t)
B WBB( f )
B sinc(πBt)
1
⇒⇒
t f
−B/2 B/2
−1/B 1/B
Figure B.7 Fourier transform pair of the “box-car” .

Its IFT is
 +∞   +∞ 
C (t) = F
 1 1
−1
C (ω) = X(ν) Y(ω −ν) dν e i ωt dω. (B.2.18)
2π −∞ 2π −∞

Letting ω = ν + yields
   
1 2 +∞ +∞
C (t) = X(ν) Y() e i (ν + )t dν d
2π −∞ −∞
 +∞  +∞
1 1
= X(ν) e i ν t dν Y() e i t d = X(t) Y(t). (B.2.19)
2π −∞ 2π −∞

Hence, there are the following FT and IFT pairs for the convolution integrals

X(t) ∗ Y(t) ⇐==⇒ X(ω) Y(ω),


1 (B.2.20)
X(t) Y(t) ⇐==⇒ X(ω) ∗ Y(ω).

The Dirac Comb


The Dirac comb is defined as


−(t) = 
III δ(t−n), (B.2.21)
n=−∞
576 appendix b. digital signal processing

in which III −(t) is


− is the Cyrillic letter “Shah” used for its likeness to a comb. III

a periodic function with period ; in one period −/2 < t < /2, the functions is
−(t) = δ(t). III
III −(t) can be expanded in Fourier series




−(t) =
III CK e i Kωt , ω= , (B.2.22)
K=−∞


where  /2
1
CK = · δ(t) e−i Kωt dt = 1. (B.2.23)
 −/2

Hence, the Dirac comb can be rewritten as




−(t) =
III e i 2π K t/ . (B.2.24)
K=−∞

F
 
Using e i Bt = 2π δ(ω −B), the FT of III −(t) is

 +∞  +∞  ∞ 
 i 2πK t/ −i ωt
i−
II(ω) = III
− (t) e −i ωt
dt = e e dt
−∞ −∞ K=−∞

∞ 
∞  
F
  2πK
= e i 2π K t/ = 2π δ ω− . (B.2.25)
K=−∞ K=−∞


Hence, the FT of a Dirac comb is another Dirac comb as shown in Figure B.6, with
Fs = 1/s ,


∞ 

−s(t) = s
III δ(t−ns ) ⇐==⇒ i−
IIs( F ) = 2π δ( F −n Fs ). (B.2.26)
n=−∞ n=−∞

The “Box-Car” Function


Consider the “box-car” function in the time domain
 T T
1, − < t < ,
WT (t) =
b 2 2 (B.2.27)
0, otherwise,

in which the superscript “b” stands for “box-car” . Its FT is


 +∞  +T/2
−i ωt 1 −i ωt +T/2
WT (ω) = WT (t) e
b
dt = e−i ωt dt = e 
−∞ −T/2 −i ω t=−T/2

1  −i ω T T

2 ωT
= e 2 − ei ω 2 = ω sin , (B.2.28)
−i ω 2

which can be written as


sinπ T F
WT ( F ) = T = T sinc(π T F ), (B.2.29)
πT F
b.2 fourier series and fourier transforms 577

sinx
where sinc(x) = x is the “sinc” function.
Similarly, consider the “box-car” function in the frequency domain
 B B
1, − < F < ,
WB ( F ) =
b 2 2 (B.2.30)
0, otherwise.

Its IFT is
 +∞  +B/2
1
WB (t) = WBb ( F ) e i 2π F t d(2πF ) = e i 2π F t dF = B sinc(πBt). (B.2.31)
2π −∞ −B/2

In summary, as shown in Figure B.7, the FT and IFT pairs of the “box-car” are:
 T T
1, − <t< ,
WTb (t) = 2 2 ⇐==⇒ WT ( F ) = T sinc(π T F ),
0, otherwise.
 B B
(B.2.32)
1, − < F< ,
WB (t) = B sinc(πBt) ⇐==⇒ WBb ( F ) = 2 2
0, otherwise.

Figure B.7 shows that if a signal is of finite duration, then it has infinitely wide spectrum;
whereas if a signal has band-limited spectrum, then it must have infinite duration.
Therefore, it is impossible to have band-limited signals with finite duration.

B.2.3 Discrete-Time Fourier Transform


Suppose the continuous function X(t), −∞ < t < +∞, considered in Section B.2.2 is
discretized at time interval s to yield a sequence

Xn = X(tn ) = X(ns ), n = . . . , −2, −1, 0, 1, 2, . . . . (B.2.33)

The FT and IFT defined in equations (B.2.11) and (B.2.12) can be approximated
 ∞
∞
Xs (ω) = X(t) e−i ωt dt ≈ Xn e−i ωtn s ,
−∞ n=−∞
 +∞
1
X(tn ) = Xs (ω) e i ωtn dω,
2π −∞

which result in the discrete-time Fourier transform (DTFT) and the inverse discrete-time
Fourier transform (IDTFT)



DTFT Xs (ω) = s Xn e−i ω · ns , (B.2.34)
n=−∞

 +∞
1
IDTFT X(ns ) = Xs (ω)e i ω · ns dω. (B.2.35)
2π −∞
578 appendix b. digital signal processing

Suppose that the discretized sequence is obtained by digital sampling through the
−s(t), where III
Dirac comb III −s(t) is defined in equation (B.2.26), i.e.,



Xs (t) = X(t) III
−s(t) = s X(t) δ(t−ns ). (B.2.36)
n=−∞

Substituting equation (B.2.36) into equation (B.2.11) gives


 ∞  ∞
−i ωt


Xs (ω) = Xs (t) e dt = s X(t) δ(t−ns ) e−i ωt dt
−∞ −∞ n=−∞


= s X(ns ) e−i ω · ns, (B.2.37)
n=−∞

which is the same as equation (B.2.34).


On the other hand, using equation (B.2.20) results in
 ∞
1
Xs ( F ) = X( F ) ∗ i−
IIs( F ) = X(ν) i−IIs( F −ν) dν
2π −∞
 ∞
1 ∞ ∞
= X(ν) · 2π δ( F −n Fs −ν) dν = X( F −n Fs ). (B.2.38)
2π −∞ n=−∞ n=−∞

Equation (B.2.38) gives the mathematical foundation for Figure B.3 through DTFT.

B.2.4 Discrete Fourier Transform


The FT X(ω) of a function X(t) can be estimated from a finite number of its sampled
values. Suppose that X(t) are sampled at an even number of N points tn = ns ,
n = 0, 1, 2, . . . , N−1, with sampling interval s , and the sampled values are

Xn = X(tn ) = X(ns ), n = 0, 1, 2, . . . , N−1. (B.2.39)

Because the sampling frequency Fs = 1/s , it is possible to recover X(t) in the fre-
quency band − 12 Fs  F  1 Fs .
2 The FT at the following N frequency points are esti-
mated

K N N N
FK = = K F , K =− +1, − +2, . . . , . (B.2.40)
Ns 2 2 2

The upper limit F N/2 = 1/(2s ) = F max , and the Nyquist frequency F Nyquist = 2 F max =
1/s . F = 1/(Ns ) is the frequency resolution.
From equation (B.2.11), the discrete Fourier transform (DFT) is given by
 ∞ 
N−1 
N−1
X( F K ) = X(t) e−i 2π F K t dt ≈ Xn e−i 2π F K tn s = s Xn e−i 2πKn/N . (B.2.41)
−∞ n=0 n=0
b.2 fourier series and fourier transforms 579

Denote

N−1
XK = Xn e−i 2π Kn/N =⇒ X( F K ) ≈ s XK . (B.2.42)
n=0

Similarly, from equation (B.2.12), the inverse discrete Fourier transform (IDFT) is
 +∞
1 
N/2
Xn = X(tn ) = X(ω) e i 2π F tn d(2π F ) ≈ X( F K ) e i 2π F K tn F K
2π −∞ K=−N/2


N/2
1 1 
N/2
≈ (s XK ) e i 2π Kn/N = XK e i 2πKn/N . (B.2.43)
K=−N/2 N s N K=−N/2

From equation (B.2.42),



N−1 
N−1
XN−K = Xn e−i 2π(N−K)n/N = Xn e−i 2π n e−i 2π(−K)n/N
n=0 n=0


N−1
= Xn e−i 2π(−K)n/N = X−K , K = 0, 1, 2, . . . , N−1, (B.2.44)
n=0

which implies that XK is periodic in K with period N.


Hence, equation (B.2.43) can be rewritten as

1 
N−1
Xn ≈ X e i 2π Kn/N , n = 0, 1, 2, . . . , N−1. (B.2.45)
N K=0 K

The DFT maps N discrete real or complex values Xn , n = 0, 1, . . . , N−1, into N com-
plex numbers XK , K = 0, 1, . . . , N−1, and vice verse for the IDFT.
In summary, a continuous function X(t) sampled at N points can be indexed as
N N N
Xn = X(ns ), n = 0, 1, 2, . . . , N−1, or n = − +1, − +2, . . . , . (B.2.46)
2 2 2
N N N
For K = 0, 1, . . . , N−1, or K = − +1, − +2, . . . , , the DFT is
2 2 2


N−1 
N/2
DFT XK = Xn e−i 2πKn/N = Xn e−i 2π Kn/N , (B.2.47)
n=0 n=−N/2+1

N N N
and for n = 0, 1, . . . , N−1, or n = − +1, − +2, . . . , , the IDFT is
2 2 2

1  
N−1 N/2
IDFT Xn = X e i 2π Kn/N = 1 XK e i 2π Kn/N . (B.2.48)
N K=0 K N K=−N/2+1

The discrete form of Parseval’s theorem is


 

N−1 
 2 N−1 
N−1
1 
N−1
X  = X X̄ = Xn X e−i 2π Kn/N
n=0
n n n
n=0 n=0 N K=0 K
580 appendix b. digital signal processing

 
1   1 
N−1 N−1 N−1
= XK Xn e−i 2πKn/N = X X̄ ,
N K=0 n=0 N K=0 K K
i.e.,

N−1  2   2
N−1
X  = 1 X  . (B.2.49)
n N K=0 K
n=0

DFT is usually performed using fast Fourier transform (FFT) algorithms, e.g., MATLAB
function fft(X) computes the DFT of X using a FFT algorithm.

B.3 Digital Signal Processing


Figure B.8 is a schematic diagram showing the various components of digital signal
processing.
1. For a continuous signal X(t) of infinite duration, its Fourier amplitude spectrum
 
(FAS) X( F ) is also continuous and spans the entire spectral range.
−s(t) with sampling interval
2. To discretize the continuous signal, a Dirac comb III
−s(t) is also a Dirac comb
s is applied. The FT of the Dirac comb III i−
IIs( F )
with spectral interval being Fs = 1/s .
−s(t); its spectrum is give by the DTFT
3. The result is the discretized signal X(t) III
 
X( F ) ∗ i−
II ( F ), which is a periodic function with period Fs . There are aliasing
s
errors near ± Fs /2. Note that FT is continuous in the frequency domain.
4. It is not possible to have an infinite sequence of sampled values in practice. To
truncate the signal, a “box-car” function WTb (t) of length T is applied. The FT
 
of the “box-car” function is the sinc function, and the FAS W ( F ) has infinitely
T
many side lobes.
5. The result after applying the “box-car” function is a finite sequence of sampled
 
− (t) W (t) of duration T. The FAS is X( F ) ∗ i
values X(t) III b  −II ( F ) ∗ W ( F ),
s T s T
which is a periodic function with period Fs . The FAS is distorted from leakage due
to the side lobes in the sinc function and there are aliasing errors.
6. To discretize the continuous spectrum, a Dirac comb i−
II ( F )
F
with frequency
− (t) in the time domain.
resolution of F is applied. The IFT is a Dirac comb III
F
  
 
7. The final discrete FAS is the DFT  X( F ) ∗ IIs( F ) ∗ WT ( F ) i−
i− II ( F )
F
with
 
−s(t) WT (t) ∗
frequency resolution F . The corresponding digital signal is X(t) III b

− (t), resulting in a periodic digital signal of length T repeating periodically with


III
F
period 1/F . Hence, discretization of spectrum implies that the signal is rendered
periodic.
b.3 digital signal processing 581

Time Domain Frequency Domain


X(t) |X( f )|

(1)
⇒⇒

t f

− s(t)
III
(2) i−
IIFs( F )
⇒⇒

t f

s fs=1/ s

− s(t)
X(t) III |X(f ) ∗ i−
II s( F )|

(3)
⇒⇒

Aliasing Aliasing
t f

s
−fs/2 fs/2

|WT ( f )|
WTB(t)
(4)
⇒⇒

t f
T −1/T 1/T

− s(t) WT (t)
X(t) III |X(f ) ∗ i−
II s( F ) ∗ WT ( f )|
B

(5)
⇒⇒

t f

T −fs/2 −1/T 1/T fs/2

− (t)
III F
i−
II F ( F )
(6)
⇒⇒
t f

1/ f f

− s(t) WT (t)] ∗ III


[ X(t) III B
− (t)
|[X(f ) ∗ i−
II ( F ) ∗ WT ( f )] i−
s
II F ( F )|
F

(7)
⇒⇒

t f

1/ f f

Figure B.8 Digital signal processing.


582 appendix b. digital signal processing
W(t)
1.0 Rectangular “box-car”

0.8
Hamming
0.6
Triangular
0.4

0.2
Hanning
t
−T/2 0 T/2
30
|W(ω)|

20
Rectangular “box-car”
10 Side lobes

ω
−5 −4 −3 −2 −1 0 1 2 3 4 5
2
log10 |W(ω)| Hamming Hanning
Rectangular “box-car” Triangular
1
1 2 3 4 ω 5
0

−1

−2

−3

−4

−5
Figure B.9 Window functions.

Table B.1 Window functions


Window Function W(t) Fourier Transform W(ω)
 T T T
“Box-Car” 1, − < t < , 2 sin ω
2 2 2
(Rectangular) 0, otherwise. ω

⎪ 2 T T

⎪ T t+ , − < t < 0,
⎨ 2 2
8 sin 2 T
Bartlett 2 T T 4ω
⎪ 2− t+ , 0 < t< ,
(Triangular) ⎪ T 2 2 T ω2


0, otherwise.
⎧   T
⎨ 1 − 1 cos 2π t + T , − T <t< T , 4π 2 sin ω
2 2 T 2 2 2 2
Hanning  
⎩0, otherwise. ω (2π )2 −(Tω)2

⎧    
⎨ 27 − 23 cos 2π t + T , − T <t< T , 4 27π 2 −(Tω)2 sin T ω
50 50 T 2 2 2 2
Hamming  
⎩0, otherwise. 25ω (2π )2 −(Tω)2
b.3 digital signal processing 583

From Figure B.8 and the preceding procedure, the following issues and challenges
involved in signal processing can be readily uncovered:
❧ Sampling a signal at intervals of s or at rate Fs results in periodic replicas of
spectrum with period Fs , which in turn results in aliasing errors. As discussed
in Section B.1, if the maximum frequency of interest is F max , then the Nyquist-
Shannon Sampling Theorem requires that Fs  2 F max ; in practice, Fs = 2.5 F max to
3.0 F max is usually taken.

The frequency resolution F = 1/(Ns ) depends on the number of sampling points


N and sampling interval s . Because s is constrained by the Nyquist-Shannon
Sampling Theorem and cannot be too large, the frequency resolution can be in-
creased (F reduced) by increasing the number of sampling points N, which leads
to increased length of observation (sampling) Ns of the signal.

To eliminate aliasing errors, frequency components higher than F max in the signal
should be removed through a low-pass filter.

For example, consider an earthquake accelerogram of duration T = 30 s. If the high-


est frequency of interest is F max = 100 Hz, then the minimum sampling frequency
Fs = 2 F max = 2×100 = 200 Hz, and the largest sampling interval is s = 1/ Fs =
1/200 = 0.005 s. There are N = T/s = 30/0.005 = 6000 sampling point. The fre-
quency resolution is F = 1/(Ns ) = 1/T = 1/30 = 0.033 Hz. To increase the fre-
quency resolution by reducing F to 0.025 Hz, the length of observation becomes
1/F = 1/0.025 = 40 s. Hence, 0’s have to be added at the end of the accelerogram
to extend its duration to 40 s. The resulting discrete signal becomes a periodic
function of period 40 s (the first 30 s of each period is the discretized earthquake
accelerogram and the last 10 s is padded by 0’s) discretized at intervals of 0.005 s.
❧ When a “box-car” function is applied to truncate the signal to a finite duration T,
there is significant spectral leakage due to the large side lobes of the sinc function.
Leakage makes the spectrum only an approximation of the true spectrum of the
original input signal. Various window functions, summarized in Table B.1 and
illustrated in Figure B.9, have been developed to reduce leakage. The side lobes of
the triangular, Hanning, and Hamming window functions are much smaller than
those of the “box-car” window; the FT of the window functions are plotted in the
logarithmic scale in Figure B.9 to present the small side lobes more clearly.
584 appendix b. digital signal processing

B.4 Digital Filters


Given a signal X(t), from equation (B.2.20), it is well known that

Y(t) = H(t) ∗ X(t) ⇐==⇒ Y(ω) = H(ω) X(ω). (B.4.1)

The objective of applying a filter H(t) to a signal X(t), in the form of (B.4.1), is to make
Y(ω) = H(ω) X(ω) possess some desired frequency characteristics. For example,
 
• Low-pass filter − removes frequency content of X(t) for  F  > Fc ;
 
• High-pass filter − removes frequency content of X(t) for  F  < Fc ;
   
• Band-pass filter − removes frequency content of X(t) for  F  < Fc1 and  F  > Fc2 ;
 
• Band-stop filter − removes frequency content of X(t) for Fc1 <  F  < Fc2 .
In the discrete form Xn = X(ns ), the continuous convolution H(t) ∗ X(t) becomes


Yn = HK Xn−K = HK ∗ Xn . (B.4.2)
K=−∞

In practice, it is impossible to have infinitely many discrete terms in the filter HK ; if


(2M+1) terms are taken in equation (B.4.2), one has an (2M)th-order finite impulse
response (FIR) filter described by the difference equation:


M
Yn = HK Xn−K . (B.4.3)
K=−M

The discrete form of equation (B.4.1) becomes


M
Yn = HK ∗ Xn = HK Xn−K ⇐==⇒ Ym = Hm Xm , (B.4.4)
K=−M

where Hm and Xm are the DFT of H(t) and X(t), respectively. Hence, Ym = Hm Xm
is the DFT of the filter output.
Consider a low-pass filter with the desired H( F ) given by
  
1,  F  < Fc ,
H( F ) =   (B.4.5)
0,  F  > Fc ,
 
i.e., frequency components with  F  > Fc are removed. H( F ) given by equation (B.4.5)
is the “box-car” function given by equation (B.2.30); from equation (B.2.32), its IFT
H(t) and the discrete values of Hn are

H(t) = 2 Fc sinc(2π Fc t), (B.4.6)

Hn = 2 Fc sinc(2π Fc · ns ), −∞ < n < +∞. (B.4.7)


b.4 digital filters 585
100 hnm

tn
−0.20 −0.15 −0.125 −0.10 −0.05 0 0.05 0.10 0.125 0.15 0.20
−20

1.0 wnm-blackman
0.8
0.6
0.4
n= −M= −25 n = M=25
0.2
tn
−0.20 −0.15 −0.125 −0.10 −0.05 0 0.05 0.10 0.125 0.15 0.20

100
hnm-blackman = hnm wnm-blackman

tn
−0.20 −0.15 −0.125 −0.10 −0.05 0 0.05 0.10 0.125 0.15 0.20
−20

Gibbs phenomenon H m ( fk ) H( f )
1.0 Transition region
0.8
Transition region
0.6
0.4
H m-blackman ( fk )
0.2
fk
−100 −80 −60 −50 −40 −20 0 20 40 50 60 80 100

Figure B.10 FIR low-pass filter.

The “sinc” function is symmetric about n = 0 and infinite in extent. Suppose only a
finite-length section of Hn is selected as

Hn , −M  n  M,
Hn =
m
(B.4.8)
0, otherwise,

which is equivalent to multiplying the sequence Hn by a rectangular or “box-car”


window extending from −M to M.
The frequency response of the filter is given by the DFT of equation (B.2.47)


N/2 
M
HK = Hn e−i 2π Kn/N = Hnm e−i 2πKn/N , (B.4.9)
n=−N/2+1 n=−M

1 N N N
H( F K ) = H(K F ) = s HK , F = , K =− +1, . . . , −1, . (B.4.10)
Ns 2 2 2

The results of Hnm and H m ( F K ) are shown in Figure B.10 for sampling interval s = 0.005 s,
duration T = 40 s, N = 8000, F = 1/T = 0.025 Hz, Fc = 50 Hz, M = 25.
It is seen that there are large ripple-like oscillatory errors in H( F K ), known as Gibbs
 
phenomenon, which increase in magnitude close to the discontinuities at  Fc  = 50 Hz.
586 appendix b. digital signal processing

Window functions wn are usually multiplied to Hn to reduce Gibbs phenomenon.


For example, the Blackman window function is given by
⎧    
⎨0.42 − 0.5 cos 2π n+M + 0.08 cos 4π n+M , −M  n  M,
wnm-blackman
= 2M 2M

0, otherwise,

which is shown in Figure B.10. The integer n corresponds to discrete time tn = ns .
The resulting filter becomes

Hnm-blackman = Hnm wnm-blackman . (B.4.11)

In the time domain, the integer n corresponds to discrete time tn = ns .


The frequency response of the filter H m-blackman ( F K ) is also shown in Figure B.10.
In the frequency domain, the integer K corresponds to discrete frequency F K = KF . It is
seen that Gibbs phenomenon has been significantly reduced by the Blackman window.
However, a side effect of reducing Gibbs phenomenon by applying a window function
is an increased transition region. There are also other popular window functions, such
as the Chebyshev and the Kaiser window functions.

B.5 Resampling
Consider a continuous signal X(t) with FT X( F ). It has been sampled with interval s
(sampling rate Fs ) to yield a discrete sequence

Xn = X(tn ) = X(n s ), −∞ < n < +∞, (B.5.1)

and the DTFT is Xs ( F ). Sometimes, it is necessary to change the sampling interval to


 s to yield
Xn = X(tn ) = X(n  s ), −∞ < n < +∞. (B.5.2)

☞ It should be noted that the new sampling rate Fs = 1/ s must still satisfy the
Nyquist sampling requirement Fs  2 F max .

Sampling Rate Reduction


Suppose the sampling rate is reduced by an integer factor D, i.e., Fsd = Fs /D or
ds = Ds to yield


Xnd = X d(n ds ) = X(n · Ds ) = X(r s ) δ(r−n D), (B.5.3)
r=−∞

where the superscript “d” stands for “downsampling” or “decimation”. The case of
downsampling with D = 3 is illustrated in Figure B.11.
b.5 resampling 587

X(ns) Original sampling

Continuous signal X(t) s


n
0 1 2 3 4

X d(nds )
Downsampling D =3
ds = Ds
n
0 1 2

X u(nus )
Upsampling U = 2
us = s /U
n
0 1 2 3 4

Figure B.11 Resampling.

The DTFT of the downsampled signal Xnd , −∞ < n < +∞, is


 +∞


Xsd( F ) = X d(t) e−i 2π F t dt = X d(n ds ) e−i 2πF · ns ds
d

−∞ n=−∞
 

∞ 

X(r s ) δ(r−n D) e−i 2π F · ns ds
d
=
n=−∞ r=−∞
 
∞ 

δ(r−n D) e−i 2π F · (r/D)s ds .
d
= X(r s ) (B.5.4)
r=−∞ n=−∞

Note that


1 
D−1
δ(r−n D) = e i 2π mr/D , (B.5.5)
n=−∞ D
m=0

because it is a periodic function of period D and can be expressed in Fourier series.


Substituting equation (B.5.5) into equation (B.5.4) gives
 


1 
D−1
Xsd( F ) i 2π mr/D
e−i 2πF · (r/D)s (Ds )
d
= X(r s ) e
r=−∞ D
m=0
 

∞ 
D−1 
D−1 

= s Xr e−i 2π [−m/(Ds)+ F ] (r s) = s Xr e−i 2π [ F−m Fs /D] (r s) ,
r=−∞ m=0 m=0 r=−∞

which yields

D−1    D
−1
F
Xsd( F ) = Xs F −m Ds = Xs ( F −m Fsd ). (B.5.6)
m=0 m=0

Xsd( F ) results from superimposing replicas of Xs ( F ) at m( Fs /D), m = 0, 1, . . . , D −1,


as shown in Figure B.12.
588 appendix b. digital signal processing

X( f ) Continuous spectrum

f
−B B

Xs( f ) Discrete spectrum fs 2B

f
−B B
fs fs

Xsd( f ) Downsampling fs D (2B)

D=3

f
−B B
fsd fsd fsd /
fsd = fs D fsd

Xsu( f ) Upsampling

U=2
f
−B B
fs fs

Figure B.12 Resampling.

Xs( f ) Discrete spectrum fs D (2B)

f
−B B
fs fs
Xsd( f )
D =3
Aliasing Aliasing Aliasing Aliasing Aliasing Aliasing Aliasing Aliasing

f
−B B
fsd fsd fsd fsd fsd /
fsd = fs D fsd fsd

Xs( f ) Discrete spectrum fs D (2B )

Low-pass filter
f
−B  B
fs fs

Xsd( f )
D =3

f
−B  B
fsd fsd fsd fsd fsd /
fsd = fs D fsd fsd

Figure B.13 Downsampling.


b.6 numerical example − gaussian white noise 589

As illustrated in Figure B.13, there is aliasing if Fsd = Fs /D is less than the Nyquist
rate; in other words, the sampling rate can be reduced by a factor of D without aliasing
if the original sampling rate Fs is at least D times the Nyquist rate F Nyquist = 2B, i.e.,
Fs  D (2B). If this condition is not satisfied, a low pass filter can be applied to the
original signal to reduce its bandwidth to B so that Fs  D (2B ) before downsampling.

Sampling Rate Increase


Suppose the sampling rate is increased by an integer factor U, i.e., Fsu = U Fs or
us = s /U to yield
   
X n · s , n = 0, ± U, ±2U, . . . ,
Xnu = X u(n us ) = U
0, otherwise,


= X(r s ) δ(n−r U), (B.5.7)
r=−∞

where the superscript “u” stands for “upsampling” . The case of upsampling for U = 2
is illustrated in Figure B.11, in which an extra sampling point is added between two
adjacent original sampling points and 0 is assigned at the new sampling points.

☞ In the digital signal processing literature, the upsampling operation is also called
“interpolation” . However, only 0 is filled at the new sampling points, and no
attempt is made to “interpolate” the missing data values.
The DTFT of the upsampled signal Xnu , −∞ < n < +∞, is
 +∞


Xs ( F ) = X u(t) e−i 2πF t dt = X u(n us ) e−i 2πF · ns us
u u

−∞ n=−∞
 

∞ 

X(r s ) δ(n−r U) e−i 2πF · ns us
u
=
n=−∞ r=−∞


1 

= X(r s ) e−i 2πF · r U (s/U) (s /U ) = · s Xr e−i 2πF · rs,
r=−∞ U r=−∞
which yields
Xsu( F ) = U1 Xs ( F ). (B.5.8)

As shown in Figure B.12, there is no aliasing in upsampling a digital signal.

B.6 Numerical Example − Gaussian White Noise


Gaussian white noise (GWN) is a stationary random process with constant FAS or PSD,
and its PDF is normal distribution.
590 appendix b. digital signal processing

Matlab is a software package widely used in digital signal processing. Function


wgn(m,n,p) can generate an m×n matrix of GWN. p specifies the power PdBW of
GWN in decibel-watts (dBW), which is related to the power P W in watts (W) as
 
PdBW = 10 log10 P W /(1W) . (B.6.1)

As an example, consider a GWN time-history X(t) with duration T = 50000 s and


time interval s = 0.005 s. The length of X(t) is

T 50000
N= = = 107 . (B.6.2)
s 0.005
The sampling frequency Fs = 1/s = 200 Hz, and the frequency resolution is given by
F = 1/T = 0.00002 Hz. X(t) is generated using Matlab function wgn(m,n,p) with
m = 107 , n = 1, and p = 0 (implying PdBW = 0 or P W = 1 W). Because there are too
many points in the time-history, only a small portion is plotted in Figure B.14(a).
X( F ) of X(t) is computed based on DFT. Matlab function fft(x), where X(t) is
input as x, is employed to obtain DFT XK of X(t) first. X( F K ) is then determined by
multiplying XK by time interval s = 0.005 s using equation (B.2.42).
Because F = 1/T, the longer the duration T of the time-history, the higher the
resolution (or the smaller the value of F ) of the corresponding FAS.Although GWN is
 
a stationary random process with constant X( F ), X(t) is only one realization of GW;
hence, the corresponding FAS will be quite scattered. For duration T = 50000 s, FAS is
able to distinguish very small frequency difference of F = 0.00002 Hz, far smaller than
frequency resolution range (e.g., F = 0.02 Hz) of engineering interest. Figure B.14(b)
shows a small portion of FAS, which seemingly does not provide much information.
 
Therefore, in engineering applications, it is necessary to smooth the FAS X( F ) by
reducing its frequency resolution. Taking  F = 0.02 Hz as an example, the length of the
 
smoothed FAS is N = 2×100/0.02 = 10000. The smoothed FAS X  are evaluated
 
at frequencies F n = n  F , − 5000  n  5000. X  is determined as

 2 1   2
999
 X ( F ) = X( F n +0.00002K) , (B.6.3)
n 1000 K=0

i.e., the frequency components F n +0.00002K, K = 0, 1, . . . , 999 are all considered as


frequency component F n . Equation (B.6.3) ensures that the energy of X(t) would not
change during the smoothing (frequency resolution reduction) process. The smoothed
FAS is shown in Figure B.14(c). It is seen that the smoothed FAS is much closer to that
of a white noise process. In engineering practice, it is common to plot the one-sided
FAS, i.e., F  0, as shown in Figure B.14(d).
b.6 numerical example − gaussian white noise 591

 
Figure B.14(e) presents the FAS X( F ) with frequency resolution of  F = 0.05 Hz,
with number of frequency points N = 2×100/0.05 = 4000. It is seen that, with the
reduction of frequency resolution (increase of F ), a smoother FAS is obtained. Figure
B.14(f) shows the one-sided FAS.
The energy of X(t) is given by

e = T · P W = 50000×1 = 50000 W · s = 50000 N · m. (B.6.4)

On the other hand, the total energy of X(t) is given by the Parseval’s theorem in the
discrete form


N−1  
N−1 
e= X 2 s =
n
X( F )2 F = 50000 N · m. (B.6.5)
n=0 K=0
 
Because X(t) is a GWN process, X( F ) is a constant over the entire frequency range.
Equation (B.6.5) becomes

    e
e = N X( F )2 F =⇒ X( F ) = . (B.6.6)
N F

Equation (B.6.6) is independent of how the frequency resolution is reduced:


  
 
X( F ) = e e e
= =
N F
N F N  F

  
50000 50000 50000
= = = = 15.81. (B.6.7)
10 ×0.00002
7 10000×0.02 4000×0.05

Note that for one-sided FAS, 1-sideF = 2-side


F and N 1-side = 12 N 2-side . Hence,
 
 1-side 
X e √ e √  
( F ) = = 2· = 2 · X 2-side ( F ). (B.6.8)
N 1-side 1-side
F N 2-side 2-side
F
 2
☞ It should be emphasized √
that, because FAS is related to energy through X( F ) ,
one-sided FAS is 2 times of two-sided FAS, not twice of two-sided FAS.
    √
For this GWN process, X 2-side ( F ) = 15.811 and X 1-side ( F ) = 2×15.811 = 22.36.

Digital Filters
Figure B.14(g) shows the filtered-GWN by passing GWN through a low-pass filter with
cut-off frequency Fc = 30 Hz. The digital filtering is performed using Matlab function
fftfilt(b,x), where the GWN X(t) is input as x. b=fir1(n,Wn,ftype,window) is
used to determine window-based filter coefficients, in which n is the order of the filter;
n = 2M in equation (B.4.3). Wn is the normalized cut-off frequency defined as the
592 appendix b. digital signal processing
4
(a)
2
X(t)
0

−2
t (s)
−4
0 1 2 3 4 5 6 7 8 9 10

50
(b) Frequency resolution = 0.00002 Hz, two-sided FAS (partial)
40
|X( f )|

30
20
10
0
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
f (Hz)
20
(c)
|X( f )|

15
Frequency resolution = 0.02 Hz, two-sided FAS
f (Hz)
10
−100 −80 −60 −40 −20 0 20 40 60 80 100

25
|X( f )|

Frequency resolution = 0.02 Hz, one-sided FAS


(d) f (Hz)
15
0 10 20 30 40 50 60 70 80 90 100

20
(e)
|X( f )|

15
Frequency resolution = 0.05 Hz, two-sided FAS
f (Hz)
10
−100 −80 −60 −40 −20 0 20 40 60 80 100

25
|X( f )|

20
Frequency resolution = 0.05 Hz, one-sided FAS
(f) f (Hz)
15
0 10 20 30 40 50 60 70 80 90 100

3
(g)
2
1
X(t)

0
−1
−2 Filtered-GWN, f c =30 Hz, Δ s =0.005 s, M =25 t (s)
−3
0 1 2 3 4 5 6 7 8 9 10

20
(h)
15 M =25 Frequency resolution = 0.02 Hz
|X( f )|

10 Filtered-GWN, f c =30 Hz M =15 two-sided FAS


5
f (Hz)
0
−100 −80 −60 −40 −30 −20 0 20 30 40 60 80 100

30

20 M =25 Frequency resolution = 0.02 Hz


|X( f )|

one-sided FAS
10 Filtered-GWN, f c =30 Hz M =15
(i) f (Hz)
0
0 10 20 30 40 50 60 70 80 90 100

Figure B.14 GWN time-history and corresponding FAS.


b.6 numerical example − gaussian white noise 593
1.5
(a)
1.0 Filtered-GWN, f c = 30 Hz, Δ s =0.005 s, M = 25, upsample U =5, Δus =0.001 s
X(t) 0.5
0.0
−0.5
t (s)
−1.0
6.20 6.22 6.24 6.26 6.28 6.30 6.32 6.34 6.36 6.38 6.40

3
(b)
2
1
X(t)

0
−1
−2 Filtered-GWN, f c = 30 Hz, Δ s =0.005 s, M = 25, upsample U =5, Δus =0.001 s
t (s)
−3
5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10

30
Filtered-GWN, f c =30 Hz, M =25 Frequency resolution = 0.02 Hz
|X( f )|

20
one-sided spectrum
10 (c) Filtered-GWN, f c = 30 Hz, M = 25, upsample U =5
f (Hz)
0
0 10 20 30 40 50 60 70 80 90 100
Figure B.15 Upsampling of filtered-GWN.
3
(a)
2
1
X(t)

0
−1
−2
Filtered-GWN, f c =50 Hz, Δ s =0.005 s, M =25 t (s)
−3
0 1 2 3 4 5 6 7 8 9 10
3
(b)
2
1
X(t)

0
−1
−2
Filtered-GWN, f c =50 Hz, Δ s =0.005 s, M =25, downsample D =2, Δds =0.01 s t (s)
−3
0 1 2 3 4 5 6 7 8 9 10
30
Aliasing
|X( f )|

20
Frequency resolution = 0.02 Hz Filtered-GWN, f c =50 Hz, M =25, downsample D = 2
10 one-sided FAS Filtered-GWN, f c =50 Hz, M =25
(c) f (Hz)
0
0 10 20 30 40 50 60 70 80 90 100
3
(d)
2
1
X(t)

0
−1
−2
Filtered-GWN, f c =40 Hz, Δ s =0.005 s, M =25 t (s)
−3
0 1 2 3 4 5 6 7 8 9 10
3
(e)
2
1
X(t)

0
−1
−2
Filtered-GWN, f c =40 Hz, Δ s =0.005 s, M =25, downsample D =2, Δds = 0.01 s t (s)
−3
0 1 2 3 4 5 6 7 8 9 10
30
Filtered-GWN, f c =40 Hz, M =25, downsample D =2
|X( f )|

20
Frequency resolution = 0.02 Hz
10
(f)
one-sided FAS Filtered-GWN, f c =40 Hz, M =25 f (Hz)
0
0 10 20 30 40 50 60 70 80 90 100
Figure B.16 Downsampling of filtered-GWN.
594 appendix b. digital signal processing

ratio of cut-off frequency Fc to Nyquist frequency. ftype indicates the type of filter,
such as ’low’ for low-pass and ’high’ for high-pass filters. window includes a num-
ber of commonly used window functions. b=fir1(50,0.3,’low’,blackman(51))
 
is used in Figure B.14(g) to remove frequency contents with  F  > Fc ( Fc = 30 Hz and
F Nyquist = 100 Hz giving Wn = 30/100 = 0.3). The Blackman window function is applied
with M = 25.
The two-sided and one-sided FAS of the filtered process are shown in Figure B.14(h)
and (i), respectively. The filtered process is a “band-limited GWN” with a constant
 
FAS for  F  < Fc . However, as discussed in Section B.4, due to the use of a window
function in digital filter, there is a significant transition region between 20 and 40 Hz.
The transition region can be reduced by increasing the order of the filter, i.e., the value
of M; as seen in Figure B.14(h) and (i), the transition region with M = 25 is smaller
than that with M = 15.

Upsampling
Based on the filtered-GWN with Fc = 30 Hz and M = 25, as shown in Figure B.14(g),
Figure B.15(a) and (b) shows portions of the time-history from upsampling with U = 5
(giving the new sampling interval us = 0.001 s). The resulting FAS of the time-history
from upsampling is shown in Figure B.15(c) along with the FAS of the filtered-GWN. It
is clearly seen that the two FAS satisfy equation (B.5.8) with U = 5.

Downsampling
A portion of the time-history of filtered-GWN with Fc = 50 Hz and M = 25 is shown
in Figure B.16(a), and the corresponding downsampled time-history with D = 2 (lead-
ing to ds = 0.01 s) is shown in Figure B.16(b). For the downsampled time-history,
Fsd = 1/ds = 100 Hz and the maximum frequency range is F max  Fsd /2 = 50 Hz. The
resulting FAS from downsampling is shown in Figure B.15(c) along with the FAS of the
original filtered-GWN. Even though F max = Fc = 50 Hz = Fsd /2 satisfying the Nyquist-
Shannon sampling requirement, there is still aliasing error near 50 Hz due to the
existence of transit region from digital filtering.
Similar results are shown in Figure B.16(d) to (f) for filtered-GWN with Fc = 40 Hz
and M = 25. In this case, F max = 40 Hz and Fsd = 100 Hz, resulting in Fs = 2.5× F max .
From Figure B.16(f), it is seen that, for F  50 Hz, FAS of the downsampled signal is
the same as the original signal and there is no aliasing error.

☞ Therefore, to avoid aliasing errors, it is recommended that Fs  2.5× F max .

You might also like