Part3 - Z-Transform, Filter Analysis, Time-Frequency Analysis
Part3 - Z-Transform, Filter Analysis, Time-Frequency Analysis
Status In progress
Chapter 12: Laplace and z-Transform
12.0 Introduction
12.1 Laplace transform: continuous time, causal system
12.1.1 Laplace transform is a generalized one-sided Fourier transform
12.1.2 Laplace transform turns differential equations into algebraic equations
12.1.3 Transfer function of LTI system: H(s)
12.1.4 Effect of delay on Laplace transform
12.2 z -Transform: equivalent of the Laplace transform in discrete time system
12.3 Three tricks in finding the inverse
12.3.1 Partial fraction expansion
12.3.2 Polynomial division
12.3.3 Divide by z and compensate later
⭐Exercise: how to solve H(z) of a system
⭐Exercise: how to convert H(z) into H(f)
Chapter 16: Filter analysis
16.1 Ideal low pass filter
16.1.1 Characteristic
16.1.2 Mathematical expression
16.1.3 Attributes
16.2 Gibbs phenomenon
Chapter 17: Filter specification, Bode plot, Nyquist plot
17.1 Introduction
17.1.1 Filter specification
17.1.2 Filter characteristic (frequency response)
17.2 Cut-off frequency and -3dB point (half-power point)
17.3 Bode plot, Nyquist diagram
17.3.1 Bode plot
17.3.2 Nyquist plot
Chapter 18: Digital filters and filter design
18.1 Introduction
18.1.1 Linear digital filtering
18.1.2 Zeros and poles of linear digital filters
18.2 Different kinds of filter
18.2.1 IIR, FIR filter
18.2.2 AR, MA, ARMA filter
18.2.3 Causal vs non-causal filters
18.2.4 recognize frequency components in the signals
18.3 Filter characteristics of digital filter
18.3.1 frequency response of digital filters
13.3.2 Review: what does a linear filter do?
13.4 FIR filter design
13.4.1 Window method
13.4.2 classical IIR filters (each optimal in some way)
13.4.3 Implementation
13.4.4 Linear phase filter
Time-frequency analysis
1 Time and frequency resolution
2 Spectral leakage and windowing
3 short-time Fourier transform
4 Wavelets
12.0 Introduction
Transforms and solving equations
for some types of problems, the solution in the transformed domain is more easily calculated than
with a direct approach of finding a solution in the time or spatial domain
the idea of using a transformation is to make use of properties that make a problem easier to solve
in the transformed domain
some pair examples for transformation
12.1 Laplace transform: continuous time, causal system
https://www.youtube.com/watch?v=n2y7n6jw5d0
复数变量 s = σ + jω jω
时域 [0, +∞],适用于因果系统 [−∞, +∞]
可处理增大、非周期信号 | Laplace transform can 主要适用于能量有限、周期或稳态信号 | Fourier
适用信号
also handle exponential growth | transform can only handle pure sine waves |
contain both exponential growth or decay (σ ),
频域解析度 only contain oscillation (ω ) information
and oscillation (ω ) information
变换结果 得到信号的复频域complex plane (s = σ + jω) 得到信号的频谱(ω)
适用于解线性微分方程,控制系统分析,瞬态与 适用于频率域信号分解和分析,频谱分析和信号
应用
稳态分析 处理
12.1.2 Laplace transform turns differential equations into algebraic equations
Zero initial conditions: often assume the initial condition x(0) = 0 | in time domain |
L[ dx(t)
dt ] =
sL[x(t)]
dealing with differentiation is fairly straightforward in the transformed domain
When written in terms of the complex variable z for discrete time series, the Laplace transform
becomes the z -transform
12.3 Three tricks in finding the inverse
12.3.1 Partial fraction expansion
condition: the polynomial order of the numerator is smaller than that of the denominator
1. apply partial fraction expansion to separate the expression into a sum of basic components
2. use a lookup table to find the inverse transform for each basic component
sharp transition: would completely remove high frequencies while passing low-frequency
components unaltered
no ripples in pass and stop bands
Unfortunately, it cannot be perfectly built in real world, and doesn’t even work well when approximated
0, ∣ω∣ > ωc
sin(ωc t)
in time domain: h(t) = πt
16.1.3 Attributes
1. Non-causal impulse response
output for δ(t) input at t = 0 starts before 0
not possible for physical systems
2. Require infinite memory for digital implementation
infinite length impulse response
infinite steep frequency slope
3. Cause “ringing” effect near edges
convolve an ideal filter with a step causes ripples in its output
applying ideal low pass is like “truncating” Fourier series in the frequency domain |频率上截断|
1
2
out )
the Nyquist diagram shows the frequency characteristic as a complex-valued parametric function of
frequency.
the frequency response H(jω) can also be written as a complex-valued
number a + jb
the amplitude ∣H(jω)∣ = a2 + b2
与原点连线和Real Axis形成的夹角表示phase
Nyquist diagram
aM y (n − M )
we use z -transform to obtain the filter’s transfer function which is determined by two sets of
coefficients: b and a
a0 = 1
linear filters are determined by two set of coefficients b and a, “Filter design” is to find appropriate b
and a
t, h = scipy.signal.dimpulse( system = (b,a,dt) , n )
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lfilter.html
filter a data sequence x using a digital filter defined by band a
impulse response: h = signal.lfilter( b , a , r_[1,zeros(N-1)] )
impulse at n = 0 never completely disappears, but continues to influence the system indefinitely
IIR can be potentially unstable (if any pole outside unit circle)
finite impulse response (FIR) digital filter
filter output does’t depend on the previous output: for k ≥ 1, ak = 0
eg.: y(n) = a1 y (n − 1) + a2 y (n − 2)
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.freqz.html#scipy.signal.freqz
fs : the sampling frequency of the digital system
ω : the frequencies at which H was computed, in the same units as fs
2 : Nyquist frequency
fs
fn =
Because the ideal filter cannot be made (Gibbs phenomenon), we always need to
compromise in our approach to the ideal filter characteristic. This compromise
may vary with each application.
in some cases strong attenuation of noise is required, but phase response is
not critical
in other cases, where we want to accurately measure delays, the phase
response is critical.
in the real world, there is a tradeoff between a small transition band and a flat
phase response
13.4.1 Window method
解决在ideal filter中,冲激响应无限长(定义域为无穷)的问题,应用一个窗函数w(n)与hd (n)相乘从
而将冲激响应截断到有限长度。
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.firwin.html#scipy.signal.firwin
compute the coefficients of a finite impulse response filter
: length of the filter (number of coefficients). numtaps must be odd if a passband includes
numtaps
the Nyquist frequency
Cutoff : the cutoff frequency of filter OR an array of cutoff frequencies (band edges)
fs : sampling frequency
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html#scipy.signal.butter
Butterworth digital and analog filter design. Design an Nth-order digital or analog Butterworth
filter and return the filter coefficients.
Wn : cut-off frequency
btype : {‘lowpass’, ‘highpass’, ‘bandpass’, ‘bandstop’}, optional
f2 = k ∗ f1 will be shifted by k ∗ ϕ
ϕ 1
so than each component will be shifted the same amount in time: Δt = 2π ⋅ f
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.filtfilt.html#scipy.signal.filtfilt
This function applies a linear digital filter twice, once forward and once backwards. The combined filter
has zero phase and a filter order twice that of the original.
Time-frequency analysis
1 Time and frequency resolution
time resolution: Δt = 1
fs
problem from a wide main-lobe: using a window reduces spectrum leakage, at the expense of a
reduced effective frequency resolution
Hann window has a larger main-lobe width than the rectangular window
problem from high side-lobes: detect a weak signal (50Hz) in the presence of power law noise (strong
low frequency noise)
Hann window shows much better side-lobes attenuation than the rectangular window
https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.welch.html
nperseg : number of each segment, controls frequency and time resolution trade-off
4 Wavelets