digital signal - ksu · to reduce statistical noise for small number of samples ... li tan, digital...
TRANSCRIPT
![Page 1: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/1.jpg)
Digital Signal
1CEN543, Dr. Ghulam Muhammad
King Saud University
Continuous time
Co
nti
nu
ou
s am
plit
ud
e
Discrete time
Co
nti
nu
ou
s am
plit
ud
eDiscrete
time
Dis
cret
e am
plit
ud
e
Analog Signal
Discrete-time Signal
Digital Signal
![Page 2: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/2.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
2
A digital signal processing scheme
DSP (Digital Signal Processing)
To avoid aliasing for sampling
Analog to Digital Converter
Digital to Analog Converter To avoid aliasing
for sampling
Computer / microprocessor / micro controller/ etc.
![Page 3: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/3.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
3
Some Applications of DSP
• Noise removal from speech.Noisy Speech
Clean Speech
![Page 4: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/4.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
4
Some Applications of DSP
• Signal spectral analysis.
Time domain Frequency domain
Single tone: 1000 Hz
Double tone: 1000 Hz and 3000 Hz
![Page 5: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/5.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
5
Some Applications of DSP
• Noise removal from image.
![Page 6: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/6.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
6
Some Applications of DSP
• Image enhancement.
![Page 7: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/7.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
7
Summary Applications of DSP
Digital speech and audio:
• Speech recognition• Speaker recognition• Speech synthesis• Speech enhancement • Speech coding
Digital Image Processing:
• Image enhancement • Image recognition• Medical imaging• Image forensics• Image coding
Multimedia:• Internet audio, video, phones• Image / video compression• Text-to-voice & voice-to-text• Movie indexing
……..
![Page 8: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/8.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
8
For a given sampling interval T, which is defined as the time span between two sample points, the sampling rate is given by
samples per second (Hz).
For example, if a sampling period is T = 125 microseconds, the sampling rate isdetermined as fs =1/125 s or 8,000 samples per second (Hz).
Tf s
1
Sampling
![Page 9: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/9.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
9
Sampling - Theorem 2 / 23
7 / 23 22/ 23
![Page 10: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/10.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
10
Sampling - Theorem
The sampling theorem guarantees that an analog signal can be in theoryperfectly recovered as long as the sampling rate is at least twice as large asthe highest-frequency component of the analog signal to be sampled.
The condition is:
For example, to sample a speech signal containing frequencies up to 4 kHz, theminimum sampling rate is chosen to be at least 8 kHz, or 8,000 samples persecond.
![Page 11: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/11.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
11
Sampling - Theorem
Sampling interval T= 0.01 sSampling rate fs= 100 HzSinusoid freq. = 4 cycles / 0.1
= 40 Hz
Sampling condition is satisfied, so reconstruction from digital to analog is possible.
Do this by yourself!
![Page 12: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/12.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
12
Sampling Process
In frequency domain:
Xs(f): Sampled spectrumX(f): Original spectrumX(fnfs): Replica spectrum
![Page 13: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/13.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
13
Sampling Process
Original spectrum
Original spectrum plus its replicas
Original spectrum plus its replicas
Original spectrum plus its replicas
Reconstruction not possible
Minimum requirement for Reconstruction
![Page 14: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/14.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
14
Shannon Sampling Theorem
For a uniformly sampled DSP system, an analog signal can be perfectlyrecovered as long as the sampling rate is at least twice as large as thehighest-frequency component of the analog signal to be sampled.
The minimum sampling rate is called the Nyquist rate Half of the sampling frequency is called the folding frequency.
ttttx 100cos300sin1050cos3)(
Problem: Find the Nyquist rate for the following signal.
The maximum frequency present is 150 Hz = fmax.
Therefore Nyquist rate = 2× fmax = 300 Hz.
Solution:
![Page 15: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/15.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
15
Problem:Example 1
Solution:
Using Euler’s identity,
Hence, the Fourier series coefficients are:
![Page 16: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/16.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
16
Example 1 – contd.
a.
b. After the analog signal is sampled at the rate of 8,000 Hz, thesampled signal spectrum and its replicas centered at thefrequencies nfs, each with the scaled amplitude being 2.5/T
Replicas, no additional information.
![Page 17: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/17.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
17
Signal Reconstruction
![Page 18: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/18.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
18
Signal Reconstruction
Perfect reconstruction is not possible, even if we use ideal low pass filter.
Aliasing
![Page 19: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/19.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
19
Example 2Problem:
Solution:Using the Euler’s identity:
![Page 20: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/20.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
20
Example 2 – contd.
a.
b.The Shannon sampling theory condition is satisfied.
![Page 21: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/21.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
21
Example 3Problem:
Solution:
a.b.
![Page 22: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/22.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
22
Example 4Problem: Consider the analog signal ttttx 12000cos106000sin52000cos3)(
(a) What is the Nyquist rate for this signal?(b) What is the discrete-time signal after sampling it at Fs = 5000 samples/s?(c) What is the analog signal y(t) that we reconstruct from the samples if we use
ideal interpolation?
Solution: KHzFKHzFKHzF 6 ,3 ,1 321 (a)Max.
Nyquist rate = 2×6K Hz = 12K Hz.
(b)
nn
nnn
nnn
nnn
F
nxnTxnx
s
5
22sin5
5
12cos13
5
12cos10
5
22sin5
5
12cos3
5
112cos10
5
212sin5
5
12cos3
5
62cos10
5
32sin5
5
12cos3
)()(
(c)
ttty 4000sin52000cos13)(
Alias
![Page 23: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/23.jpg)
23
Decomposition and Synthesis
Any signal can be decomposed into additive components, and the component signals can be added (synthesis) to produce the original signal.
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 24: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/24.jpg)
24
Decomposition-1
Impulse decomposition:
N samples signal is decomposed into N component signals each containing N samples.
Zero
A component signal contains one point from the original signal, with the remainder of the values being zero.
Step decomposition:
k-th component signal, xk[n], contains zeros for points through 0 to k-1, while the remaining points have a value equal to x[k] – x[k-1].
CEN543, Dr. Ghulam Muhammad King Saud University
Impulse decomposition Step decomposition
![Page 25: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/25.jpg)
25
Even/Odd decomposition:
2
][][][
2
][][][
nNxnxnx
nNxnxnx
o
e
Mirror image around x[N/2]. x[0] and x[N/2] are equal to original value. Others like: x[N/2+1] = x[N/2-1].
Even symmetry:
Odd symmetry:
Negative mirror image around x[N/2]. x[0] and x[N/2] are equal to zero.
Others like: x[N/2+1] = -x[N/2-1].
Odd positions are zero!
Even positions are zero!
Decomposition-2
You can check the result by using the following formula:
][][][ nxnxnx oe
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 26: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/26.jpg)
26
Fourier Decomposition
N point signal
(N/2)+1 cosine signals, each with N points
(N/2)+1 sine signals, each with N points
Zero!
Zero!
So, total N significant signals!
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 27: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/27.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
27
Example 5
Problem:
Answer:
A signal is defined as x[n]={2, 3, 5, -2, -3, -5, -2, 2}; Find the result of even / odd decomposition. Index starts from 0.
Even symmetry: xe = {2, 2.5, 1.5, -3.5, -3, -3.5, 1.5, 2.5}
Odd symmetry: xo = {0, 0.5, 3.5, 1.5, 0, -1.5, -3.5, -0.5}
![Page 28: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/28.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
28
Sinusoid Drawing
44 ,4
2sin)(
tttx
![Page 29: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/29.jpg)
29
Mean and Standard Deviation
1
0
1 N
iix
NMean:
1
0
2)(1
1 N
iix
NStandard Deviation:
Mean = DC Value
S.D. = How the signal fluctuates around Mean (AC)
To reduce statistical noise for small number of samples
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 30: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/30.jpg)
30
Histogram
More sample produces smoother histogram
1
0
M
ii
HN
M = Number of points in the histogram
i
M
i
M
ii
HiN
iHN
21
0
1
0
)(1
1
1
Mean and S.D. using histogram:
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 31: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/31.jpg)
31
Histogram, pmf, pdf
Look at the values along y-axis
Discrete
Continuous
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 32: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/32.jpg)
32
Waveforms and pdfs
Look at the pdf of random noise.
It is Gaussian!
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 33: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/33.jpg)
33
Histogram Bins
The range 0-4 is divided by 600 in (b) and by 8 in (c).
Poor resolution in vertical axis: (b).
Poor resolution in horizontal axis: (c).
Using more samples makes better resolution.
Look at the vertical axis
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 34: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/34.jpg)
34
Normal Distribution (Gaussian)
2
)( xexy Basic shape: 2
2
2
)(
2
1)(
x
exPEquation for normal distribution:
: Mean
: Standard Deviation
The normalization term is to make the area under curve = 1
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 35: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/35.jpg)
35
Digital Noise Generation
Uniform distribution: one RND function (0~1)
Two times RND functions and add
Twelve times RND functions and add
Central Limit Theorem:
A sum of random numbers becomes normally distributed as more and more of the random numbers are added together.
Gaussian
For each sample:
S.D. desired : mean, desired:
)6(12
1~0
RND
CEN543, Dr. Ghulam Muhammad King Saud University
![Page 36: Digital Signal - KSU · To reduce statistical noise for small number of samples ... Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008. Steven W. Smith,](https://reader034.vdocument.in/reader034/viewer/2022042216/5ebf2c6895f37e131f49513e/html5/thumbnails/36.jpg)
CEN543, Dr. Ghulam Muhammad King Saud University
36
Figure Acknowledgement
Most of the figures are taken from the following books:
Li Tan, Digital Signal Processing, Fundamentals and Applications, Elsevier, 2008.
Steven W. Smith, Digital Signal Processing: A Practical Guide for Engineers and Scientists, Newnes, Elsevier, 2003.