Speech Processing
Lecture [2]
By
Dr. Gehad Ismail Sayed
Recap
• The unit impulse signal can be used as a basic building
block for the construction and representation of other
signals.
• According to the shifting property of signals, any signal
can be expressed as a combination of weighted and
shifted impulse signal
Linear Time-Invariant (LTI) System
• A system that possesses two basic properties namely linearity
and time invariant is known as linear time-invariant system or
LTI system.
• There are two major reasons behind the use of the LTI
systems
– The mathematical analysis becomes easier.
– Many physical processes through not absolutely LTI systems can be
approximated with the properties of linearity and time-invariance.
h(n) is called the impulse response of the LTI system
Convolution
• It is a mathematical tool which is used to calculate the output y(n)
of an LTI system when the impulse response δ(n) and input x(n)
is available.
– The output of LTI can be represented by its impulse response and input
as follows
Convolution Properties
• Commutative
• Associative
• Distributive
Convolution Properties
• Commutative
– This states that the order in which signals are convolved can be
exchanged.
Convolution Properties
• Associative
– The associative property of convolution describes how three or
more signals are convolved.
Cascade Connection
Convolution Properties
• Distributive
– This property of convolution describes how parallel systems are
analyzed.
Parallel Connection
Interconnection Between Systems
• Cascade Connection
• Parallel Connection
Causal LTI System - System Properties
• For a causal system, y(n) only depends on present and past
inputs values. Therefore, for a causal system, we have:
Stable LTI System - System Properties
• A system is said to be stable if every bounded input produces a
bounded output
Zero padding
• Zero padding is a simple concept; it simply refers to adding zeros
to end of a time-domain signal to increase its length.
• The example 1 MHz and 1.05 MHz real-valued sinusoid
waveforms
Zero padding
• zero padding does not improve the spectral (frequency)
resolution of the DFT
• It gives us a high-density spectrum and provides a better
displayed version of plotting.
• If we increase the number of points between 0 and 2𝜋, we can
obtain a better representation of magnitude and phase
response.
Zero padding
• Let N-length of given signal [total number of samples in x(n)] &
M-length of signal after zeros padding.
• So that the length of signal can be increased from N to M by
padding M-N zeros.
• If M=rN, for some integer r, then there will be r-1 new points
between each of the original N-points, and the original will be
unchanged.
Zero padding
Zero padding
Questions
Compute the convolution of the following pairs of signals:
a) x[n]=[ 1 2 3 4 5], v[n]=[0 0 1]
b) x[n]=[ 1 2 4], h[n]=[1 1 1 1]
c) x[n]=[2 −𝟏
ด 0 1 3], h[n]=[-1 ณ 𝟏 2]
𝟏 𝒏 𝟏
d) 𝒒𝟏 𝒏 = 𝒖 𝒏 , 𝒒𝟐 𝒏 = 𝜹 𝒏 + 𝜹[𝒏 − 𝟏]
𝟐 𝟐
Questions
Compute the convolution of the following pairs of signals:
a) x[n]=[ 1 2 3 4 5], v[n]=[0 0 1]
Note: v[k] is defined for k=2
Questions
Compute the convolution of the following pairs of signals:
b) x[n]=[ 1 2 4], h[n]=[1 1 1 1]
Questions
Compute the convolution of the following pairs of signals:
c) x[n]=[2 −𝟏
ด 0 1 3], h[n]=[-1 ณ 𝟏 2]
Note: ℎ[𝑘] is defined only for 𝑘=−1,0,1,
Questions
Compute the convolution of the following pairs of signals:
𝟏 𝐧 𝟏
d) 𝐪𝟏 𝐧 = 𝟐
𝐮 𝐧 , 𝐪𝟐 𝐧 = 𝛅 𝐧 +
𝟐
𝛅[𝐧 − 𝟏]
Note: q2[𝑘] is defined only for 𝑘=0,1
Note that multiplying a signal
by a time-shifted impulse gives
a scaled time-shifted impulse,
where the scaling factor is the
amplitude of the signal at the
respective time shift
Questions
Consider the interconnection of the Linear Time-Invariant (LTI) systems
shown in the figure:
a) Express the overall impulse response, h[n], in terms of h1[n], h2[n], h3[n] and h4[n].
Questions
Consider the interconnection of the Linear Time-Invariant (LTI) systems
shown in the figure:
a) Express the overall impulse response, h[n], in terms of h1[n], h2[n], h3[n] and h4[n].
Recap
• We know analog signals or signals that are continuous in the time
domain.
• But modern-day communication and system are based on digital
processing.
• This forces us to change our analog signals to the digital domain.
– The first step in doing this is to sample the analog signal at a rate.
These points are discretized in time. Each sample occurs at t=nTs,
where Ts is the sampling time.
– After sampling, we need to quantize these samples to one out of M
given levels and then encode the quantized samples to binary for further
storing, analyzing, or transmitting.
Signal Transformation
• Transformation of signals involves a whole new paradigm of
viewing signals in a context different from natural domain of their
occurrence.
• Transforming a signal means looking at a signal from a different
angle so as to gain new insight into many properties of the signal
that my not be evident in their natural domain.
• Transformation is usually implemented on
an independent variable.
Signal Transformation - Fourier Transform
• A signal can be either continuous or discrete, and it can be
either periodic or aperiodic.
• The combination of these two features generates four categories:
1. Aperiodic-Continuous
This includes for example, decaying exponentials and the Gaussian curve
or signal without repeating in a periodic pattern. This type of signal is called
the Fourier Transform
2. Periodic-Continuous
This includes sine waves, square waves, or any other form repeats itself in
a regular pattern. This type of signal is called the Fourier Series
Signal Transformation - Fourier Transform
• A signal can be either continuous or discrete, and it can be
either periodic or aperiodic.
• The combination of these two features generates four categories:
3. Aperiodic-Discrete
These signals are only defined at discrete points between positive and
negative infinity and do not repeat themselves. This type of signal is called
the Discrete Time Fourier Transform
4. Periodic-Discrete
These are discrete signals that repeat themselves in a periodic fashion.
This type of signal is called the Discrete Fourier Series or Discrete
Fourier Transform
Signal Transformation - Fourier Transform
Signal Transformation - Fourier Transform
• Fourier series simply states that, periodic signals can be
represented into sum of sines and cosines when multiplied with a
certain weight.
• The Fourier analysis is also sometimes called the harmonic
analysis.
• Fourier series is applicable only for periodic signals
• It cannot be applied to non periodic signals.
Signal Transformation - Fourier Transform
• A signal is said to be periodic if it satisfies the condition
x (t) = x (t + T) or x (n) = x (n + N).
– Where T = fundamental time period,
– ω0= fundamental frequency = 2π/T
• There are two basic periodic signals:
– 𝑥(𝑡) = 𝑐𝑜𝑠𝜔0𝑡 (sinusoidal)
– 𝑥(𝑡) = 𝑒 𝑗𝜔0𝑡 (complex exponential)
• These two signals are periodic with period T=2π/ω0
Signal Transformation - Fourier Transform
• Fourier transform are functions that are not periodic (but whose
area under the curve is finite).
• The Fourier transform connects two representations of a function:
the time domain and the frequency domain.
• This allows you to analyze signals and other functions in a totally
different way through giving you valuable insights about what
kinds of patterns and periodicities are present.
Signal Transformation - Fourier Transform
• Discrete Time Fourier Transform (DTFT): It is defined using an
infinite sum over a discrete time signal and yields a continuous
function.
• The computation is not practical for digital computer systems,
which can not store or process continuous signals.
Continous frequency (𝜔)
Infinite x(n), −∞ < 𝑛 < ∞
Discrete Fourier Transform (DFT) can overcome this
problem
Signal Transformation - Fourier Transform
• Discrete Fourier Transform: It converts a finite sequence of
equally-spaced samples of a function into a same-length
sequence of equally-spaced samples of the discrete-time Fourier
transform (DTFT), which is a complex-valued function of
frequency.
Signal Transformation - Fourier Transform
A way of DFT DTFT
comparison
Domain • Operates on a finite, discrete • Operates on an infinite, discrete
sequence of samples. sequence of samples.
• It transforms a finite-length • It is defined over an infinite range of
sequence into a finite set of complex time and frequency, meaning it
numbers representing the theoretically considers all possible
amplitudes and phases of various frequencies.
frequency components.
Input and • Takes a finite sequence of N • Takes an infinite sequence of samples
Output samples and produces a finite and produces a continuous function of
sequence of N complex numbers. frequency.
• The input is typically a window of • It operates on a whole signal,
data, and the output is the frequency considering the entire duration of the
domain representation of that signal from negative infinity to positive
window. infinity.
Signal Transformation - Fourier Transform
A way of DFT DTFT
comparison
Computational Computationally efficient algorithms Directly computing the DTFT is
Complexity like the Fast Fourier Transform (FFT) computationally expensive and often not
make the DFT computationally feasible practical for real-world applications due to
for practical applications. its continuous nature.
Application Widely used in digital signal Used more in theoretical analysis and
processing, especially for applications continuous-time systems.
where discrete, finite sets of data need
to be analyzed in the frequency
domain.
Signal Transformation - Fourier Transform
• Suppose we sample one period of at the frequency
at where N is the number of samples, then we have:
• Inverse discrete Fourier transform (IDFT)
Signal Transformation - Fourier Transform
• Suppose that we have a signal x(n), n=0, 1, ... , L-1
• If we perform DFT on the signal and then applied IDFT to
reconstruct the signal, the result signal will be as following
Signal Transformation - Fourier Transform
We have two cases depending on the length of the
signal x(n),
1. L<N
Then we can extract the original signal x(n) perfectly by
estimating the L points or N points of 𝑥𝑝 (𝑛).
2. L>N
Overlap in time domain occurs (time-domain aliasing)
A condition to reconstruct the signal is to have a finite
duration sequence of length L<N
Thus consider zero padding
Signal Transformation - Fourier Transform
An example of aliasing in the time domain.
– The two signals have the same values at the sampling instants, although their
frequencies are different.
The actual signal is higher than twice the sampling frequency and is
consequently aliased to the absolute difference between the signal frequency
and the integer multiple of the sampling rate closest to the signal frequency.
Questions
Find the DFT of the following signals
𝟏) 𝒙(𝒏) = 𝜹(𝒏)
Questions
Find the DFT of the following signals
𝟏) 𝒙(𝒏) = 𝜹(𝒏)
After substiutiting with n=0
𝒙(𝒌) = 𝜹(𝟎). 𝒆𝟎
=𝟏
Questions
Find the DFT of the following signals
𝟐) 𝒙(𝒏) = 𝜹(𝒏 − 𝒏𝟎)
Questions
Find the DFT of the following signals
𝟐) 𝒙(𝒏) = 𝜹(𝒏 − 𝒏𝟎)
After substiutiting with n=0
𝑁−1
𝑥(𝑘) = 𝛿(𝑛 − 𝑛0). 𝑒 −𝑗2𝜋𝑘𝑛/𝑁
𝑛=0
𝑥(𝑘) = 1. 𝑒 −𝑗2𝜋𝑘𝑛0/𝑁
𝑛 − 𝑛0 became one when 𝑛 − 𝑛0=0, then 𝑛 = 𝑛0, so we can write
𝛿(𝑛 − 𝑛0)=1 when 𝑛 = 𝑛0 otherwise it zero
Questions
Find the DFT of the following signals
𝟑) 𝒙(𝒏) = 𝒂𝒏 ; 𝟎 ≤ 𝒏 ≤ 𝑵 − 𝟏
Questions
Find the DFT of the following signals
𝟑) 𝒙(𝒏) = 𝒂𝒏 ; 𝟎 ≤ 𝒏 ≤ 𝑵 − 𝟏
𝑁−1
𝑥(𝑘) = 𝑎𝑛 . 𝑒 −𝑗2𝜋𝑘𝑛/𝑁
𝑛=0
𝑁−1
= [𝑎. 𝑒 −𝑗2𝜋𝑘𝑛/𝑁 ]𝑛
𝑛=0
1 − [𝑎. 𝑒 −𝑗2𝜋𝑘𝑛/𝑁 ]𝑁
𝑥(𝑘) =
1 − 𝑎. 𝑒 −𝑗2𝜋𝑘𝑛/𝑁
Questions
Find the DFT of the following signals
𝟑) 𝒙(𝒏) = 𝒂𝒏 ; 𝟎 ≤ 𝒏 ≤ 𝑵 − 𝟏
1 − [𝑎. 𝑒 −𝑗2𝜋𝑘𝑛/𝑁 ]𝑁
𝑥(𝑘) =
1 − 𝑎. 𝑒 −𝑗2𝜋𝑘𝑛/𝑁
𝑢𝑠𝑖𝑛𝑔 𝑡ℎ𝑒 𝐸𝑢𝑙𝑒𝑟 𝑓𝑜𝑟𝑚𝑢𝑙𝑎 𝑒 −𝑗2𝜋𝑘 we will get, 𝑐𝑜𝑠(2𝜋𝑘) −
𝑗𝑠𝑖𝑛(2𝜋𝑘) 𝑤𝑖𝑡ℎ 𝑘 = 0,1,2, . . . . 𝑒 −𝑗2𝜋𝑘 = 1
1 − 𝑎𝑁
𝑥(𝑘) =
1 − 𝑎. 𝑒 −𝑗2𝜋𝑘𝑛/𝑁
Questions
Find the DFT of the following signals
𝟒) x(n)= {1,1,0,0}
Questions
Find the DFT of the following signals
𝟒) x(n)= {1,1,0,0}
Questions
Find the DFT of the following signals
𝟒) x(n)= {1,1,0,0}
Questions
Find the DFT of the following signals
𝟓)
Questions
Find the DFT of the following signals
𝟓)
Questions
Find the DFT of the following signals
𝟓)
Questions
Find the IDFT of the following signals
x(n)= {1,1,0,0}
Questions
Find the IDFT of the following signals
x(n)= {1,1,0,0}
Questions
Find the IDFT of the following signals
x(n)= {1,1,0,0}
Questions
Find the DFT of the following sequence for N=4 and sketch the
magnitude and phase spectrum. 𝒙(𝒏) = 𝟏; 𝟎 ≤ 𝒏 ≤ 𝟐
Questions
Find the DFT of the following sequence for N=4 and sketch the
magnitude and phase spectrum. 𝒙(𝒏) = 𝟏; 𝟎 ≤ 𝒏 ≤ 𝟐
x(n) = {1 1 1 0}
𝑥(𝑘) = 𝑥(𝑛). 𝑒 −𝑗2𝜋𝑘𝑛/4
𝑛=0
𝑥(𝑘) = 𝑥(0) + 𝑥(1)𝑒 −𝑗𝜋𝑘/2 + 𝑥(2)𝑒 −𝑗𝜋𝑘/1 + 𝑥(3)𝑒 −𝑗3𝜋𝑘/2
𝒇𝒐𝒓 𝒌 = 𝟎 => 𝑥(0) = 1 + [1 ∗ 1] + [1 ∗ 1] + [1 ∗ 0]
𝑥(0) = 3
Questions
Find the DFT of the following sequence for N=4 and sketch the
magnitude and phase spectrum. 𝒙(𝒏) = 𝟏; 𝟎 ≤ 𝒏 ≤ 𝟐
𝑥(𝑘) = 𝑥(0) + 𝑥(1)𝑒 −𝑗𝜋𝑘/2 + 𝑥(2)𝑒 −𝑗𝜋𝑘/1 + 𝑥(3)𝑒 −𝑗3𝜋𝑘/2
𝒇𝒐𝒓 𝒌 = 𝟏 => 𝑥(1) = 1 + [1 ∗ (−𝑗)] + [1 ∗ (−1)] + [0]
𝑥(1) = −𝑗
𝒇𝒐𝒓 𝒌 = 𝟐 => 𝑥(2) = 1 + [1 ∗ (−1)] + [1 ∗ (1)] + [0]
𝑥 2 =1
𝒇𝒐𝒓 𝒌 = 𝟑 => 𝑥(3) = 1 + [1 ∗ (𝑗)] + [1 ∗ (−1)] + [0]
𝑥(2) = 𝑗
𝒙(𝒌) = {𝟑, −𝒋, 𝟏, 𝒋}
Questions
Find the DFT of the following sequence for N=4 and sketch the
magnitude and phase spectrum.𝒙(𝒏) = 𝟏; 𝟎 ≤ 𝒏 ≤ 𝟐
To get magnitude and phase using the calculator follow the below link
https://www.youtube.com/watch?v=sLB-INyUJZQ
|𝒙(𝒌)|
Magnitude: |𝑥(𝑘)| = {3,1,1,1}
∠𝒙(𝒌)
−𝜋 𝜋
Phase: ∠𝑥(𝑘) = {0, , 0, }
2 2
Rules
DFT as Linear Transformation
• Mathematically, the DFT of discreet time sequence x(n) is denoted
by x(k). It is given by,
• The term ‘W’ is called as “twiddle factor”
– It makes the computation of DFT a bit easy and fast
DFT as Linear Transformation
Example: when N=4, we will get 4-point of DFT and the range of ‘k’ is
from 0 to N-1
DFT as Linear Transformation
Example: when N=4, we will get 4-point of DFT and the range of ‘k’ is
from 0 to N-1
DFT as Linear Transformation
Example: when N=4, we will get 4-point of DFT and the range of ‘k’ is
from 0 to N-1
DFT as Linear Transformation
Example: when N=4, we will get 4-point of DFT and the range of ‘k’ is
from 0 to N-1
DFT as Linear Transformation
Example: when N=4, we will get 4-point of DFT and the range of ‘k’ is
from 0 to N-1
Example: when N=2, we will get 2-point of DFT and the range of ‘k’ is
from 0 to N-1
DFT as Linear Transformation
Circular convolution
• Circular convolution for the input x[n] and its impulse response h[n]
is defined as
• Generally, there are two methods, which are adopted to perform
circular convolution and they are −
1. Concentric circle method
2. Matrix multiplication method
Circular convolution - Matrix Multiplication Method
Steps:
Matrix method represents the two given sequence x1(n) and
x2(n) in matrix form.
1. One of the given sequences is repeated via circular shift of one
sample at a time to form a N X N matrix.
2. The other sequence is represented as column matrix.
3. The multiplication of two matrices give the result of circular
convolution.
Circular convolution - Concentric Circle Method
Steps:
1. Take two concentric circles. Plot N samples of x1(n) on the
circumference of the outer circle maintaining equal distance
successive points in anti-clockwise direction.
2. For plotting x2(n), plot N samples of x2(n) in clockwise direction on
the inner circle, starting sample placed at the same point as 0th
sample of x1(n)
3. Multiply corresponding samples on the two circles and add them to
get output.
4. Rotate the inner circle anti-clockwise with one sample at a time.
Questions
Find the circular convolution of the following two sequences
x1[n]={2 1 2} and x2[n]={1 2 3}
Questions
Find the circular convolution of the following two sequences
x1[n]={2 1 2} and x2[n]={1 2 3}
Using matrix mutliplication method:
x1[n]={2 1 2}
x2[n]={1 2 3}
2 2 1 1 2+4+3=9
1 2 2 2 = 1 + 4 + 6 = 11
2 1 2 3 2 + 2 + 6 = 10
Questions
Find the circular convolution of the following two sequences
x1[n]={2 1 2} and x2[n]={1 2 3}
Using matrix concentric circle method:
x1[n]={2 1 2} x2[n]={1 2 3}
Questions
Find the circular convolution of the following two sequences
x1[n]={2 1 2} and x2[n]={1 2 3}
Answer:
y[n]={9 11 10}
Questions
Given two array X[n] and H[n] of length N and M respectively, the task is
to find the circular convolution of the given arrays using Matrix method.
X[n]={1,2,4,2}, H[n]={1,1,1}
Given two array X[n] and H[n] of length N and M respectively, the task is
to find the circular convolution of the given arrays using Matrix method.
X[n]={1,2,4,2}, H[n]={1,1,1}
Answer: 𝟏
𝟏
y[0]=1x1+1x2+1x4+0=7 𝟏
y[1]=1x2+1x1+1x2+0=5
𝟎
y[2]=1x4+1x2+1x1+0=7
y[3]=1x2+1x4+1x2+0=8