Upload
jose-dempsey
View
217
Download
0
Tags:
Embed Size (px)
Citation preview
DSP—Revision I
http://www.dcs.warwick.ac.uk/~feng/dsp.html
Content• 1. Sequences and their representation • 2. Digital Filters• 3. Nonrecursive Filters• 4. Recursive Filters• 5. Frequency and digital filters• 6. Sampling and reconstruction• 7. Signal correlation and matched filters• 8. Dealing with noise• 9. Data compression• three weeks on FFT etc.• 10. Image feature extraction• 11. Image enhancement
2.3 Filters
General form
N
m
mm
N
m
mm
N
m
mm
N
m
mm
N
m
mm
N
m
mm
zb
za
zX
zYzH
zXzazYzb
nyDbnxDany
1
0
01
10
)1()(
)()(
)()()1(
)()()(
H is called the transfer function of the filter
4.3 Poles and zeros
kz
z
zH
m
nn
m
nn
1
1
N-1-
-N-1
)(
)(
b(N)zb(1)z-1
a(N)za(1)za(0))(
n is called poles, n is zeros
xzero
x
pole
A filter is fully determined by its poles and zeros
4.6 Three domains of representation
1. Time domain representation
Hx(n) y(n)
y(n)= b(1)y(n-1)+…+b(N)y(n-N) +a(0)x(n)+a(1)x(n-1)+…+a(N)x(n-N)
2. z--domain representation
))...((
))...((
)(...)1(
)(...)1()0()(
1
11
1
N
NNN
NN
zz
zzK
Nbzbz
NazazazH
K
1
x
X
1
2
2
3
3. frequency--domain representation
H()=H(z)|z=exp(j
|H()|
phase
ExampleTime: y(n)-y(n-1)+0.5y(n-2)=3x(n)-2x(n-1)
Z-domain: H(z)=(3-2z-1)/(1-z-1+0.5z-2)
= (3z2-2z)/(z2-z+0.5)
Zeros: 0, 2/3
Poles: 1/1.414 exp(j pi/4), 1/1.414 exp(-j pi/4)
It is BIBO stable
Frequency-domain:
Principle of filter design
1. We specify what the filter passes (the sign) and stop (the disturbance) in the frequency domain
2. Then we determine poles and zeros in the z-domain from the passband and the stopband
3. Finally, the filter is implemented recursively by the difference equation in the time domain
We can see that if the signal x(t) is bandlimited, in the sense that X(F)=0 for |F|>FB, for some frequency FB called the bandwidth of the signal, and we sample at a frequency Fs>2FB, then there is no overlapping between the repetitions on the frequency spectrum. In other words, if Fs>2FB,
Xs(F)=FsX(F) in the interval –Fs/2<F<Fs/2
And X(F) can be fully recovered from Xs(F). This is very important because it states that the signal x(t) can be fully recovered from its samples x(n)=x(nTs), provided we sample ‘fast enough’ (meaning Fs>2FB)
6.2.1 downsampling
(… x(-2) x(-1) x(0) x(1) x(2) ….)
(… y(-1) y(0) y(1) … )
)(2
1)(
2
1
))(12(2
1))(12(
2
1))(2(
))(12(2
1))(12(
2
1))(2(
))(2()2()()(
12122
12122
2
zXzX
zkxzkxzkx
zkxzkxzkx
zkxzkxzkyzY
k
k
k
k
k
k
k
k
k
k
k
k
k
k
k
k
k
k
6.2.2 Upsampling
(… x(-1) x(0) x(1) ….)
(… y(-2) 0 y(0) 0 y(2) … )
)(
))(()()()(
2
22
zX
zkxzkxzkyzYk
k
k
k
k
k
Example: Haar wavelet
Definition 1 (The Haar scaling function) Let H be defined by H(t)=1, 0<t<=1, and 0 elsewhere
12,...1,0,...,1,0),2(2)(, jjjji ijitHtH
The index j refers to dilation and i refers to translation
Haar wavelet transform of a signal
...
3,23,22,22,21,21,20,20,2
1,11,10,10,1
0,00,00,00,0
GGfGGfGGfGGf
GGfGGf
GGfHHff
For any f as function in [0,1]. The decomposition is unique since {Gi,j} is orthogonal, and it forms a basis in L2
7.2 Correlation
)()()(
)()(
)()()(
nrnmxmx
mxnmx
mxmnhny
xxk
k
k
Its Z transform is
R(z)=X(z)X(z-1)
auto-correlation function
In general we have
cross-correlation function
R(z)=X(z)Y(z-1)
n
xy nmymxnR )()()(
8.1.3 Gaussian variables
Mean=, variance=
x=(…x(-2),x(-1),x(0),x(1),x(2),…) each of them is a Gaussian variable, then
is again a normal random variable with a mean and variance.
2
2
2
)(exp
2
1)(
x
xp
n
nxnhxh )()(
W(n)=x(n)+v(n)
Assume we know the signal sequence
x(1), x(2), ….,x(N)
How to design a filter so that we can detect the presence of the signal?
There are many ways to do it. The simplest and classical one is called
linear correlation detector.
9.3.1 Wiener Filter
Signal x
Received signal y=x+n
Minimize E(x-ay)^2 to find that
yEy
ENEyy
ENEx
Exayx
ENEx
Exa
2
22
22
2
22
2
Concentrating on transform coding
• Distributed multimedia
• JPEG, MPEG
• Using discrete cosine transform (DCT), a special case of DFT
10. Feature extraction
10.1 Matched filter
10.2 Gradient estimation
10.2 Local transforms
11. Enhancement
11.1 Contrast enhancement
11.2 Deblurring
11.3 Denoising
11.1 Contrast enhancement
• Histogram Equalization
Note how the image is extremely grey; it lacks detail since the
Example
Let x(i) be Gaussian random variables with mean zero and variance 1, and
y(n)= sin(n/2)x(n)+ sin((n-1)/2)x(n-1)+ sin((n-2)/2)x(n-2)+sin((n-3)/2)x(n-3)
Find Ey(n), E(y(n)-Ey(n))2, and the distribution of y(n)