SlideShare a Scribd company logo
1 of 115
ELEN 4304/5346 Digital Signal Processing Fall 2008
1
Lecture 01: Introduction
Based on ECE 4624 by Dr. A.A. (Louis) Beex,
Virginia Tech
Instructor:
Dr. Gleb V. Tcheslavski
Contact: gleb@ee.lamar.edu
Office Hours: Room 2030
Class web site:
http://ee.lamar.edu/gleb/dsp/ind
ex.htm
ELEN 4304/5346 Digital Signal Processing Fall 2008
2
Syllabus overview
• Pre-req.: ELEN 3313 Signals and Systems or their equivalent
• Required book: Sanjit K. Mitra, Digital-Signal Processing: A Computer-Based
Approach, McGraw-Hill Co., Third edition, 2004, ISBN: 0-07-286546-6.
• Required software: The Mathworks, The Student Edition of MATLAB, Release
2006a or later.
• Structure: Two 75-minute lectures per week. One homework, three projects,
midterm exam, and the final examination.
• Tests: The Midterm and Final exams will be closed book/notes. Your
performance on the Projects will account for the bulk of your grade.
• Honor System: Discussions on lecture subject material, to clarify your
understanding, are highly encouraged. However, it is your personal understanding
only that should be reflected in all work that you turn in. Any copyright violations
(including copying articles and/or web pages to your reports) will be prosecuted!
ELEN 4304/5346 Digital Signal Processing Fall 2008
3
Styles, notations, legends…
1. Colors: Normal text and formulas
Something more important (imho)
Important formulas and results
Very Important Formulas
Miscellaneous
2. Equations notations: (2.17.3)
Lecture # Slide # Formula #
ELEN 4304/5346 Digital Signal Processing Fall 2008
4
Linear algebra overview
It is convenient in many applications to represent signals and system coefficients by
vectors and matrices. Therefore, a brief overview of linear algebra is considered.
1. Vectors
A vector (denoted by a lowercase bold letter) is an array of real-valued or complex-
valued numbers or functions. We will assume column vectors. The N-dimensional
vector is:
1
2
N
x
x
x
 
 
 

 
 
 
x
The transpose of a vector is a row vector:
 
1 2
T
N
x x x

x
(1.4.1)
(1.4.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
5
Linear algebra overview
The Hermitian transpose is the complex conjugate of the transpose of x:
 
* * * *
1 2
H T
N
x x x
 
   
x x
It might be convenient in some cases to consider a set of values xn containing the
signal values in the certain range:
1
1
n
n
n
n N
x
x
x

 
 
 
 

 
 
 
x
(1.5.1)
(1.5.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
6
Linear algebra overview
The measure of the “magnitude” of the vector is the norm.
The Euclidean or L2 norm:
2
2
1
N
i
i
x

 
x
The L1 norm:
1
1
N
i
i
x

 
x
The L norm: max i
i
x


x
We will be using the second norm unless stated otherwise.
If the vector has a non-zero norm, it can be normalized as follows:
x 
x
v
x
(1.6.1)
(1.6.2)
(1.6.3)
(1.6.4)
The vector vx is a unit norm vector that lies in the same direction as x.
ELEN 4304/5346 Digital Signal Processing Fall 2008
7
Linear algebra overview
Lastly, the norm can be used to measure the distance between two vectors:
 
2
1
,
N
i i
i
d x y

   

x y x y (1.7.2)
For two complex vectors a and b of the same length, the inner product is a scalar
defined as
*
1
,
N
H
i i
i
a b

  
a b a b
For two real vectors, the inner product becomes
1
,
N
T
i i
i
a b

  
a b a b
(1.7.3)
(1.7.4)
The squared norm represents the energy in the signal:
1
2 2
0
N
n
n
x


 
x (1.7.1)
ELEN 4304/5346 Digital Signal Processing Fall 2008
8
Linear algebra overview
where  is the angle between two vectors. Therefore, two nonzero vectors a and b
are orthogonal if their inner product is zero:
The inner product defines the geometrical relationship between two vectors:
, cos

a b a b (1.8.1)
, 0

a b
Two vectors that are orthogonal and have unit norms are called orthonormal.
Since |cos|  1, the inner product is bounded:
, 
a b a b
(1.8.3) is known as the Cauchy-Schwarz inequality. The equality holds iff a and b
are colinear, i.e.
,
 
  
a b const
(1.8.2)
(1.8.3)
(1.8.4)
ELEN 4304/5346 Digital Signal Processing Fall 2008
9
Linear algebra overview
Another useful inequality is
2 2
2 ,  
a b a b (1.9.1)
The output of an LTI FIR filter can be represented using the inner product. If the
filter output is the convolution of its unit pulse response and the input
1
0
N
n k n k
k
y h x



 
then, expressing x as in (1.5.2) and representing hn as
 
0 1 1
T
N
h h h 

h
the filter output may be written as the inner product:
T
n n
y  h x
(1.9.2)
(1.9.3)
(1.9.4)
ELEN 4304/5346 Digital Signal Processing Fall 2008
10
Linear algebra overview
A set of n vectors v1, v2, … vn is linearly independent if
1 1 2 2 0
n n
  
   
v v v
implies that i = 0 for all i. If a set of nonzero i can be found satisfying (1.10.1), the
vectors are linearly dependent and at least one of the vectors, say v1 can be
expressed as a linear combination of the remaining vectors:
1 2 2 3 3 n n
  
   
v v v v
for some set of scalars i.
For vectors of dimension N, no more than N vectors may be linearly independent.
Therefore, any set of N-dimensional vectors containing more than N vectors will
always be linearly dependent.
(1.10.1)
(1.10.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
11
Linear algebra overview
For a set of N vectors v1, v2, … vn
 
1 2 n

V v v v
Consider the set of all vectors V that may be formed from a linear combination of
the vectors vi
1
N
i i
i


 
v v
This set forms a vector space, and the vectors vi are said to span the space V.
Furthermore, if the vectors vi are linearly independent, they form a basis for the
space V, and the number of vectors in the basis N is the dimension of the space.
For instance, the set of all real vectors of the form
 
1 2
T
N
x x x

x
forms an N-dimensional vector space, denoted by RN that is spanned by the basis
vectors
(1.11.1)
(1.11.2)
(1.11.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
12
Linear algebra overview
 
 
 
1
2
1 0 0 0
0 1 0 0
0 0 0 1
T
T
T
N



u
u
u
In terms of basis, any vector
 
1 2
T
N
v v v

v
may be uniquely decomposed as follows:
1
N
i i
i
v

 
v u
It should be pointed out, however, that the basis for a vector space is not unique.
(1.12.1)
(1.12.2)
(1.12.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
13
Linear algebra overview
2. Matrices
An n x m matrix is an array of real or complex numbers or functions having n rows
and m columns.
11 12 13 1
21 22 23 2
1 2 3
m
m
n n n nm
a a a a
a a a a
a a a a
 
 
 

 
 
 
A
An n x m matrix of
numbers
An n x m matrix of
functions
11 12 13 1
21 22 23 2
1 2 3
( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( )
( ) ( ) ( ) ( )
m
m
n n n nm
a z a z a z a z
a z a z a z a z
z
a z a z a z a z
 
 
 

 
 
 
A
If n = m, A is a square matrix.
(1.13.1)
(1.13.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
14
Linear algebra overview
The output of an LTI FIR filter can be written in vector form as follows:
T T
n n n
y  
h x x h
If xn = 0 for n < 0, the filter output may be expressed for n  0 as
0

y X h
where X0 is the convolution matrix
0
1 0
2 1 0
0
1 2 3 0
0 0 0
0 0
0
N N N
x
x x
x x x
x x x x
  
 
 
 
 
  
 
 
 
 
X
and  
0 1 2
T
y y y

y
(1.14.1)
(1.14.2)
(1.14.3)
(1.14.4)
We observe that, in addition to
its structure of having equal
values along each of the
diagonals, X0 has N-1 columns
and an infinite number of rows.
ELEN 4304/5346 Digital Signal Processing Fall 2008
15
Linear algebra overview
An n x m matrix can be represented as a set of m column vectors
 
1 2 m

A c c c
or as a set of n row vectors
1
2
H
H
H
n
 
 
 

 
 
 
 
r
r
A
r
(1.15.1)
(1.15.2)
An n x m matrix may be partitioned into submatrices as follows
11 12
21 22
 
  
 
A A
A
A A
where A11 is p x q, A12 is p x (m-q), A21 is (n-p) x q, and A22 is (n-p) x (m-q).
(1.15.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
16
Linear algebra overview
If A is an n x m matrix, then the transpose AT is the m x n matrix that is formed by
interchanging the rows and columns of A. Therefore, the (i, j)th element becomes
the (j, i)th element and vice versa. If the matrix is square, the transpose is formed
by reflecting its elements with respect to the diagonal.
A square matrix A is symmetric if
T

A A
For complex matrices, the Hermitian transpose is defined as
   
*
* T
H T
 
A A A
A square complex matrix A is Hermitian if
H

A A
(1.16.1)
(1.16.2)
(1.16.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
17
Linear algebra overview
Useful properties of Hermitian transpose are
 
 
 
1.
2.
3.
H H H
H
H
H H H
   
 
 
A B A B
A A
AB B A
Replacing the Hermitian transpose with an ordinary transpose, we obtain
 
 
 
1.
2.
3.
T T T
T
T
T T T
   
 
 
A B A B
A A
AB B A
(1.17.1)
(1.17.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
18
Linear algebra overview
Let A be an n x m matrix partitioned in a set of m column vectors
 
1 2 m

A c c c (1.18.1)
The rank of A, rank(A) is defined as the number of linearly independent columns in
A, i.e., the number of linearly independent vectors in the set {c1, c2, … , cm}. One of
the properties of the rank is that
( ) ( )
H
rank rank
 
A A
Therefore, if A is partitioned in a set of n row vectors
1
2
H
H
H
n
 
 
 

 
 
 
 
r
r
A
r
Then, the rank of A is also equal to the number of linearly independent row vectors.
(1.18.2)
(1.18.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
19
Linear algebra overview
The important property of the rank is
( ) ( ) ( )
H H
rank rank rank
 
A AA A A (1.19.1)
Since the rank of a matrix is equal to the number of linearly independent rows and
the number of linearly independent columns, then, if A is an m x n matrix:
( ) min( , )
rank m n

A
If A is an m x n matrix and rank(A) = min(n,m), then A is of full rank.
If A is a square matrix of full rank, then there exists a unique matrix A-1 called the
inverse of A such that
1 1
 
 
A A AA I
(1.19.2)
(1.19.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
20
Linear algebra overview
where 1 0 0
0 1 0
0 0 1
 
 
 

 
 
 
I (1.20.1)
is the identity matrix with ones along the main diagonal and zeros everywhere else.
In this case, A is said to be invertible or nonsingular. If A is not of full rank, then it is
noninvertible or singular and does not have an inverse.
If A and B are invertible, then
 
   
   
1 1 1
1 1
1
1 1 1 1 1 1
1.
2.
3.
H
H
  
 

     
 
 
    
AB B A
A A
A BCD A A B C DA B DA
(1.20.2)
(1.20.3)
(1.20.4)
ELEN 4304/5346 Digital Signal Processing Fall 2008
21
Linear algebra overview
(1.20.4) is called the matrix inversion lemma. It is assumed that A is n x n, B is n
x m, C is m x m, and D is m x n with A and C nonsingular matrices.
A special case of this lemma occurs when C = 1, B = u, and D = vH where u and v
are n-dimensional vectors. In this case
 
1 1
1 1
1
1
H
H
H
 
 

  

A uv A
A uv A
v A u
Which is sometimes referred to as a Woodbury’s identity. As a special case, if A =
I, (1.21.1) becomes
 
1
1
H
H
H

  

uv
I uv I
v u
(1.21.1)
(1.21.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
22
Linear algebra overview
If A = a11 is a 1 x 1 matrix, the determinant is defined as det(A) = a11. For an n x n
matrix, the determinant is defined recursively as
   
1
det( ) 1 det
n
i j
ij ij
i
a


 

A A
where Aij is the (n-1) x (n-1) matrix formed by deleting the ith row and the jth column
of A.
Property: An n x n matrix A is invertible iff
det( )
A 0
(1.22.1)
(1.22.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
23
Linear algebra overview
For A and B being n x n matrices, if A is invertible, and a constant , the following
properties hold:
     
   
   
   
1
1. det det det
2. det det
3. det det
1
4. det
det
T
n
 

 
 
 
 
AB A B
A A
A A
A
A
For an n x n matrix A, the trace function is defined as
 
1
n
ii
i
tr a

 
A
(1.23.1)
(1.23.2)
(1.23.3)
(1.23.4)
(1.23.5)
ELEN 4304/5346 Digital Signal Processing Fall 2008
24
Linear algebra overview
3. Linear equations
Consider the following set of n linear equations in the m unknowns xi, i = 1,2,…,m
11 1 12 2 1 1
21 1 22 2 2 2
1 1 2 2
...
...
...
m m
m m
n n nm m n
a x a x a x b
a x a x a x b
a x a x a x b
   
   
   
These equations may be written in matrix form as follows

Ax b
(1.24.1)
(1.24.2)
Where A is an n x m matrix with entries aij, x is an m-dimensional vector of
unknowns xi, and b is an n-dimensional vector with elements bi.
ELEN 4304/5346 Digital Signal Processing Fall 2008
25
Linear algebra overview
A convenient way to view (1.24.2) is as an expansion of vector b in terms of a
linear combination of the column vectors ai of the matrix A:
1
m
i i
i
x

 
b a
Solving (1.25.1) depends on a number of factors including the relative size of m
and n, the rank of A, and the elements of b.
(1.25.1)
3.1. Square matrix: m = n.
The solution to (1.25.1) depends upon whether or not A is singular. If A is
nonsingular, then the inverse A-1 exists and the solution is uniquely defined by
1


x A b (1.25.2)
However, if A is singular, then there may either be no solution (the equations are
inconsistent) or many solutions.
ELEN 4304/5346 Digital Signal Processing Fall 2008
26
Linear algebra overview
For the case in which A is singular, the columns of A are linearly dependent and
there exist nonzero solutions to the homogeneous equation

Az 0
In fact, there will be k = n – rank(A) linearly independent solutions to the
homogeneous equations. Therefore, if there is at least one vector x0 that solves
(1.24.2), then any vector of the form
0 1 1 ... k k
 
   
x x z z
will also be a solution where zi, i = 1,2,…,k are linearly independent solutions to
(1.24.2).
(1.26.1)
(1.26.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
27
Linear algebra overview
3.2. Rectangular matrix: n < m.
In this situation, there are fewer equations then unknowns. Therefore, if the
equations are not inconsistent, there are many vectors satisfying the equations: the
solution is undetermined or incompletely specified. A common approach to define a
unique solution is to find the vector that satisfies the equations and has a minimum
norm; i.e.
min suchthat
   
x Ax b
If rank(A) = n (the rows of A are linearly independent), then the n x n matrix AAH is
invertible and the minimum norm solution is
 
1
0
H H 

x A AA b
 
1
H H 


A A AA
The matrix
is called the pseudo-inverse of the matrix A for the undetermined problem.
(1.27.1)
(1.27.2)
(1.27.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
28
Linear algebra overview
3.3. Rectangular matrix: n > m.
In this situation, there are more equations then unknowns and, in general, no
solution exists. The equations are inconsistent and the solution is overdetermined.
For the case of 3 equations in 2 unknowns, this
problem is illustrated:
Since an arbitrary vector b cannot be
represented as a linear combination of the
columns of A, the goal is to find the coefficients
xi producing the best approximation to b:
1
ˆ
m
i i
i
x a

 
b (1.28.1)
ELEN 4304/5346 Digital Signal Processing Fall 2008
29
Linear algebra overview
(1.29.1)
The approach commonly used in this situation is to find the least squares solution;
i.e., the vector x minimizing the norm of the error
2 2
 
e b Ax
The least squares solution has the property that the error
 
e b Ax
is orthogonal to the column vectors of A. This orthogonality implies that
0
H

A e
or
H H

A AX A b
which are known as the normal equations.
(1.29.2)
(1.29.3)
(1.29.4)
ELEN 4304/5346 Digital Signal Processing Fall 2008
30
Linear algebra overview
If the columns of A are linearly independent (A has full rank), the matrix AHA is
invertible and the least square solution is
 
1
0
H H


x A A A b
or
0


x A b
where  
1
H H



A A A A
is the pseudo-inverse of the matrix A for the overdetermined problem. Furthermore,
the best approximation of b is given by the projection of the vector b onto the
subspace spanned by the vectors ai
 
1
0
ˆ H H

 
b Ax A A A A b
(1.30.1)
(1.30.2)
(1.30.3)
(1.30.4)
ELEN 4304/5346 Digital Signal Processing Fall 2008
31
Linear algebra overview
or
where  
1
H H
A


P A A A A
ˆ
A

b P b (1.31.1)
(1.31.2)
is called the projection matrix. Finally, using the orthogonality condition, the
minimum mean square error is
2
0
min H H H
  
e b e b b b Ax (1.31.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
32
Linear algebra overview
4. Special matrix forms
4.1. Diagonal matrix – a square matrix having all entries equal to zero except,
possibly, for those along the main diagonal:
11
22
0 0
0 0
0 0 nn
a
a
a
 
 
 

 
 
 
A
The diagonal matrix may be written as
 
11 22
diag nn
a a a

A
(1.32.1)
(1.32.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
33
Linear algebra overview
4.2. Identity matrix – a diagonal matrix with ones along the diagonal:
 
1 0 0
0 1 0
diag 1 1 1
0 0 1
 
 
 
 
 
 
 
I (1.33.1)
4.3. Block diagonal matrix – a diagonal matrix whose entries along the diagonal are
replaced with matrices:
11
22
0 0
0 0
0 0 nn
 
 
 

 
 
 
A
A
A
A
(1.33.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
34
Linear algebra overview
(1.34.1)
4.4. Exchange matrix – a symmetric matrix with ones along the cross-diagonal and
zeros everywhere else. Since J2 = I, then J is its own inverse.
0 0 1
0 1 0
1 0 0
 
 
 

 
 
 
J
The effect of multiplying a vector v by the exchange matrix is a vector with
reversed order of the entries; i.e.,
1
2 1
1
n
n
n
v v
v v
v v

   
   
   

   
   
 
 
J (1.34.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
35
Linear algebra overview
Similarly, if a matrix A is multiplied on the left by the exchange matrix, the effect is
to reverse the order of each column. For example:
11 12 13
21 22 23
31 32 33
a a a
a a a
a a a
 
 
  
 
 
A
then 31 32 33
21 22 23
11 12 13
T
a a a
a a a
a a a
 
 
  
 
 
J A
(1.35.1)
(1.35.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
36
Linear algebra overview
Similarly, if a matrix A is multiplied on the right by the exchange matrix, the effect is
to reverse the order of each row:
13 12 11
23 22 21
33 32 31
a a a
a a a
a a a
 
 
  
 
 
AJ
Finally, the effect of forming the product JTAJ is to reverse the order of each row
and column
33 32 31
23 22 21
13 12 11
T
a a a
a a a
a a a
 
 
  
 
 
J AJ
thereby reflecting each element of A about the central element.
(1.36.1)
(1.36.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
37
Linear algebra overview
4.5. Upper triangular matrix – a square matrix, in which all entries below the
diagonal are zero:
0
ij
a for i j
   
For example, for n = 4
11 12 13 14
22 23 24
33 34
44
0
0 0
0 0 0
a a a a
a a a
a a
a
 
 
 

 
 
 
A
4.6. Lower triangular matrix – a square matrix, in which all entries above the
diagonal are zero:
0
ij
a for i j
   
(1.37.1)
(1.37.2)
(1.37.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
38
Linear algebra overview
Some properties of lower and upper triangular matrices are:
1. The transpose of a lower (upper) triangular matrix is an upper (lower) triangular
matrix;
2. The determinant of a lower or upper triangular matrix is
3. The inverse of an upper (lower) triangular matrix is upper (lower) triangular;
4. The product of two upper (lower) triangular matrices is upper (lower) triangular.
1
det( )
n
ii
i
a

 
A (1.38.1)
ELEN 4304/5346 Digital Signal Processing Fall 2008
39
Linear algebra overview
4.7. Toeplitz matrix – a square n x n matrix, in which all entries along each of the
diagonals have the same value
1, 1 ,
ij i j
a a i n j n
 
    
For example, for n = 4
1 3 5 7
2 1 3 5
4 2 1 3
6 4 2 1
 
 
 

 
 
 
A
(1.39.1)
(1.39.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
40
Linear algebra overview
4.8. Hankel matrix – a square n x n matrix, in which all entries along each of the
cross-diagonals have the same value
1, 1 ,
ij i j
a a i n j n
 
    
For example, for n = 4
1 3 5 7
3 5 7 4
5 7 4 2
7 4 2 1
 
 
 

 
 
 
A
(1.40.1)
(1.40.2)
Another example of Hankel matrices is the exchange matrix J.
ELEN 4304/5346 Digital Signal Processing Fall 2008
41
Linear algebra overview
Toeplitz matrices are a special case of matrices known as persymmetric.
4.9. Persymmetric matrix – a matrix symmetric about the cross-diagonal:
1, 1
ij n j n i
a a    

For example, for n = 4, a persymmetric but non-Toeplitz matrix:
1 3 5 7
2 2 4 5
4 4 2 3
6 4 2 1
 
 
 

 
 
 
A
(1.41.1)
(1.41.2)
If a Toeplitz matrix is symmetric (or Hermitian in the case of a complex matrix), we
only need to specify the first row and the first column to completely determine a
Toeplitz matrix.
ELEN 4304/5346 Digital Signal Processing Fall 2008
42
Linear algebra overview
Symmetric Toeplitz matrices are a special case of matrices known as
centrosymmetric.
4.10. Centrosymmetric matrix – a matrix that is both symmetric and persymmetric.
For example, for n = 4, a centrosymmetric but non-Toeplitz matrix:
1 3 5 6
3 2 4 5
5 4 2 3
6 5 3 1
 
 
 

 
 
 
A (1.42.1)
If A is a symmetric Toeplitz matrix, then
T

J AJ A
If A is a Hermitian Toeplitz matrix, then
*
T

J AJ A
(1.42.2)
(1.42.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
43
Linear algebra overview
Some important properties are…
1. The inverse of a symmetric matrix is symmetric;
2. The inverse of a persymmetric matrix is persymmetric;
3. The inverse of a Toeplitz matrix is not, in general, Toeplitz. However, since a
Toeplitz matrix is persymmetric, the inverse will always be persymmetric.
Furthermore, the inverse of a symmetric Toeplitz matrix will be centrosymmetric.
The relationship between the
symmetries of a matrix and
its inverse
ELEN 4304/5346 Digital Signal Processing Fall 2008
44
Linear algebra overview
4.11. Orthogonal matrix – a real n x n matrix with orthogonal columns (and rows):
 
1 2 n

A a a a
and
If
1
0
T
i j
for i j
for i j
  

 
  

a a
then A is orthogonal.
We observe that if A is orthogonal, then
T

A A I
Therefore, the inverse of an orthogonal matrix is equal to its transpose:
1 T


A A
(1.44.1)
(1.44.2)
(1.44.3)
(1.44.4)
ELEN 4304/5346 Digital Signal Processing Fall 2008
45
Linear algebra overview
4.12. Unitary matrix – a complex n x n matrix with orthogonal columns (rows):
1
0
H
i j
for i j
for i j
  

 
  

a a
H

A A I
1 H


A A
(1.45.2)
(1.45.3)
then
(1.45.1)
The inverse of a unitary matrix equals to its Hermitian transpose
ELEN 4304/5346 Digital Signal Processing Fall 2008
46
Linear algebra overview
The quadratic form of a real symmetric n x n matrix A is the scalar defined by
 
1 1
n n
T
A i ij j
i j
Q x a x
 
  
x x Ax
where x is a vector of n real variables. Observe that the quadratic form is a
quadratic function in the n variables x1, x2, …, xn. For example, the quadratic form
of
3 1
1 2
 
  
 
A
is
  2 2
1 1 2 2
3 2 2
T
A
Q x x x x
   
x x Ax
(1.46.1)
(1.46.2)
(1.46.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
47
Linear algebra overview
Similarly, for a Hermitian matrix, the Hermitian form is
  *
1 1
n n
H
A i ij j
i j
Q x a x
 
  
x x Ax (1.47.1)
If the quadratic form of a matrix A is positive for all nonzero vectors x,
  0
A
Q 
x
then A is said to be positive definite and we write A > 0. For example, if
(1.47.2)
2 0
0 3
 
  
 
A
which has the quadratic form
    1 2 2
1 2 1 2
2
2 0
2 3
0 3
A
x
Q x x x x
x
 
 
  
 
 
   
x
(1.47.3)
(1.47.4)
is positive definite since QA(x) > 0 for all x  0.
ELEN 4304/5346 Digital Signal Processing Fall 2008
48
Linear algebra overview
If the quadratic form of a matrix A is non negative for all nonzero vectors x,
  0
A
Q 
x
then A is said to be positive semidefinite.
(1.48.1)
If the quadratic form of a matrix A is negative for all nonzero vectors x,
  0
A
Q 
x
then A is said to be negative definite.
(1.48.2)
If the quadratic form of a matrix A is non positive for all nonzero vectors x,
  0
A
Q 
x
then A is said to be negative semidefinite.
(1.48.3)
A matrix A that is none of the above is called indefinite.
ELEN 4304/5346 Digital Signal Processing Fall 2008
49
Linear algebra overview
5. Eigenvalues and Eigenvectors
Let A be an n x n matrix and consider the following set of linear equations:


Av v
where  is a constant. Equivalently:
  0

 
A I v
(1.49.1)
(1.49.2)
In order for a nonzero vector v to be a solution to this equation, it is necessary for
the matrix A - I to be singular. Therefore, the determinant of A - I must be zero:
   
det 0
p  
  
A I
where p() is an nth order polynomial in . This polynomial is called the
characteristic polynomial of the matrix A and its n roots i for i = 1, 2,…, n are
called the eigenvalues of A.
(1.49.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
50
Linear algebra overview
For each eigenvalue i for i = 1, 2,…, n the matrix A - I will be singular and there
will be at least one nonzero vector vi that solves (1.49.1); i.e.
i i i


Av v
These vectors vi are called the eigenvectors of A. For any eigenvector vi, vi will
also be an eigenvector for any constant . Therefore, eigenvectors are often
normalized to have unit norm.
Property 1: The nonzero eigenvectors v1, v2, … vn corresponding to the distinct
eigenvalues 1, 2, …, n are linearly independent.
If A is an n x n singular matrix, then there are nonzero solutions to the
homogeneous equation
0
i 
Av
and it follows that  = 0 is an eigenvalue of A.
There are n – rank(A) linearly independent solutions to (1.50.2). Therefore, A will
have rank(A) nonzero eigenvalues and n – rank(A) eigenvalues that are equal zero.
(1.50.1)
(1.50.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
51
Linear algebra overview
Property 2: The eigenvalues of a Hermitian matrix are real.
Property 3: A Hermitian matrix is positive definite A > 0 iff eigenvalues of A are
positive: k > 0.
Property 4: The eigenvectors of a Hermitian matrix corresponding to distinct
eigenvalues are orthogonal; i.e.
The determinant of a matrix is related to its eigenvalues as
 
1
det
n
i
i


 
A (1.51.1)
, 0
i j i j
if then
 
     
v v (1.51.2)
Spectral Theorem: Any Hermitian matrix A can be decomposed as
1 1 1 2 2 2 ...
H H H H
n n n
  
    
A VΛV v v v v v v (1.51.3)
where i are the eigenvalues of A and vi are a set of orthonormal eigenvectors.
ELEN 4304/5346 Digital Signal Processing Fall 2008
52
Linear algebra overview
Property 5: Let B be an n x n matrix with eigenvalues i and let A be a matrix that is
related to B as follows

 
A B I
Then A and B have the same eigenvectors and the eigenvalues of A are i + .
(1.52.1)
Property 6: For a symmetric positive definite matrix A, the equation
1
T

x Ax (1.52.2)
defines an ellipse in n dimensions whose axes are in the
directions of the eigenvectors vj of A with the half-length
of these axes equal to 1 j

ELEN 4304/5346 Digital Signal Processing Fall 2008
53
Concepts of signals and systems
Signals play an important role in our daily life. Examples of signals are speech,
music, pictures, video… a signal is a function of independent variables such as
time, distance, temperature, etc.
For instance, a speech signal represents
air pressure (or a voltage output from a
microphone) as a function of time;
a black and white picture is a
representation of light intensity as a
function of two spatial coordinates;
Video is a function of two spatial coordinates and
time.
ELEN 4304/5346 Digital Signal Processing Fall 2008
54
Concepts of signals and systems
Most signals are generated naturally; however, a signal can
also be generated synthetically by a computer simulation.
A signal carries information, and one of the objective of signal
processing is to extract useful information from the signal.
The method of information extraction depends on the type of
signal and the nature of information.
ELEN 4304/5346 Digital Signal Processing Fall 2008
55
Concepts of signals and systems
The term system usually indicates a physical device used to
generate or manipulate signals. Thus, we may consider a
system as a mathematical function applied to a signal.
Alternatively, a system can be viewed as any process that
results in the transformation of signals. Therefore, a system
may have an input signal and an output signal that is related
to the input through the system transformation.
For instance, an audio amplifier takes a recorded music
signal, amplifies it and outputs to the speakers usually
allowing us to control the amplification (i.e. “loudness”) and
tone (amounts of “bass” and “treble”).
ELEN 4304/5346 Digital Signal Processing Fall 2008
56
Why Digital?? Music recording and
reproduction: some history
Past…
ELEN 4304/5346 Digital Signal Processing Fall 2008
57
Music recording and reproduction
Still past… And (almost) present
ELEN 4304/5346 Digital Signal Processing Fall 2008
58
Music recording and reproduction: some
physics behind
 Mechanical wave (sound) generates electrical signal in a microphone.
 Signal is amplified
 And recorded (stored), which usually involves some conversion…
1. Recording
Music recording techniques can be divided into analog and digital
according to the signal’s representation at the storage stage.
2. Reproduction
 A recorded signal is converted back to electrical current.
 Amplified
 A mechanical wave (sound) is generated by a speaker (electrical oscillation is
converted into mechanical one).
ELEN 4304/5346 Digital Signal Processing Fall 2008
59
Music recording and reproduction: The
media
Magnetic tape – Analog recording:
Magnetization of the media changes
according to an analog electrical signal
CD/DVD – digital recording:
Optical properties are modified to
encode a digital signal
ELEN 4304/5346 Digital Signal Processing Fall 2008
60
So, why DSP???
Most of the portable
(and not only
portable!) electronic
items we are dealing
with in our everyday
life are digital…
Digitally recorded
data needs to be
manipulated…
ELEN 4304/5346 Digital Signal Processing Fall 2008
61
Sampling
Let us consider a sinusoid x(t) = A cos(t + ), t is a continuous time variable
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Volts
Time, sec
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Volts
Time, sec
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Volts
Time, sec
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Volts
Time, sec
By sampling, we can reduce storage requirements considerably!
Ts
ELEN 4304/5346 Digital Signal Processing Fall 2008
62
Sampling: Ideal C/D converter
Ideal C/D
converter
x(t)
Ts
xn
Therefore, a sampled signal: ( )
n s
x x nT

s
t nT

(1.62.1)
for a sinusoid: ( ) cos( ) cos( )
n s s
x x nT A nT A n
  
     
1
s
s
f
T

The sampling frequency: (1.62.2)
(1.62.3)
Normalized radial frequency:
Fractional frequency:
s s
T f
   
n s
f f f

(1.62.4)
(1.62.5)
ELEN 4304/5346 Digital Signal Processing Fall 2008
63
Aliasing
Let us consider two discrete-time sinusoids:
1, cos(0.4 )
n
x n

 2, cos(2.4 )
n
x n


2, 1,
cos(2.4 ) cos(2 0.4 ) cos(0.4 )
n n
x n n n n x
   
    
They are obviously at two different frequencies BUT trigonometry shows:
Result: we may reconstruct more than one sinusoid from samples!
Aliasing (more than one signal represented by the same
frequency samples) is due to the 2n periodicity of sin/cos…
0 100 200 300 400 500 600 700 800 900 1000
-1
-0.5
0
0.5
1
Amplitude
x1
(t)
x2
(t)
x1n
ELEN 4304/5346 Digital Signal Processing Fall 2008
64
Aliasing
Intuitively, we would lower the storage requirements if the sampling frequency
can be reduced… Then we would collect less samples…
How would we mitigate aliasing?
Restrict ourselves to the signals at frequencies [- ]…
…which leads us to an appropriate selection of sampling
rate (sampling frequency)!
ELEN 4304/5346 Digital Signal Processing Fall 2008
65
How many samples do we need to
reconstruct the initial sinusoid?
Let us consider two periods of a sinusoid and a uniform sampling…
As many
as:
4
uniform
samples/
period
Can be
reconstructed!
Can fit >1 sin?
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
ELEN 4304/5346 Digital Signal Processing Fall 2008
66
How many samples do we need to
reconstruct the initial sinusoid?
66
How many signal’s samples do we need to reconstruct the initial sinusoid?
Let us consider two periods of a sinusoid and uniform sampling…
As many
as:
2
uniform
samples/
period.
Still can be
reconstructed!
Can fit >1 sin?
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
ELEN 4304/5346 Digital Signal Processing Fall 2008
67
Let us consider two periods of a sinusoid and a uniform sampling…
As many
as:
1
sample/
period.
Can draw
MORE than
one sinusoid!
Initial signal is
lost.
Can fit >1 sin?
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Time, sec
Volts
How many samples do we need to
reconstruct the initial sinusoid?
ELEN 4304/5346 Digital Signal Processing Fall 2008
68
The Sampling Theorem
We can conclude that at least two uniform signal samples per period are necessary
to recover the initial sinusoidal signal.
Harry Nyquist Claude Shannon Kotelnikov
Nyquist-Shannon Theorem: a sinusoidal signal of frequency f0 can be
perfectly reconstructed from it’s uniformly sampled version if samples
were taken at the frequency at least 2 f0 (twice the signal’s frequency).
ELEN 4304/5346 Digital Signal Processing Fall 2008
69
The Sampling Theorem
More accurately:
A band-limited signal can be perfectly reconstructed from
its uniformly sampled version iff samples were taken at a
frequency at least twice higher than the highest frequency
in the signal’s spectrum.
One half of the sampling frequency – the maximum
frequency component that can be represented – is called the
Nyquist frequency.
What’s about systems? Do they become discrete too?
ELEN 4304/5346 Digital Signal Processing Fall 2008
70
Classification of sequences
1 2
1 2
;
N n N
N N
 
    
A discrete-time signal can be classified into several types based on its
specific characteristics…
1. Duration: a discrete-time signal may be a finite-length or an infinite-
length sequence.
A finite-length (finite-duration; finite-extend) sequence is defined for a
finite time interval n where
Therefore, the length (duration) N of the above finite-length digital
sequence may be computed as
2 1 1
N N N
  
A length-N discrete-time sequence consists of N samples.
(1.70.1)
(1.70.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
71
Classification of sequences
1
0
n
x for n N
   
There are three types of infinite-length sequences:
A right-sided sequence xn has zero-valued samples for n < N1:
where N1 is a finite integer that can be positive or negative. If N1 is
positive, a right-sided sequence is usually called a causal sequence.
A left-sided sequence xn has zero-valued samples for n > N2:
2
0
n
x for n N
   
where N2 is a finite integer that can be positive or negative. If N2 is
negative, a left-sided sequence is usually called an anticausal sequence.
A general two-sided sequence xn is defined for both positive and
negative values of n.
(1.71.1)
(1.71.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
72
Classification of sequences
*
n n
x x
 
2. Symmetry with respect to the time-index n = 0.
A sequence xn is called a conjugate-symmetric sequence if
A real conjugate-symmetric sequence is called an even sequence.
A sequence xn is called a conjugate-antisymmetric sequence if
*
n n
x x

A real conjugate-antisymmetric sequence is called an odd sequence.
For a conjugate-antisymmetric sequence xn, the sample value at n = 0
must be purely imaginary.
For an odd sequence x0 = 0.
(1.72.1)
(1.72.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
73
Classification of sequences
cs ca
n n n
x x x
 
Any complex sequence xn can be expressed as a sum of its conjugate-
symmetric part xcs
n and its conjugate-antisymmetric part xca
n:
where
 
 
*
*
1
2
1
2
cs
n n n
ca
n n n
x x x
x x x


 
 
Therefore, the computation of conjugate-symmetric and conjugate-
antisymmetric parts of a sequence involves conjugation, time-reversal,
addition, and multiplication operations.
(1.73.1)
(1.73.2)
(1.73.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
74
Classification of sequences
Similarly, any real sequence xn can be expressed as a sum of its even
part xev
n and its odd part xod
n:
ev od
n n n
x x x
 
where
 
 
1
2
1
2
ev
n n n
od
n n n
x x x
x x x


 
 
The symmetry properties of sequences often simplify their respective
frequency-domain representation.
(1.74.1)
(1.74.2)
(1.74.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
75
Classification of sequences
3. Periodicity.
A sequence xn satisfying
n n kN
x x n

  (1.75.1)
is called a periodic sequence with a period N, where N is a positive
integer and k is any integer. Otherwise, a sequence is called an
aperiodic sequence. The fundamental period Nf of a periodic signal is the
smallest value of N for which (1.75.1) holds.
Sum or product of two or more periodic sequences is also a periodic
sequence. For instance, a sum of two periodic sequences xa
n and xb
n
with fundamental periods Na and Nb is a periodic sequence with a
fundamental period N
 
,
a b
a b
N N
N
GCD N N
 (1.75.2)
The greatest common divisor
ELEN 4304/5346 Digital Signal Processing Fall 2008
76
Classification of sequences
2
x n
n
E x


 
4. Energy and Power signals.
The total energy of a sequence xn is defined as
An infinite-length sequence with finite sample values may or may not
have finite energy.
The average power of an aperiodic sequence xn is defined as
2
1
lim
2 1
K
x n
K
n K
P x
K





(1.76.1)
(1.76.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
77
Classification of sequences
2
,
K
x K n
n K
E x

 
,
1
lim
2 1
x x K
K
P E
K



The average power of a sequence can be related to its energy by
defining its energy over a finite interval -K  n  K as
Then
The average power of a periodic sequence xn with a period N is
1
2
0
1 N
x n
n
P x
N


 
The average power of an infinite-length sequence may be finite or
infinite.
(1.77.1)
(1.77.2)
(1.77.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
78
Classification of sequences
An infinite energy signal with finite average power is called a
power signal.
A finite energy signal with zero average power is called an
energy signal.
An example of a power signal is a periodic sequence that
has a finite average power but infinite energy.
An example of an energy signal is a finite-length sequence
which has finite energy but zero average power.
ELEN 4304/5346 Digital Signal Processing Fall 2008
79
Classification of sequences
n x
x B
  
n
n
x


 

5. Other classifications.
1) A sequence xn is called bounded if each of its samples is of finite
magnitude:
2) A sequence xn is called absolutely summable if
3) A sequence xn is called square-summable if
2
n
n
x


 

(1.79.1)
(1.79.2)
(1.79.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
80
Classification of sequences
sin
,
a c
n
n
x n
n


     
Therefore, a square-summable sequence has finite energy and is an
energy signal if it also has zero power.
An example of a sequence that is square-summable but not absolutely
summable is
Examples of sequences that are neither absolutely summable nor
square-summable are
sin ,
,
b
n c
c
n
x n n
x K n

    
    
where K is a constant.
(1.80.1)
(1.80.2)
(1.80.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
81
Important quantities in discrete time
Kronecker delta (unit sample, unit
impulse) function:
1, 0
0, 0
n
n
n

 

 
 

(1.81.1)
Shifted by k samples unit sample
function:
1,
0,
n k
n k
n k
 
 

 
 

(1.81.2)
k = 2
ELEN 4304/5346 Digital Signal Processing Fall 2008
82
Important quantities in discrete time
The unit step function: 1, 0
0, 0
n
n
n

 

 
 

(1.82.1)
Shifted by k samples unit step
function:
1,
0,
n
n k
n k

 

 
 

(1.82.2)
k = -2
ELEN 4304/5346 Digital Signal Processing Fall 2008
83
Important quantities in discrete time
0
1
n
n n m k
m k
n n n
  
  


 

 
 
 
The unit sample and unit step sequences are related as follows:
(1.83.1)
(1.83.2)
The real sinusoidal sequence with constant amplitude:
 
0
cos ,
n
x A n n
 
     
where A, 0,  are real numbers: the amplitude, the angular frequency,
and the phase of the sinusoidal sequence xn.
(1.83.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
84
Important quantities in discrete time
i q
n n n
x x x
 
The real sinusoidal sequence can also be written as
where xi
n and xq
n are the in-phase and quadrature of xn that are given by
   
0 0
cos cos ; sin sin
i q
n n
x A n x A n
   
   
(1.84.1)
(1.84.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
85
Important quantities in discrete time
,
n
n
x A n

     
 
0 0
,
j j
e A A e
  
 
  
   
   
0 0 0
0
0 0
0 0
cos sin
j n j n
n
n
n n
x Ae A e e
A e n j A e n
   

 
   
 
 
   
The exponential sequence is
where A and  are real or complex numbers computed as
Therefore:
If
re im
n n n
x x x
 
then
   
0 0
0 0
cos ; sin
n n
re im
n n
x A e n x A e n
 
   
    
(1.85.1)
(1.85.2)
(1.85.3)
(1.85.4)
(1.85.5)
ELEN 4304/5346 Digital Signal Processing Fall 2008
86
Important quantities in discrete time
With both A and  real, (1.85.1) reduces to a real exponential sequence.
For n  0, such a
sequence with | |
< 1 decays
exponentially as n
increases and with
| | > 1 grows
exponentially as n
increases.
ELEN 4304/5346 Digital Signal Processing Fall 2008
87
Important quantities in discrete time
System’s impulse response:
n k n k
k
h b  
 
Discrete convolution:
n n n n n l n l
l
y x h h x x h



     
All LTI systems satisfy the convolution equation where:
xn is an input to the system, yn is its output, and hn is the
system’s impulse response.
(1.87.1)
(1.87.2)
Convolution with an impulse:
0 0
n n n n n
x x
  
  (1.87.3)
ELEN 4304/5346 Digital Signal Processing Fall 2008
88
Question time!
Remark: strictly speaking, to make a signal
digital, in addition to discretization in time
(sampling), we need to quantize the samples
(make them discrete in amplitude), which will
be discussed later.
ELEN 4304/5346 Digital Signal Processing Fall 2008
89
Introduction to Matlab
Matlab is an interactive, matrix-based software complex for
scientific and engineering computations.
Interface: the main window
ELEN 4304/5346 Digital Signal Processing Fall 2008
90
Introduction to Matlab
Interface: the editor window
ELEN 4304/5346 Digital Signal Processing Fall 2008
91
Introduction to Matlab
Interface: figure windows
Whenever you plot results, they will be plotted in one of the figure windows.
ELEN 4304/5346 Digital Signal Processing Fall 2008
92
Introduction to Matlab
We may say that there are two ways to use Matlab:
• We can enter the data (manually or load from files or
external sources), manipulate the data (filter in some
manner) and plot (or save) the results through the main
window.
• Or we can write a code (actually, the same sequence of
commands we would enter one by one if we used the main
window) and save it as an *.m file to be able to come back
to it later. This is what the editor window is used for.
ELEN 4304/5346 Digital Signal Processing Fall 2008
93
Introduction to Matlab
We will concentrate on the “command (main) window (line)”
approach.
For help in Matlab:
1. Type help commandname where “commandname” stands for a name of a
command.
Ex: help plot
You will get all necessary information about the command: its syntactic,
arguments, etc. Pay attention to similar (or related) commands listed at the end.
2. If you don’t really know the name of a command you need,
type lookfor keyword where “keyword” is a word corresponding to what you are
looking for.
Ex: lookfor matrix
You will get a list of names and brief descriptions of commands containing the
“keyword”.
ELEN 4304/5346 Digital Signal Processing Fall 2008
94
Introduction to Matlab
• There is no need to describe (pre-allocate) any variables,
constants etc. before you use them.
• Matlab normally treats all the variables as matrices.
• For our purposes, we will usually work with 1D matrices –
vectors.
• Matlab is case sensitive! A and a are two different variables.
• Matlab remembers your entries: use the up-arrow to call
previous commands.
• Matlab is an expression language: variable = expression. If
variable and = are omitted, a variable ans is automatically
created, to which the result is assigned.
ELEN 4304/5346 Digital Signal Processing Fall 2008
95
Introduction to Matlab
To manually enter a matrix from the keyboard, type
A = [1,2,3;4,5,6;7,8,9];
or A = [1 2 3;4 5 6;7 8 9];
Commas (or spaces) divide entries within the same row; semicolons divide rows.
All rows MUST have the same number of elements!
We can call (and modify if needed) matrix elements by their indexes: A(2,3)
would bring 6 on the screen; A(2,3) = 21 will replace an entry 6 by 21.
The semicolon “;” at the end of the expression instructs not to show the result on
the screen.
So, if you need to check what A equals to, just type A and press “Enter”!
1 2 3
4 5 6
7 8 9
A
 
 
  
 
 
ELEN 4304/5346 Digital Signal Processing Fall 2008
96
Introduction to Matlab
You can merge together two or more matrices
Ex: A = [1 2 3]; B = [4 5 6 7 8]; C = [A B A];
Will create a vector C = [1 2 3 4 5 6 7 8 1 2 3]
Ex: A = [1 2 3]; A = [A;A.^2];
Will modify a vector A as follows:
1 2 3
1 4 9
A
 
 
 
Btw, we can call particular rows or columns of a matrix (a
vector) or their combinations:
A(2,:) will return [1 4 9] – all entries of the second row
A(:,2) will return - all entries of the second column
2
4
 
 
 
C = A(1:end,2:end)
is 2 3
4 9
C
 
 
 
ELEN 4304/5346 Digital Signal Processing Fall 2008
97
Introduction to Matlab
There are numerous functions that generate some common matrices:
zeros(n,m) – n by m array of zeros
ones(n,m) – n by m array of ones
eye(n) – n by n identity matrix
rand(n,m) – n by m array of UNIFORMLY distributed pseudo-random numbers
randn(n,m) – n by m array of NORMALLY distributed pseudo-random numbers
Trick: If you need to create a vector A of linearly increasing (decreasing) numbers,
Type something like: A = first:step:end;
where “first” is a value of the first element, “step” is the increment (decrement),
“end” is the value of the last element.
Ex: n = 1:100;
Ex: a = 21:0.14:531.2;
ELEN 4304/5346 Digital Signal Processing Fall 2008
98
Introduction to Matlab
Matrix operations
symbol description
+ Addition
- Subtraction
‘ Transpose
^ Power
* Multiplication
/ Right division
 Left division
symbol description
.^ Power
.* Multiplication
./ Right division
. Left division
Array operations
(entry by entry)
Ex:
1 2 5 6 19 22 5 12
; ; .*
3 4 7 8 43 50 21 32
A B A B A B
       
       
       
       
Note: “*” denotes multiplication here only! In this class, “*” implies convolution!
ELEN 4304/5346 Digital Signal Processing Fall 2008
99
Introduction to Matlab
All data you enter during the current session is stored in the
memory usually referred to as a workspace.
You may save your workspace by a command save.
You may erase (clear) any variable from the workspace by a
command clear variablename, where “variablename” stands
for a name of the variable you wish to erase. Command
clear all erases all nonpermanent variables!
To see what is in the workspace, use the command whos.
ELEN 4304/5346 Digital Signal Processing Fall 2008
100
Introduction to Matlab
FOR, WHILE, IF
FOR variable = expression, statement, ..., statement END
1. FOR – repeat the statement(s) a number of times
Ex: A = []; b = 4.35;
for ind = 1:5
A = [A ind^3];
B = b*A;
end
A = []; b = 4.35;
for ind = 1:5
A = [A ind^3];
end
B = b*A;
Better
style:
A = []; b = 4.35; for ind = 1:5, A = [A ind^3] end; B = b*A;
Equivalent:
ELEN 4304/5346 Digital Signal Processing Fall 2008
101
Introduction to Matlab
2. WHILE – repeat the statement(s) while the expression is true
WHILE expression, statement, ..., statement END
Ex: A = []; b = 4.35; ind = 1;
while ind <= 5
A = [A ind^3];
ind = ind + 1;
end
B = b*A;
ELEN 4304/5346 Digital Signal Processing Fall 2008
102
Introduction to Matlab
3. IF – execute the statement(s) if the expression is true
IF expression, statement, ..., statement END
Ex: A = randn(1);
B = 0.5;
if A < B
A = A+B;
end
ELEN 4304/5346 Digital Signal Processing Fall 2008
103
Introduction to Matlab
Relational operators
Operator Description
< Less than
> Greater than
<= Less or equal
>= Greater or equal
== Equal to
~= Non equal to
Operator Description
& And
| Or
~ Not
Logical operators
We may compare entire matrices (vectors).
ELEN 4304/5346 Digital Signal Processing Fall 2008
104
Introduction to Matlab
Example: generate 100 samples of a sinusoid at the frequency 0.04
1. “Traditional approach”:
for n = 1:100
x(n) = sin(0.04*pi*n);
end
2. “Matlab approach”:
x = sin(0.04*pi*[1:100]);
Much faster! Whenever data (or operations) can be vectorized, it speeds up
your code.
ELEN 4304/5346 Digital Signal Processing Fall 2008
105
Introduction to Matlab
Some build in Matlab functions…
sin(x) – “x” must be in radians
cos(x)
tan(x)
asin(x)
acos(x)
atan(x)
exp(x)
log(x) – natural log
rem(x) – remainder
abs(x) – absolute value
sqrt(x) – square root
sign(x) – sign of x
round(x) – rounds towards nearest integer
floor(x) – rounds towards minus infinity (down)
ceil(x) – rounds towards plus infinity (up)
abs(x) – where “x” is complex - modulus
angle(x) – phase angle in radians
real(x) – real part of complex “x”
imag(x) – imaginary part of “x”
ELEN 4304/5346 Digital Signal Processing Fall 2008
106
Introduction to Matlab
Some build in Matlab vector functions…
max
min
sort
sum
prod
median
mean
std
var
any
all
And some build in constants
pi
eps – machine precision
j, i
size(x) shows the size of “x” (number of
rows and columns)
ELEN 4304/5346 Digital Signal Processing Fall 2008
107
Introduction to Matlab
Figures and plotting stuff
figure – creates new figure
plot(x) – a planar plot of vector x on the current axes
polar(x) – a polar plot of vector x on the current axes
hold on; - tells Matlab to keep (hold) the existing plot such that the new plot
will be added
hold off; - “unhold” the existing plot will be replaced by the new plot
xlabel(string) – puts the “string” as a label on x-axis
ylabel(string) – puts the “string” as a label on y-axis
title(string) – puts the string as a figure title
legend(string1,string2,…) – ads a legend to the current axes
grid – manipulates gridlines
subplot – allows placing multiple axes on a single figure
xlim(v) – sets the limits (given in the vector v) for the x-axis
ylim(v) – sets the limits (given in the vector v) for the y-axis
ELEN 4304/5346 Digital Signal Processing Fall 2008
108
Introduction to Matlab
x = sin(0.04*pi*[1:100]);
plot(x,’-’,’linewigth’,2)
grid;
ylim([-1.1,1.1])
xlabel(‘Time, sample’)
ylabel(‘Amplitude’)
Example: the following code generates this
figure:
To copy your figure to another application (such as MS Word), go to the Edit
menu in the Figure window and select “Copy Figure”. Now, your figure is in the
computer memory and can be pasted into another application.
ELEN 4304/5346 Digital Signal Processing Fall 2008
109
Matlab summary
Remember:
1. Use help! No point to memorize everything.
2. Think in “matrix/vector” terms.
3. If Matlab stops responding and says it’s Busy,
“Ctrl”+”c” breaks the operation
4. If “Ctrl”+”c” did not help, “Ctrl”+”q” quits Matlab.
ELEN 4304/5346 Digital Signal Processing Fall 2008
110
Considerations and Definitions
We need to make distinctions between a software model (or
our paper/pencil work) and its hardware implementation.
System:
Filter = System
Continuous time Discrete time
We may use: time-, frequency-, and z-domain descriptions of a system:
hn - impulse response;
H() - frequency response (BIBO!);
H(z) – system function.
These descriptions (if they exist) are equivalent.
Additionally may be used:
(xn, yn) - Input/output pairs; {a, b, c,…} - state matrices; difference equations…
ELEN 4304/5346 Digital Signal Processing Fall 2008
111
Continuous vs. discrete time: sampling
from Mitra’s book:
Sampling frequency:
1
s
s
f
T

In general, sampling may lead to information been lost…
(1.111.1)
ELEN 4304/5346 Digital Signal Processing Fall 2008
112
System’s characteristics
0 0 0
n n n n n n n
x y x y x n
 
    
( k n) - no output before input
n n n k
x y y fct x
        
1. Linearity:
2. Time-invariance:
3. Causality:
4. Stability (BIBO):
1 1 2 2 1 2 1 2 1 2
, , ,
n n n n n n n n n n
x y and x y ax bx ay by x x a b
           
for every bounded input,
the output must be bounded
n x n y
x B y B
          
   
Important: use random input signals to test your system!
Important: we don’t really know whether the system is stable: it is stable only
for the particular (bounded) input!
(1.112)
Important: these properties are specified for relaxed systems only!
ELEN 4304/5346 Digital Signal Processing Fall 2008
113
Description of systems…
{ }
n k n k n m m k n k n n
k m k
y x h x h h x h
m n k linear convolutio
x n
  
      
   
  
' : Kroneker delta function
n k n k n
k
Let the system s input x x where is
 

         

If the system is linear:
' : ( ) { }
n k n k
k
k k n k
k
the system s output y x h
and I x
T
   
      

since ,
; ( ). :
n n n k n k n k n k
h h in general For TI h

    
       

Therefore:
hn is a complete I/O (input/output) description of an LTI system
n
0
n-k
n = k
1
(1.113.1)
(1.113.2)
ELEN 4304/5346 Digital Signal Processing Fall 2008
114
Notes on stability (BIBO) of LTI systems
{ : }
n k n k k n k n k x x k
k k k
Let y h x h x bounded input x B B h
  
       
  
for BIBO it is sufficient that: k
k
h absolute summability
  

0 0 0
Maximum ( ) ( )
( ) (
out
)
put:
n x n k n k n k x k
k k
k k x k x
k
k
k
Let x B and y h x max y h B si
h n
gn h
h sign h B sign h B is als ecessary
o

        
 
 
 


 
 
( 0
,
, 0 )
k h
k
n n n n
LTI BIBO
LTI Cau
h B
h h u
s l h n
a
  
 
 
 


 
 


(1.114.1)
(1.114.2)
(1.114.3)
(1.114.4)
(1.114.5)
ELEN 4304/5346 Digital Signal Processing Fall 2008
115
Causality test (for LTI)
0 0
0 0
0 0
1, 1, 1,
2, 2, 2,
n k n k k n k k n k
k k n n k n n
n k n k k n k
k n n k n n
n k n k k n k
k n n k n n
y h x h x h x n
y h x h x
y h x h x
  
   
 
   
 
   
   
  


 


  
 
 
1, 2, 0
0
n n
Since x x n n
    
0
1, 2, 1, 2, 1, 2, 0
0 0
0 ( ) {( ) 0} 0
0 0
n n k n k n k n k n k
k n n
k
y y h x x x x n n
h k n n and n n k
   
 
         
         

, 0 0
n
LTI causal h n
    
(1.115.1)
(1.115.2)

More Related Content

Similar to 13005810.ppt

Wiener Filter Hardware Realization
Wiener Filter Hardware RealizationWiener Filter Hardware Realization
Wiener Filter Hardware RealizationSayan Chaudhuri
 
Application of wavelet analysis algorithms for digital control an electromagn...
Application of wavelet analysis algorithms for digital control an electromagn...Application of wavelet analysis algorithms for digital control an electromagn...
Application of wavelet analysis algorithms for digital control an electromagn...IJERA Editor
 
A Novel Methodology for Designing Linear Phase IIR Filters
A Novel Methodology for Designing Linear Phase IIR FiltersA Novel Methodology for Designing Linear Phase IIR Filters
A Novel Methodology for Designing Linear Phase IIR FiltersIDES Editor
 
CS_2011_5_Digital_Modulators.pdf
CS_2011_5_Digital_Modulators.pdfCS_2011_5_Digital_Modulators.pdf
CS_2011_5_Digital_Modulators.pdfssuser5962131
 
Image and Audio Signal Filtration with Discrete Heap Transforms
Image and Audio Signal Filtration with Discrete Heap TransformsImage and Audio Signal Filtration with Discrete Heap Transforms
Image and Audio Signal Filtration with Discrete Heap Transformsmathsjournal
 
Applications Section 1.3
Applications   Section 1.3Applications   Section 1.3
Applications Section 1.3mobart02
 
Espacios y subepacios vectoriales
Espacios y subepacios vectorialesEspacios y subepacios vectoriales
Espacios y subepacios vectorialesMirianArcos1
 
Chap 7. 01-38.pdf
Chap 7. 01-38.pdfChap 7. 01-38.pdf
Chap 7. 01-38.pdfKbNguyen1
 
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdfConsider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdfferoz544
 
2013.06.18 Time Series Analysis Workshop ..Applications in Physiology, Climat...
2013.06.18 Time Series Analysis Workshop ..Applications in Physiology, Climat...2013.06.18 Time Series Analysis Workshop ..Applications in Physiology, Climat...
2013.06.18 Time Series Analysis Workshop ..Applications in Physiology, Climat...NUI Galway
 
Ec8352 signals and systems 2 marks with answers
Ec8352 signals and systems   2 marks with answersEc8352 signals and systems   2 marks with answers
Ec8352 signals and systems 2 marks with answersGayathri Krishnamoorthy
 
Lecture2 (vectors and tensors).pdf
Lecture2 (vectors and tensors).pdfLecture2 (vectors and tensors).pdf
Lecture2 (vectors and tensors).pdfentesarkareem1
 
Some Engg. Applications of Matrices and Partial Derivatives
Some Engg. Applications of Matrices and Partial DerivativesSome Engg. Applications of Matrices and Partial Derivatives
Some Engg. Applications of Matrices and Partial DerivativesSanjaySingh011996
 

Similar to 13005810.ppt (20)

Wiener Filter Hardware Realization
Wiener Filter Hardware RealizationWiener Filter Hardware Realization
Wiener Filter Hardware Realization
 
Application of wavelet analysis algorithms for digital control an electromagn...
Application of wavelet analysis algorithms for digital control an electromagn...Application of wavelet analysis algorithms for digital control an electromagn...
Application of wavelet analysis algorithms for digital control an electromagn...
 
A Novel Methodology for Designing Linear Phase IIR Filters
A Novel Methodology for Designing Linear Phase IIR FiltersA Novel Methodology for Designing Linear Phase IIR Filters
A Novel Methodology for Designing Linear Phase IIR Filters
 
Introduction to Adaptive filters
Introduction to Adaptive filtersIntroduction to Adaptive filters
Introduction to Adaptive filters
 
Matrices ppt
Matrices pptMatrices ppt
Matrices ppt
 
Dynamics
DynamicsDynamics
Dynamics
 
CS_2011_5_Digital_Modulators.pdf
CS_2011_5_Digital_Modulators.pdfCS_2011_5_Digital_Modulators.pdf
CS_2011_5_Digital_Modulators.pdf
 
Image and Audio Signal Filtration with Discrete Heap Transforms
Image and Audio Signal Filtration with Discrete Heap TransformsImage and Audio Signal Filtration with Discrete Heap Transforms
Image and Audio Signal Filtration with Discrete Heap Transforms
 
Applications Section 1.3
Applications   Section 1.3Applications   Section 1.3
Applications Section 1.3
 
Espacios y subepacios vectoriales
Espacios y subepacios vectorialesEspacios y subepacios vectoriales
Espacios y subepacios vectoriales
 
Dsp lab manual
Dsp lab manualDsp lab manual
Dsp lab manual
 
Chap 7. 01-38.pdf
Chap 7. 01-38.pdfChap 7. 01-38.pdf
Chap 7. 01-38.pdf
 
505 260-266
505 260-266505 260-266
505 260-266
 
Signal Processing Assignment Help
Signal Processing Assignment HelpSignal Processing Assignment Help
Signal Processing Assignment Help
 
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdfConsider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
Consider a l-D elastic bar problem defined on [0, 4]. The domain .pdf
 
2013.06.18 Time Series Analysis Workshop ..Applications in Physiology, Climat...
2013.06.18 Time Series Analysis Workshop ..Applications in Physiology, Climat...2013.06.18 Time Series Analysis Workshop ..Applications in Physiology, Climat...
2013.06.18 Time Series Analysis Workshop ..Applications in Physiology, Climat...
 
Ec8352 signals and systems 2 marks with answers
Ec8352 signals and systems   2 marks with answersEc8352 signals and systems   2 marks with answers
Ec8352 signals and systems 2 marks with answers
 
Lecture2 (vectors and tensors).pdf
Lecture2 (vectors and tensors).pdfLecture2 (vectors and tensors).pdf
Lecture2 (vectors and tensors).pdf
 
Some Engg. Applications of Matrices and Partial Derivatives
Some Engg. Applications of Matrices and Partial DerivativesSome Engg. Applications of Matrices and Partial Derivatives
Some Engg. Applications of Matrices and Partial Derivatives
 
Signal Processing Assignment Help
Signal Processing Assignment HelpSignal Processing Assignment Help
Signal Processing Assignment Help
 

Recently uploaded

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxVishalSingh1417
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 

Recently uploaded (20)

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 

13005810.ppt

  • 1. ELEN 4304/5346 Digital Signal Processing Fall 2008 1 Lecture 01: Introduction Based on ECE 4624 by Dr. A.A. (Louis) Beex, Virginia Tech Instructor: Dr. Gleb V. Tcheslavski Contact: gleb@ee.lamar.edu Office Hours: Room 2030 Class web site: http://ee.lamar.edu/gleb/dsp/ind ex.htm
  • 2. ELEN 4304/5346 Digital Signal Processing Fall 2008 2 Syllabus overview • Pre-req.: ELEN 3313 Signals and Systems or their equivalent • Required book: Sanjit K. Mitra, Digital-Signal Processing: A Computer-Based Approach, McGraw-Hill Co., Third edition, 2004, ISBN: 0-07-286546-6. • Required software: The Mathworks, The Student Edition of MATLAB, Release 2006a or later. • Structure: Two 75-minute lectures per week. One homework, three projects, midterm exam, and the final examination. • Tests: The Midterm and Final exams will be closed book/notes. Your performance on the Projects will account for the bulk of your grade. • Honor System: Discussions on lecture subject material, to clarify your understanding, are highly encouraged. However, it is your personal understanding only that should be reflected in all work that you turn in. Any copyright violations (including copying articles and/or web pages to your reports) will be prosecuted!
  • 3. ELEN 4304/5346 Digital Signal Processing Fall 2008 3 Styles, notations, legends… 1. Colors: Normal text and formulas Something more important (imho) Important formulas and results Very Important Formulas Miscellaneous 2. Equations notations: (2.17.3) Lecture # Slide # Formula #
  • 4. ELEN 4304/5346 Digital Signal Processing Fall 2008 4 Linear algebra overview It is convenient in many applications to represent signals and system coefficients by vectors and matrices. Therefore, a brief overview of linear algebra is considered. 1. Vectors A vector (denoted by a lowercase bold letter) is an array of real-valued or complex- valued numbers or functions. We will assume column vectors. The N-dimensional vector is: 1 2 N x x x              x The transpose of a vector is a row vector:   1 2 T N x x x  x (1.4.1) (1.4.2)
  • 5. ELEN 4304/5346 Digital Signal Processing Fall 2008 5 Linear algebra overview The Hermitian transpose is the complex conjugate of the transpose of x:   * * * * 1 2 H T N x x x       x x It might be convenient in some cases to consider a set of values xn containing the signal values in the certain range: 1 1 n n n n N x x x                 x (1.5.1) (1.5.2)
  • 6. ELEN 4304/5346 Digital Signal Processing Fall 2008 6 Linear algebra overview The measure of the “magnitude” of the vector is the norm. The Euclidean or L2 norm: 2 2 1 N i i x    x The L1 norm: 1 1 N i i x    x The L norm: max i i x   x We will be using the second norm unless stated otherwise. If the vector has a non-zero norm, it can be normalized as follows: x  x v x (1.6.1) (1.6.2) (1.6.3) (1.6.4) The vector vx is a unit norm vector that lies in the same direction as x.
  • 7. ELEN 4304/5346 Digital Signal Processing Fall 2008 7 Linear algebra overview Lastly, the norm can be used to measure the distance between two vectors:   2 1 , N i i i d x y       x y x y (1.7.2) For two complex vectors a and b of the same length, the inner product is a scalar defined as * 1 , N H i i i a b     a b a b For two real vectors, the inner product becomes 1 , N T i i i a b     a b a b (1.7.3) (1.7.4) The squared norm represents the energy in the signal: 1 2 2 0 N n n x     x (1.7.1)
  • 8. ELEN 4304/5346 Digital Signal Processing Fall 2008 8 Linear algebra overview where  is the angle between two vectors. Therefore, two nonzero vectors a and b are orthogonal if their inner product is zero: The inner product defines the geometrical relationship between two vectors: , cos  a b a b (1.8.1) , 0  a b Two vectors that are orthogonal and have unit norms are called orthonormal. Since |cos|  1, the inner product is bounded: ,  a b a b (1.8.3) is known as the Cauchy-Schwarz inequality. The equality holds iff a and b are colinear, i.e. ,      a b const (1.8.2) (1.8.3) (1.8.4)
  • 9. ELEN 4304/5346 Digital Signal Processing Fall 2008 9 Linear algebra overview Another useful inequality is 2 2 2 ,   a b a b (1.9.1) The output of an LTI FIR filter can be represented using the inner product. If the filter output is the convolution of its unit pulse response and the input 1 0 N n k n k k y h x      then, expressing x as in (1.5.2) and representing hn as   0 1 1 T N h h h   h the filter output may be written as the inner product: T n n y  h x (1.9.2) (1.9.3) (1.9.4)
  • 10. ELEN 4304/5346 Digital Signal Processing Fall 2008 10 Linear algebra overview A set of n vectors v1, v2, … vn is linearly independent if 1 1 2 2 0 n n        v v v implies that i = 0 for all i. If a set of nonzero i can be found satisfying (1.10.1), the vectors are linearly dependent and at least one of the vectors, say v1 can be expressed as a linear combination of the remaining vectors: 1 2 2 3 3 n n        v v v v for some set of scalars i. For vectors of dimension N, no more than N vectors may be linearly independent. Therefore, any set of N-dimensional vectors containing more than N vectors will always be linearly dependent. (1.10.1) (1.10.2)
  • 11. ELEN 4304/5346 Digital Signal Processing Fall 2008 11 Linear algebra overview For a set of N vectors v1, v2, … vn   1 2 n  V v v v Consider the set of all vectors V that may be formed from a linear combination of the vectors vi 1 N i i i     v v This set forms a vector space, and the vectors vi are said to span the space V. Furthermore, if the vectors vi are linearly independent, they form a basis for the space V, and the number of vectors in the basis N is the dimension of the space. For instance, the set of all real vectors of the form   1 2 T N x x x  x forms an N-dimensional vector space, denoted by RN that is spanned by the basis vectors (1.11.1) (1.11.2) (1.11.3)
  • 12. ELEN 4304/5346 Digital Signal Processing Fall 2008 12 Linear algebra overview       1 2 1 0 0 0 0 1 0 0 0 0 0 1 T T T N    u u u In terms of basis, any vector   1 2 T N v v v  v may be uniquely decomposed as follows: 1 N i i i v    v u It should be pointed out, however, that the basis for a vector space is not unique. (1.12.1) (1.12.2) (1.12.3)
  • 13. ELEN 4304/5346 Digital Signal Processing Fall 2008 13 Linear algebra overview 2. Matrices An n x m matrix is an array of real or complex numbers or functions having n rows and m columns. 11 12 13 1 21 22 23 2 1 2 3 m m n n n nm a a a a a a a a a a a a              A An n x m matrix of numbers An n x m matrix of functions 11 12 13 1 21 22 23 2 1 2 3 ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) m m n n n nm a z a z a z a z a z a z a z a z z a z a z a z a z              A If n = m, A is a square matrix. (1.13.1) (1.13.2)
  • 14. ELEN 4304/5346 Digital Signal Processing Fall 2008 14 Linear algebra overview The output of an LTI FIR filter can be written in vector form as follows: T T n n n y   h x x h If xn = 0 for n < 0, the filter output may be expressed for n  0 as 0  y X h where X0 is the convolution matrix 0 1 0 2 1 0 0 1 2 3 0 0 0 0 0 0 0 N N N x x x x x x x x x x                       X and   0 1 2 T y y y  y (1.14.1) (1.14.2) (1.14.3) (1.14.4) We observe that, in addition to its structure of having equal values along each of the diagonals, X0 has N-1 columns and an infinite number of rows.
  • 15. ELEN 4304/5346 Digital Signal Processing Fall 2008 15 Linear algebra overview An n x m matrix can be represented as a set of m column vectors   1 2 m  A c c c or as a set of n row vectors 1 2 H H H n                r r A r (1.15.1) (1.15.2) An n x m matrix may be partitioned into submatrices as follows 11 12 21 22        A A A A A where A11 is p x q, A12 is p x (m-q), A21 is (n-p) x q, and A22 is (n-p) x (m-q). (1.15.3)
  • 16. ELEN 4304/5346 Digital Signal Processing Fall 2008 16 Linear algebra overview If A is an n x m matrix, then the transpose AT is the m x n matrix that is formed by interchanging the rows and columns of A. Therefore, the (i, j)th element becomes the (j, i)th element and vice versa. If the matrix is square, the transpose is formed by reflecting its elements with respect to the diagonal. A square matrix A is symmetric if T  A A For complex matrices, the Hermitian transpose is defined as     * * T H T   A A A A square complex matrix A is Hermitian if H  A A (1.16.1) (1.16.2) (1.16.3)
  • 17. ELEN 4304/5346 Digital Signal Processing Fall 2008 17 Linear algebra overview Useful properties of Hermitian transpose are       1. 2. 3. H H H H H H H H         A B A B A A AB B A Replacing the Hermitian transpose with an ordinary transpose, we obtain       1. 2. 3. T T T T T T T T         A B A B A A AB B A (1.17.1) (1.17.2)
  • 18. ELEN 4304/5346 Digital Signal Processing Fall 2008 18 Linear algebra overview Let A be an n x m matrix partitioned in a set of m column vectors   1 2 m  A c c c (1.18.1) The rank of A, rank(A) is defined as the number of linearly independent columns in A, i.e., the number of linearly independent vectors in the set {c1, c2, … , cm}. One of the properties of the rank is that ( ) ( ) H rank rank   A A Therefore, if A is partitioned in a set of n row vectors 1 2 H H H n                r r A r Then, the rank of A is also equal to the number of linearly independent row vectors. (1.18.2) (1.18.3)
  • 19. ELEN 4304/5346 Digital Signal Processing Fall 2008 19 Linear algebra overview The important property of the rank is ( ) ( ) ( ) H H rank rank rank   A AA A A (1.19.1) Since the rank of a matrix is equal to the number of linearly independent rows and the number of linearly independent columns, then, if A is an m x n matrix: ( ) min( , ) rank m n  A If A is an m x n matrix and rank(A) = min(n,m), then A is of full rank. If A is a square matrix of full rank, then there exists a unique matrix A-1 called the inverse of A such that 1 1     A A AA I (1.19.2) (1.19.3)
  • 20. ELEN 4304/5346 Digital Signal Processing Fall 2008 20 Linear algebra overview where 1 0 0 0 1 0 0 0 1              I (1.20.1) is the identity matrix with ones along the main diagonal and zeros everywhere else. In this case, A is said to be invertible or nonsingular. If A is not of full rank, then it is noninvertible or singular and does not have an inverse. If A and B are invertible, then           1 1 1 1 1 1 1 1 1 1 1 1 1. 2. 3. H H                      AB B A A A A BCD A A B C DA B DA (1.20.2) (1.20.3) (1.20.4)
  • 21. ELEN 4304/5346 Digital Signal Processing Fall 2008 21 Linear algebra overview (1.20.4) is called the matrix inversion lemma. It is assumed that A is n x n, B is n x m, C is m x m, and D is m x n with A and C nonsingular matrices. A special case of this lemma occurs when C = 1, B = u, and D = vH where u and v are n-dimensional vectors. In this case   1 1 1 1 1 1 H H H          A uv A A uv A v A u Which is sometimes referred to as a Woodbury’s identity. As a special case, if A = I, (1.21.1) becomes   1 1 H H H      uv I uv I v u (1.21.1) (1.21.2)
  • 22. ELEN 4304/5346 Digital Signal Processing Fall 2008 22 Linear algebra overview If A = a11 is a 1 x 1 matrix, the determinant is defined as det(A) = a11. For an n x n matrix, the determinant is defined recursively as     1 det( ) 1 det n i j ij ij i a      A A where Aij is the (n-1) x (n-1) matrix formed by deleting the ith row and the jth column of A. Property: An n x n matrix A is invertible iff det( ) A 0 (1.22.1) (1.22.2)
  • 23. ELEN 4304/5346 Digital Signal Processing Fall 2008 23 Linear algebra overview For A and B being n x n matrices, if A is invertible, and a constant , the following properties hold:                   1 1. det det det 2. det det 3. det det 1 4. det det T n            AB A B A A A A A A For an n x n matrix A, the trace function is defined as   1 n ii i tr a    A (1.23.1) (1.23.2) (1.23.3) (1.23.4) (1.23.5)
  • 24. ELEN 4304/5346 Digital Signal Processing Fall 2008 24 Linear algebra overview 3. Linear equations Consider the following set of n linear equations in the m unknowns xi, i = 1,2,…,m 11 1 12 2 1 1 21 1 22 2 2 2 1 1 2 2 ... ... ... m m m m n n nm m n a x a x a x b a x a x a x b a x a x a x b             These equations may be written in matrix form as follows  Ax b (1.24.1) (1.24.2) Where A is an n x m matrix with entries aij, x is an m-dimensional vector of unknowns xi, and b is an n-dimensional vector with elements bi.
  • 25. ELEN 4304/5346 Digital Signal Processing Fall 2008 25 Linear algebra overview A convenient way to view (1.24.2) is as an expansion of vector b in terms of a linear combination of the column vectors ai of the matrix A: 1 m i i i x    b a Solving (1.25.1) depends on a number of factors including the relative size of m and n, the rank of A, and the elements of b. (1.25.1) 3.1. Square matrix: m = n. The solution to (1.25.1) depends upon whether or not A is singular. If A is nonsingular, then the inverse A-1 exists and the solution is uniquely defined by 1   x A b (1.25.2) However, if A is singular, then there may either be no solution (the equations are inconsistent) or many solutions.
  • 26. ELEN 4304/5346 Digital Signal Processing Fall 2008 26 Linear algebra overview For the case in which A is singular, the columns of A are linearly dependent and there exist nonzero solutions to the homogeneous equation  Az 0 In fact, there will be k = n – rank(A) linearly independent solutions to the homogeneous equations. Therefore, if there is at least one vector x0 that solves (1.24.2), then any vector of the form 0 1 1 ... k k       x x z z will also be a solution where zi, i = 1,2,…,k are linearly independent solutions to (1.24.2). (1.26.1) (1.26.2)
  • 27. ELEN 4304/5346 Digital Signal Processing Fall 2008 27 Linear algebra overview 3.2. Rectangular matrix: n < m. In this situation, there are fewer equations then unknowns. Therefore, if the equations are not inconsistent, there are many vectors satisfying the equations: the solution is undetermined or incompletely specified. A common approach to define a unique solution is to find the vector that satisfies the equations and has a minimum norm; i.e. min suchthat     x Ax b If rank(A) = n (the rows of A are linearly independent), then the n x n matrix AAH is invertible and the minimum norm solution is   1 0 H H   x A AA b   1 H H    A A AA The matrix is called the pseudo-inverse of the matrix A for the undetermined problem. (1.27.1) (1.27.2) (1.27.3)
  • 28. ELEN 4304/5346 Digital Signal Processing Fall 2008 28 Linear algebra overview 3.3. Rectangular matrix: n > m. In this situation, there are more equations then unknowns and, in general, no solution exists. The equations are inconsistent and the solution is overdetermined. For the case of 3 equations in 2 unknowns, this problem is illustrated: Since an arbitrary vector b cannot be represented as a linear combination of the columns of A, the goal is to find the coefficients xi producing the best approximation to b: 1 ˆ m i i i x a    b (1.28.1)
  • 29. ELEN 4304/5346 Digital Signal Processing Fall 2008 29 Linear algebra overview (1.29.1) The approach commonly used in this situation is to find the least squares solution; i.e., the vector x minimizing the norm of the error 2 2   e b Ax The least squares solution has the property that the error   e b Ax is orthogonal to the column vectors of A. This orthogonality implies that 0 H  A e or H H  A AX A b which are known as the normal equations. (1.29.2) (1.29.3) (1.29.4)
  • 30. ELEN 4304/5346 Digital Signal Processing Fall 2008 30 Linear algebra overview If the columns of A are linearly independent (A has full rank), the matrix AHA is invertible and the least square solution is   1 0 H H   x A A A b or 0   x A b where   1 H H    A A A A is the pseudo-inverse of the matrix A for the overdetermined problem. Furthermore, the best approximation of b is given by the projection of the vector b onto the subspace spanned by the vectors ai   1 0 ˆ H H    b Ax A A A A b (1.30.1) (1.30.2) (1.30.3) (1.30.4)
  • 31. ELEN 4304/5346 Digital Signal Processing Fall 2008 31 Linear algebra overview or where   1 H H A   P A A A A ˆ A  b P b (1.31.1) (1.31.2) is called the projection matrix. Finally, using the orthogonality condition, the minimum mean square error is 2 0 min H H H    e b e b b b Ax (1.31.3)
  • 32. ELEN 4304/5346 Digital Signal Processing Fall 2008 32 Linear algebra overview 4. Special matrix forms 4.1. Diagonal matrix – a square matrix having all entries equal to zero except, possibly, for those along the main diagonal: 11 22 0 0 0 0 0 0 nn a a a              A The diagonal matrix may be written as   11 22 diag nn a a a  A (1.32.1) (1.32.2)
  • 33. ELEN 4304/5346 Digital Signal Processing Fall 2008 33 Linear algebra overview 4.2. Identity matrix – a diagonal matrix with ones along the diagonal:   1 0 0 0 1 0 diag 1 1 1 0 0 1               I (1.33.1) 4.3. Block diagonal matrix – a diagonal matrix whose entries along the diagonal are replaced with matrices: 11 22 0 0 0 0 0 0 nn              A A A A (1.33.2)
  • 34. ELEN 4304/5346 Digital Signal Processing Fall 2008 34 Linear algebra overview (1.34.1) 4.4. Exchange matrix – a symmetric matrix with ones along the cross-diagonal and zeros everywhere else. Since J2 = I, then J is its own inverse. 0 0 1 0 1 0 1 0 0              J The effect of multiplying a vector v by the exchange matrix is a vector with reversed order of the entries; i.e., 1 2 1 1 n n n v v v v v v                           J (1.34.2)
  • 35. ELEN 4304/5346 Digital Signal Processing Fall 2008 35 Linear algebra overview Similarly, if a matrix A is multiplied on the left by the exchange matrix, the effect is to reverse the order of each column. For example: 11 12 13 21 22 23 31 32 33 a a a a a a a a a            A then 31 32 33 21 22 23 11 12 13 T a a a a a a a a a            J A (1.35.1) (1.35.2)
  • 36. ELEN 4304/5346 Digital Signal Processing Fall 2008 36 Linear algebra overview Similarly, if a matrix A is multiplied on the right by the exchange matrix, the effect is to reverse the order of each row: 13 12 11 23 22 21 33 32 31 a a a a a a a a a            AJ Finally, the effect of forming the product JTAJ is to reverse the order of each row and column 33 32 31 23 22 21 13 12 11 T a a a a a a a a a            J AJ thereby reflecting each element of A about the central element. (1.36.1) (1.36.2)
  • 37. ELEN 4304/5346 Digital Signal Processing Fall 2008 37 Linear algebra overview 4.5. Upper triangular matrix – a square matrix, in which all entries below the diagonal are zero: 0 ij a for i j     For example, for n = 4 11 12 13 14 22 23 24 33 34 44 0 0 0 0 0 0 a a a a a a a a a a              A 4.6. Lower triangular matrix – a square matrix, in which all entries above the diagonal are zero: 0 ij a for i j     (1.37.1) (1.37.2) (1.37.3)
  • 38. ELEN 4304/5346 Digital Signal Processing Fall 2008 38 Linear algebra overview Some properties of lower and upper triangular matrices are: 1. The transpose of a lower (upper) triangular matrix is an upper (lower) triangular matrix; 2. The determinant of a lower or upper triangular matrix is 3. The inverse of an upper (lower) triangular matrix is upper (lower) triangular; 4. The product of two upper (lower) triangular matrices is upper (lower) triangular. 1 det( ) n ii i a    A (1.38.1)
  • 39. ELEN 4304/5346 Digital Signal Processing Fall 2008 39 Linear algebra overview 4.7. Toeplitz matrix – a square n x n matrix, in which all entries along each of the diagonals have the same value 1, 1 , ij i j a a i n j n        For example, for n = 4 1 3 5 7 2 1 3 5 4 2 1 3 6 4 2 1              A (1.39.1) (1.39.2)
  • 40. ELEN 4304/5346 Digital Signal Processing Fall 2008 40 Linear algebra overview 4.8. Hankel matrix – a square n x n matrix, in which all entries along each of the cross-diagonals have the same value 1, 1 , ij i j a a i n j n        For example, for n = 4 1 3 5 7 3 5 7 4 5 7 4 2 7 4 2 1              A (1.40.1) (1.40.2) Another example of Hankel matrices is the exchange matrix J.
  • 41. ELEN 4304/5346 Digital Signal Processing Fall 2008 41 Linear algebra overview Toeplitz matrices are a special case of matrices known as persymmetric. 4.9. Persymmetric matrix – a matrix symmetric about the cross-diagonal: 1, 1 ij n j n i a a      For example, for n = 4, a persymmetric but non-Toeplitz matrix: 1 3 5 7 2 2 4 5 4 4 2 3 6 4 2 1              A (1.41.1) (1.41.2) If a Toeplitz matrix is symmetric (or Hermitian in the case of a complex matrix), we only need to specify the first row and the first column to completely determine a Toeplitz matrix.
  • 42. ELEN 4304/5346 Digital Signal Processing Fall 2008 42 Linear algebra overview Symmetric Toeplitz matrices are a special case of matrices known as centrosymmetric. 4.10. Centrosymmetric matrix – a matrix that is both symmetric and persymmetric. For example, for n = 4, a centrosymmetric but non-Toeplitz matrix: 1 3 5 6 3 2 4 5 5 4 2 3 6 5 3 1              A (1.42.1) If A is a symmetric Toeplitz matrix, then T  J AJ A If A is a Hermitian Toeplitz matrix, then * T  J AJ A (1.42.2) (1.42.3)
  • 43. ELEN 4304/5346 Digital Signal Processing Fall 2008 43 Linear algebra overview Some important properties are… 1. The inverse of a symmetric matrix is symmetric; 2. The inverse of a persymmetric matrix is persymmetric; 3. The inverse of a Toeplitz matrix is not, in general, Toeplitz. However, since a Toeplitz matrix is persymmetric, the inverse will always be persymmetric. Furthermore, the inverse of a symmetric Toeplitz matrix will be centrosymmetric. The relationship between the symmetries of a matrix and its inverse
  • 44. ELEN 4304/5346 Digital Signal Processing Fall 2008 44 Linear algebra overview 4.11. Orthogonal matrix – a real n x n matrix with orthogonal columns (and rows):   1 2 n  A a a a and If 1 0 T i j for i j for i j           a a then A is orthogonal. We observe that if A is orthogonal, then T  A A I Therefore, the inverse of an orthogonal matrix is equal to its transpose: 1 T   A A (1.44.1) (1.44.2) (1.44.3) (1.44.4)
  • 45. ELEN 4304/5346 Digital Signal Processing Fall 2008 45 Linear algebra overview 4.12. Unitary matrix – a complex n x n matrix with orthogonal columns (rows): 1 0 H i j for i j for i j           a a H  A A I 1 H   A A (1.45.2) (1.45.3) then (1.45.1) The inverse of a unitary matrix equals to its Hermitian transpose
  • 46. ELEN 4304/5346 Digital Signal Processing Fall 2008 46 Linear algebra overview The quadratic form of a real symmetric n x n matrix A is the scalar defined by   1 1 n n T A i ij j i j Q x a x      x x Ax where x is a vector of n real variables. Observe that the quadratic form is a quadratic function in the n variables x1, x2, …, xn. For example, the quadratic form of 3 1 1 2        A is   2 2 1 1 2 2 3 2 2 T A Q x x x x     x x Ax (1.46.1) (1.46.2) (1.46.3)
  • 47. ELEN 4304/5346 Digital Signal Processing Fall 2008 47 Linear algebra overview Similarly, for a Hermitian matrix, the Hermitian form is   * 1 1 n n H A i ij j i j Q x a x      x x Ax (1.47.1) If the quadratic form of a matrix A is positive for all nonzero vectors x,   0 A Q  x then A is said to be positive definite and we write A > 0. For example, if (1.47.2) 2 0 0 3        A which has the quadratic form     1 2 2 1 2 1 2 2 2 0 2 3 0 3 A x Q x x x x x                x (1.47.3) (1.47.4) is positive definite since QA(x) > 0 for all x  0.
  • 48. ELEN 4304/5346 Digital Signal Processing Fall 2008 48 Linear algebra overview If the quadratic form of a matrix A is non negative for all nonzero vectors x,   0 A Q  x then A is said to be positive semidefinite. (1.48.1) If the quadratic form of a matrix A is negative for all nonzero vectors x,   0 A Q  x then A is said to be negative definite. (1.48.2) If the quadratic form of a matrix A is non positive for all nonzero vectors x,   0 A Q  x then A is said to be negative semidefinite. (1.48.3) A matrix A that is none of the above is called indefinite.
  • 49. ELEN 4304/5346 Digital Signal Processing Fall 2008 49 Linear algebra overview 5. Eigenvalues and Eigenvectors Let A be an n x n matrix and consider the following set of linear equations:   Av v where  is a constant. Equivalently:   0    A I v (1.49.1) (1.49.2) In order for a nonzero vector v to be a solution to this equation, it is necessary for the matrix A - I to be singular. Therefore, the determinant of A - I must be zero:     det 0 p      A I where p() is an nth order polynomial in . This polynomial is called the characteristic polynomial of the matrix A and its n roots i for i = 1, 2,…, n are called the eigenvalues of A. (1.49.3)
  • 50. ELEN 4304/5346 Digital Signal Processing Fall 2008 50 Linear algebra overview For each eigenvalue i for i = 1, 2,…, n the matrix A - I will be singular and there will be at least one nonzero vector vi that solves (1.49.1); i.e. i i i   Av v These vectors vi are called the eigenvectors of A. For any eigenvector vi, vi will also be an eigenvector for any constant . Therefore, eigenvectors are often normalized to have unit norm. Property 1: The nonzero eigenvectors v1, v2, … vn corresponding to the distinct eigenvalues 1, 2, …, n are linearly independent. If A is an n x n singular matrix, then there are nonzero solutions to the homogeneous equation 0 i  Av and it follows that  = 0 is an eigenvalue of A. There are n – rank(A) linearly independent solutions to (1.50.2). Therefore, A will have rank(A) nonzero eigenvalues and n – rank(A) eigenvalues that are equal zero. (1.50.1) (1.50.2)
  • 51. ELEN 4304/5346 Digital Signal Processing Fall 2008 51 Linear algebra overview Property 2: The eigenvalues of a Hermitian matrix are real. Property 3: A Hermitian matrix is positive definite A > 0 iff eigenvalues of A are positive: k > 0. Property 4: The eigenvectors of a Hermitian matrix corresponding to distinct eigenvalues are orthogonal; i.e. The determinant of a matrix is related to its eigenvalues as   1 det n i i     A (1.51.1) , 0 i j i j if then         v v (1.51.2) Spectral Theorem: Any Hermitian matrix A can be decomposed as 1 1 1 2 2 2 ... H H H H n n n         A VΛV v v v v v v (1.51.3) where i are the eigenvalues of A and vi are a set of orthonormal eigenvectors.
  • 52. ELEN 4304/5346 Digital Signal Processing Fall 2008 52 Linear algebra overview Property 5: Let B be an n x n matrix with eigenvalues i and let A be a matrix that is related to B as follows    A B I Then A and B have the same eigenvectors and the eigenvalues of A are i + . (1.52.1) Property 6: For a symmetric positive definite matrix A, the equation 1 T  x Ax (1.52.2) defines an ellipse in n dimensions whose axes are in the directions of the eigenvectors vj of A with the half-length of these axes equal to 1 j 
  • 53. ELEN 4304/5346 Digital Signal Processing Fall 2008 53 Concepts of signals and systems Signals play an important role in our daily life. Examples of signals are speech, music, pictures, video… a signal is a function of independent variables such as time, distance, temperature, etc. For instance, a speech signal represents air pressure (or a voltage output from a microphone) as a function of time; a black and white picture is a representation of light intensity as a function of two spatial coordinates; Video is a function of two spatial coordinates and time.
  • 54. ELEN 4304/5346 Digital Signal Processing Fall 2008 54 Concepts of signals and systems Most signals are generated naturally; however, a signal can also be generated synthetically by a computer simulation. A signal carries information, and one of the objective of signal processing is to extract useful information from the signal. The method of information extraction depends on the type of signal and the nature of information.
  • 55. ELEN 4304/5346 Digital Signal Processing Fall 2008 55 Concepts of signals and systems The term system usually indicates a physical device used to generate or manipulate signals. Thus, we may consider a system as a mathematical function applied to a signal. Alternatively, a system can be viewed as any process that results in the transformation of signals. Therefore, a system may have an input signal and an output signal that is related to the input through the system transformation. For instance, an audio amplifier takes a recorded music signal, amplifies it and outputs to the speakers usually allowing us to control the amplification (i.e. “loudness”) and tone (amounts of “bass” and “treble”).
  • 56. ELEN 4304/5346 Digital Signal Processing Fall 2008 56 Why Digital?? Music recording and reproduction: some history Past…
  • 57. ELEN 4304/5346 Digital Signal Processing Fall 2008 57 Music recording and reproduction Still past… And (almost) present
  • 58. ELEN 4304/5346 Digital Signal Processing Fall 2008 58 Music recording and reproduction: some physics behind  Mechanical wave (sound) generates electrical signal in a microphone.  Signal is amplified  And recorded (stored), which usually involves some conversion… 1. Recording Music recording techniques can be divided into analog and digital according to the signal’s representation at the storage stage. 2. Reproduction  A recorded signal is converted back to electrical current.  Amplified  A mechanical wave (sound) is generated by a speaker (electrical oscillation is converted into mechanical one).
  • 59. ELEN 4304/5346 Digital Signal Processing Fall 2008 59 Music recording and reproduction: The media Magnetic tape – Analog recording: Magnetization of the media changes according to an analog electrical signal CD/DVD – digital recording: Optical properties are modified to encode a digital signal
  • 60. ELEN 4304/5346 Digital Signal Processing Fall 2008 60 So, why DSP??? Most of the portable (and not only portable!) electronic items we are dealing with in our everyday life are digital… Digitally recorded data needs to be manipulated…
  • 61. ELEN 4304/5346 Digital Signal Processing Fall 2008 61 Sampling Let us consider a sinusoid x(t) = A cos(t + ), t is a continuous time variable 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Volts Time, sec 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Volts Time, sec 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Volts Time, sec 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Volts Time, sec By sampling, we can reduce storage requirements considerably! Ts
  • 62. ELEN 4304/5346 Digital Signal Processing Fall 2008 62 Sampling: Ideal C/D converter Ideal C/D converter x(t) Ts xn Therefore, a sampled signal: ( ) n s x x nT  s t nT  (1.62.1) for a sinusoid: ( ) cos( ) cos( ) n s s x x nT A nT A n          1 s s f T  The sampling frequency: (1.62.2) (1.62.3) Normalized radial frequency: Fractional frequency: s s T f     n s f f f  (1.62.4) (1.62.5)
  • 63. ELEN 4304/5346 Digital Signal Processing Fall 2008 63 Aliasing Let us consider two discrete-time sinusoids: 1, cos(0.4 ) n x n   2, cos(2.4 ) n x n   2, 1, cos(2.4 ) cos(2 0.4 ) cos(0.4 ) n n x n n n n x          They are obviously at two different frequencies BUT trigonometry shows: Result: we may reconstruct more than one sinusoid from samples! Aliasing (more than one signal represented by the same frequency samples) is due to the 2n periodicity of sin/cos… 0 100 200 300 400 500 600 700 800 900 1000 -1 -0.5 0 0.5 1 Amplitude x1 (t) x2 (t) x1n
  • 64. ELEN 4304/5346 Digital Signal Processing Fall 2008 64 Aliasing Intuitively, we would lower the storage requirements if the sampling frequency can be reduced… Then we would collect less samples… How would we mitigate aliasing? Restrict ourselves to the signals at frequencies [- ]… …which leads us to an appropriate selection of sampling rate (sampling frequency)!
  • 65. ELEN 4304/5346 Digital Signal Processing Fall 2008 65 How many samples do we need to reconstruct the initial sinusoid? Let us consider two periods of a sinusoid and a uniform sampling… As many as: 4 uniform samples/ period Can be reconstructed! Can fit >1 sin? 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts
  • 66. ELEN 4304/5346 Digital Signal Processing Fall 2008 66 How many samples do we need to reconstruct the initial sinusoid? 66 How many signal’s samples do we need to reconstruct the initial sinusoid? Let us consider two periods of a sinusoid and uniform sampling… As many as: 2 uniform samples/ period. Still can be reconstructed! Can fit >1 sin? 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts
  • 67. ELEN 4304/5346 Digital Signal Processing Fall 2008 67 Let us consider two periods of a sinusoid and a uniform sampling… As many as: 1 sample/ period. Can draw MORE than one sinusoid! Initial signal is lost. Can fit >1 sin? 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 -1 -0.8 -0.6 -0.4 -0.2 0 0.2 0.4 0.6 0.8 1 Time, sec Volts How many samples do we need to reconstruct the initial sinusoid?
  • 68. ELEN 4304/5346 Digital Signal Processing Fall 2008 68 The Sampling Theorem We can conclude that at least two uniform signal samples per period are necessary to recover the initial sinusoidal signal. Harry Nyquist Claude Shannon Kotelnikov Nyquist-Shannon Theorem: a sinusoidal signal of frequency f0 can be perfectly reconstructed from it’s uniformly sampled version if samples were taken at the frequency at least 2 f0 (twice the signal’s frequency).
  • 69. ELEN 4304/5346 Digital Signal Processing Fall 2008 69 The Sampling Theorem More accurately: A band-limited signal can be perfectly reconstructed from its uniformly sampled version iff samples were taken at a frequency at least twice higher than the highest frequency in the signal’s spectrum. One half of the sampling frequency – the maximum frequency component that can be represented – is called the Nyquist frequency. What’s about systems? Do they become discrete too?
  • 70. ELEN 4304/5346 Digital Signal Processing Fall 2008 70 Classification of sequences 1 2 1 2 ; N n N N N        A discrete-time signal can be classified into several types based on its specific characteristics… 1. Duration: a discrete-time signal may be a finite-length or an infinite- length sequence. A finite-length (finite-duration; finite-extend) sequence is defined for a finite time interval n where Therefore, the length (duration) N of the above finite-length digital sequence may be computed as 2 1 1 N N N    A length-N discrete-time sequence consists of N samples. (1.70.1) (1.70.2)
  • 71. ELEN 4304/5346 Digital Signal Processing Fall 2008 71 Classification of sequences 1 0 n x for n N     There are three types of infinite-length sequences: A right-sided sequence xn has zero-valued samples for n < N1: where N1 is a finite integer that can be positive or negative. If N1 is positive, a right-sided sequence is usually called a causal sequence. A left-sided sequence xn has zero-valued samples for n > N2: 2 0 n x for n N     where N2 is a finite integer that can be positive or negative. If N2 is negative, a left-sided sequence is usually called an anticausal sequence. A general two-sided sequence xn is defined for both positive and negative values of n. (1.71.1) (1.71.2)
  • 72. ELEN 4304/5346 Digital Signal Processing Fall 2008 72 Classification of sequences * n n x x   2. Symmetry with respect to the time-index n = 0. A sequence xn is called a conjugate-symmetric sequence if A real conjugate-symmetric sequence is called an even sequence. A sequence xn is called a conjugate-antisymmetric sequence if * n n x x  A real conjugate-antisymmetric sequence is called an odd sequence. For a conjugate-antisymmetric sequence xn, the sample value at n = 0 must be purely imaginary. For an odd sequence x0 = 0. (1.72.1) (1.72.2)
  • 73. ELEN 4304/5346 Digital Signal Processing Fall 2008 73 Classification of sequences cs ca n n n x x x   Any complex sequence xn can be expressed as a sum of its conjugate- symmetric part xcs n and its conjugate-antisymmetric part xca n: where     * * 1 2 1 2 cs n n n ca n n n x x x x x x       Therefore, the computation of conjugate-symmetric and conjugate- antisymmetric parts of a sequence involves conjugation, time-reversal, addition, and multiplication operations. (1.73.1) (1.73.2) (1.73.3)
  • 74. ELEN 4304/5346 Digital Signal Processing Fall 2008 74 Classification of sequences Similarly, any real sequence xn can be expressed as a sum of its even part xev n and its odd part xod n: ev od n n n x x x   where     1 2 1 2 ev n n n od n n n x x x x x x       The symmetry properties of sequences often simplify their respective frequency-domain representation. (1.74.1) (1.74.2) (1.74.3)
  • 75. ELEN 4304/5346 Digital Signal Processing Fall 2008 75 Classification of sequences 3. Periodicity. A sequence xn satisfying n n kN x x n    (1.75.1) is called a periodic sequence with a period N, where N is a positive integer and k is any integer. Otherwise, a sequence is called an aperiodic sequence. The fundamental period Nf of a periodic signal is the smallest value of N for which (1.75.1) holds. Sum or product of two or more periodic sequences is also a periodic sequence. For instance, a sum of two periodic sequences xa n and xb n with fundamental periods Na and Nb is a periodic sequence with a fundamental period N   , a b a b N N N GCD N N  (1.75.2) The greatest common divisor
  • 76. ELEN 4304/5346 Digital Signal Processing Fall 2008 76 Classification of sequences 2 x n n E x     4. Energy and Power signals. The total energy of a sequence xn is defined as An infinite-length sequence with finite sample values may or may not have finite energy. The average power of an aperiodic sequence xn is defined as 2 1 lim 2 1 K x n K n K P x K      (1.76.1) (1.76.2)
  • 77. ELEN 4304/5346 Digital Signal Processing Fall 2008 77 Classification of sequences 2 , K x K n n K E x    , 1 lim 2 1 x x K K P E K    The average power of a sequence can be related to its energy by defining its energy over a finite interval -K  n  K as Then The average power of a periodic sequence xn with a period N is 1 2 0 1 N x n n P x N     The average power of an infinite-length sequence may be finite or infinite. (1.77.1) (1.77.2) (1.77.3)
  • 78. ELEN 4304/5346 Digital Signal Processing Fall 2008 78 Classification of sequences An infinite energy signal with finite average power is called a power signal. A finite energy signal with zero average power is called an energy signal. An example of a power signal is a periodic sequence that has a finite average power but infinite energy. An example of an energy signal is a finite-length sequence which has finite energy but zero average power.
  • 79. ELEN 4304/5346 Digital Signal Processing Fall 2008 79 Classification of sequences n x x B    n n x      5. Other classifications. 1) A sequence xn is called bounded if each of its samples is of finite magnitude: 2) A sequence xn is called absolutely summable if 3) A sequence xn is called square-summable if 2 n n x      (1.79.1) (1.79.2) (1.79.3)
  • 80. ELEN 4304/5346 Digital Signal Processing Fall 2008 80 Classification of sequences sin , a c n n x n n         Therefore, a square-summable sequence has finite energy and is an energy signal if it also has zero power. An example of a sequence that is square-summable but not absolutely summable is Examples of sequences that are neither absolutely summable nor square-summable are sin , , b n c c n x n n x K n            where K is a constant. (1.80.1) (1.80.2) (1.80.3)
  • 81. ELEN 4304/5346 Digital Signal Processing Fall 2008 81 Important quantities in discrete time Kronecker delta (unit sample, unit impulse) function: 1, 0 0, 0 n n n          (1.81.1) Shifted by k samples unit sample function: 1, 0, n k n k n k           (1.81.2) k = 2
  • 82. ELEN 4304/5346 Digital Signal Processing Fall 2008 82 Important quantities in discrete time The unit step function: 1, 0 0, 0 n n n          (1.82.1) Shifted by k samples unit step function: 1, 0, n n k n k          (1.82.2) k = -2
  • 83. ELEN 4304/5346 Digital Signal Processing Fall 2008 83 Important quantities in discrete time 0 1 n n n m k m k n n n                  The unit sample and unit step sequences are related as follows: (1.83.1) (1.83.2) The real sinusoidal sequence with constant amplitude:   0 cos , n x A n n         where A, 0,  are real numbers: the amplitude, the angular frequency, and the phase of the sinusoidal sequence xn. (1.83.3)
  • 84. ELEN 4304/5346 Digital Signal Processing Fall 2008 84 Important quantities in discrete time i q n n n x x x   The real sinusoidal sequence can also be written as where xi n and xq n are the in-phase and quadrature of xn that are given by     0 0 cos cos ; sin sin i q n n x A n x A n         (1.84.1) (1.84.2)
  • 85. ELEN 4304/5346 Digital Signal Processing Fall 2008 85 Important quantities in discrete time , n n x A n          0 0 , j j e A A e                 0 0 0 0 0 0 0 0 cos sin j n j n n n n n x Ae A e e A e n j A e n                    The exponential sequence is where A and  are real or complex numbers computed as Therefore: If re im n n n x x x   then     0 0 0 0 cos ; sin n n re im n n x A e n x A e n            (1.85.1) (1.85.2) (1.85.3) (1.85.4) (1.85.5)
  • 86. ELEN 4304/5346 Digital Signal Processing Fall 2008 86 Important quantities in discrete time With both A and  real, (1.85.1) reduces to a real exponential sequence. For n  0, such a sequence with | | < 1 decays exponentially as n increases and with | | > 1 grows exponentially as n increases.
  • 87. ELEN 4304/5346 Digital Signal Processing Fall 2008 87 Important quantities in discrete time System’s impulse response: n k n k k h b     Discrete convolution: n n n n n l n l l y x h h x x h          All LTI systems satisfy the convolution equation where: xn is an input to the system, yn is its output, and hn is the system’s impulse response. (1.87.1) (1.87.2) Convolution with an impulse: 0 0 n n n n n x x      (1.87.3)
  • 88. ELEN 4304/5346 Digital Signal Processing Fall 2008 88 Question time! Remark: strictly speaking, to make a signal digital, in addition to discretization in time (sampling), we need to quantize the samples (make them discrete in amplitude), which will be discussed later.
  • 89. ELEN 4304/5346 Digital Signal Processing Fall 2008 89 Introduction to Matlab Matlab is an interactive, matrix-based software complex for scientific and engineering computations. Interface: the main window
  • 90. ELEN 4304/5346 Digital Signal Processing Fall 2008 90 Introduction to Matlab Interface: the editor window
  • 91. ELEN 4304/5346 Digital Signal Processing Fall 2008 91 Introduction to Matlab Interface: figure windows Whenever you plot results, they will be plotted in one of the figure windows.
  • 92. ELEN 4304/5346 Digital Signal Processing Fall 2008 92 Introduction to Matlab We may say that there are two ways to use Matlab: • We can enter the data (manually or load from files or external sources), manipulate the data (filter in some manner) and plot (or save) the results through the main window. • Or we can write a code (actually, the same sequence of commands we would enter one by one if we used the main window) and save it as an *.m file to be able to come back to it later. This is what the editor window is used for.
  • 93. ELEN 4304/5346 Digital Signal Processing Fall 2008 93 Introduction to Matlab We will concentrate on the “command (main) window (line)” approach. For help in Matlab: 1. Type help commandname where “commandname” stands for a name of a command. Ex: help plot You will get all necessary information about the command: its syntactic, arguments, etc. Pay attention to similar (or related) commands listed at the end. 2. If you don’t really know the name of a command you need, type lookfor keyword where “keyword” is a word corresponding to what you are looking for. Ex: lookfor matrix You will get a list of names and brief descriptions of commands containing the “keyword”.
  • 94. ELEN 4304/5346 Digital Signal Processing Fall 2008 94 Introduction to Matlab • There is no need to describe (pre-allocate) any variables, constants etc. before you use them. • Matlab normally treats all the variables as matrices. • For our purposes, we will usually work with 1D matrices – vectors. • Matlab is case sensitive! A and a are two different variables. • Matlab remembers your entries: use the up-arrow to call previous commands. • Matlab is an expression language: variable = expression. If variable and = are omitted, a variable ans is automatically created, to which the result is assigned.
  • 95. ELEN 4304/5346 Digital Signal Processing Fall 2008 95 Introduction to Matlab To manually enter a matrix from the keyboard, type A = [1,2,3;4,5,6;7,8,9]; or A = [1 2 3;4 5 6;7 8 9]; Commas (or spaces) divide entries within the same row; semicolons divide rows. All rows MUST have the same number of elements! We can call (and modify if needed) matrix elements by their indexes: A(2,3) would bring 6 on the screen; A(2,3) = 21 will replace an entry 6 by 21. The semicolon “;” at the end of the expression instructs not to show the result on the screen. So, if you need to check what A equals to, just type A and press “Enter”! 1 2 3 4 5 6 7 8 9 A           
  • 96. ELEN 4304/5346 Digital Signal Processing Fall 2008 96 Introduction to Matlab You can merge together two or more matrices Ex: A = [1 2 3]; B = [4 5 6 7 8]; C = [A B A]; Will create a vector C = [1 2 3 4 5 6 7 8 1 2 3] Ex: A = [1 2 3]; A = [A;A.^2]; Will modify a vector A as follows: 1 2 3 1 4 9 A       Btw, we can call particular rows or columns of a matrix (a vector) or their combinations: A(2,:) will return [1 4 9] – all entries of the second row A(:,2) will return - all entries of the second column 2 4       C = A(1:end,2:end) is 2 3 4 9 C      
  • 97. ELEN 4304/5346 Digital Signal Processing Fall 2008 97 Introduction to Matlab There are numerous functions that generate some common matrices: zeros(n,m) – n by m array of zeros ones(n,m) – n by m array of ones eye(n) – n by n identity matrix rand(n,m) – n by m array of UNIFORMLY distributed pseudo-random numbers randn(n,m) – n by m array of NORMALLY distributed pseudo-random numbers Trick: If you need to create a vector A of linearly increasing (decreasing) numbers, Type something like: A = first:step:end; where “first” is a value of the first element, “step” is the increment (decrement), “end” is the value of the last element. Ex: n = 1:100; Ex: a = 21:0.14:531.2;
  • 98. ELEN 4304/5346 Digital Signal Processing Fall 2008 98 Introduction to Matlab Matrix operations symbol description + Addition - Subtraction ‘ Transpose ^ Power * Multiplication / Right division Left division symbol description .^ Power .* Multiplication ./ Right division . Left division Array operations (entry by entry) Ex: 1 2 5 6 19 22 5 12 ; ; .* 3 4 7 8 43 50 21 32 A B A B A B                                 Note: “*” denotes multiplication here only! In this class, “*” implies convolution!
  • 99. ELEN 4304/5346 Digital Signal Processing Fall 2008 99 Introduction to Matlab All data you enter during the current session is stored in the memory usually referred to as a workspace. You may save your workspace by a command save. You may erase (clear) any variable from the workspace by a command clear variablename, where “variablename” stands for a name of the variable you wish to erase. Command clear all erases all nonpermanent variables! To see what is in the workspace, use the command whos.
  • 100. ELEN 4304/5346 Digital Signal Processing Fall 2008 100 Introduction to Matlab FOR, WHILE, IF FOR variable = expression, statement, ..., statement END 1. FOR – repeat the statement(s) a number of times Ex: A = []; b = 4.35; for ind = 1:5 A = [A ind^3]; B = b*A; end A = []; b = 4.35; for ind = 1:5 A = [A ind^3]; end B = b*A; Better style: A = []; b = 4.35; for ind = 1:5, A = [A ind^3] end; B = b*A; Equivalent:
  • 101. ELEN 4304/5346 Digital Signal Processing Fall 2008 101 Introduction to Matlab 2. WHILE – repeat the statement(s) while the expression is true WHILE expression, statement, ..., statement END Ex: A = []; b = 4.35; ind = 1; while ind <= 5 A = [A ind^3]; ind = ind + 1; end B = b*A;
  • 102. ELEN 4304/5346 Digital Signal Processing Fall 2008 102 Introduction to Matlab 3. IF – execute the statement(s) if the expression is true IF expression, statement, ..., statement END Ex: A = randn(1); B = 0.5; if A < B A = A+B; end
  • 103. ELEN 4304/5346 Digital Signal Processing Fall 2008 103 Introduction to Matlab Relational operators Operator Description < Less than > Greater than <= Less or equal >= Greater or equal == Equal to ~= Non equal to Operator Description & And | Or ~ Not Logical operators We may compare entire matrices (vectors).
  • 104. ELEN 4304/5346 Digital Signal Processing Fall 2008 104 Introduction to Matlab Example: generate 100 samples of a sinusoid at the frequency 0.04 1. “Traditional approach”: for n = 1:100 x(n) = sin(0.04*pi*n); end 2. “Matlab approach”: x = sin(0.04*pi*[1:100]); Much faster! Whenever data (or operations) can be vectorized, it speeds up your code.
  • 105. ELEN 4304/5346 Digital Signal Processing Fall 2008 105 Introduction to Matlab Some build in Matlab functions… sin(x) – “x” must be in radians cos(x) tan(x) asin(x) acos(x) atan(x) exp(x) log(x) – natural log rem(x) – remainder abs(x) – absolute value sqrt(x) – square root sign(x) – sign of x round(x) – rounds towards nearest integer floor(x) – rounds towards minus infinity (down) ceil(x) – rounds towards plus infinity (up) abs(x) – where “x” is complex - modulus angle(x) – phase angle in radians real(x) – real part of complex “x” imag(x) – imaginary part of “x”
  • 106. ELEN 4304/5346 Digital Signal Processing Fall 2008 106 Introduction to Matlab Some build in Matlab vector functions… max min sort sum prod median mean std var any all And some build in constants pi eps – machine precision j, i size(x) shows the size of “x” (number of rows and columns)
  • 107. ELEN 4304/5346 Digital Signal Processing Fall 2008 107 Introduction to Matlab Figures and plotting stuff figure – creates new figure plot(x) – a planar plot of vector x on the current axes polar(x) – a polar plot of vector x on the current axes hold on; - tells Matlab to keep (hold) the existing plot such that the new plot will be added hold off; - “unhold” the existing plot will be replaced by the new plot xlabel(string) – puts the “string” as a label on x-axis ylabel(string) – puts the “string” as a label on y-axis title(string) – puts the string as a figure title legend(string1,string2,…) – ads a legend to the current axes grid – manipulates gridlines subplot – allows placing multiple axes on a single figure xlim(v) – sets the limits (given in the vector v) for the x-axis ylim(v) – sets the limits (given in the vector v) for the y-axis
  • 108. ELEN 4304/5346 Digital Signal Processing Fall 2008 108 Introduction to Matlab x = sin(0.04*pi*[1:100]); plot(x,’-’,’linewigth’,2) grid; ylim([-1.1,1.1]) xlabel(‘Time, sample’) ylabel(‘Amplitude’) Example: the following code generates this figure: To copy your figure to another application (such as MS Word), go to the Edit menu in the Figure window and select “Copy Figure”. Now, your figure is in the computer memory and can be pasted into another application.
  • 109. ELEN 4304/5346 Digital Signal Processing Fall 2008 109 Matlab summary Remember: 1. Use help! No point to memorize everything. 2. Think in “matrix/vector” terms. 3. If Matlab stops responding and says it’s Busy, “Ctrl”+”c” breaks the operation 4. If “Ctrl”+”c” did not help, “Ctrl”+”q” quits Matlab.
  • 110. ELEN 4304/5346 Digital Signal Processing Fall 2008 110 Considerations and Definitions We need to make distinctions between a software model (or our paper/pencil work) and its hardware implementation. System: Filter = System Continuous time Discrete time We may use: time-, frequency-, and z-domain descriptions of a system: hn - impulse response; H() - frequency response (BIBO!); H(z) – system function. These descriptions (if they exist) are equivalent. Additionally may be used: (xn, yn) - Input/output pairs; {a, b, c,…} - state matrices; difference equations…
  • 111. ELEN 4304/5346 Digital Signal Processing Fall 2008 111 Continuous vs. discrete time: sampling from Mitra’s book: Sampling frequency: 1 s s f T  In general, sampling may lead to information been lost… (1.111.1)
  • 112. ELEN 4304/5346 Digital Signal Processing Fall 2008 112 System’s characteristics 0 0 0 n n n n n n n x y x y x n        ( k n) - no output before input n n n k x y y fct x          1. Linearity: 2. Time-invariance: 3. Causality: 4. Stability (BIBO): 1 1 2 2 1 2 1 2 1 2 , , , n n n n n n n n n n x y and x y ax bx ay by x x a b             for every bounded input, the output must be bounded n x n y x B y B                Important: use random input signals to test your system! Important: we don’t really know whether the system is stable: it is stable only for the particular (bounded) input! (1.112) Important: these properties are specified for relaxed systems only!
  • 113. ELEN 4304/5346 Digital Signal Processing Fall 2008 113 Description of systems… { } n k n k n m m k n k n n k m k y x h x h h x h m n k linear convolutio x n                  ' : Kroneker delta function n k n k n k Let the system s input x x where is               If the system is linear: ' : ( ) { } n k n k k k k n k k the system s output y x h and I x T             since , ; ( ). : n n n k n k n k n k h h in general For TI h                Therefore: hn is a complete I/O (input/output) description of an LTI system n 0 n-k n = k 1 (1.113.1) (1.113.2)
  • 114. ELEN 4304/5346 Digital Signal Processing Fall 2008 114 Notes on stability (BIBO) of LTI systems { : } n k n k k n k n k x x k k k k Let y h x h x bounded input x B B h               for BIBO it is sufficient that: k k h absolute summability     0 0 0 Maximum ( ) ( ) ( ) ( out ) put: n x n k n k n k x k k k k k x k x k k k Let x B and y h x max y h B si h n gn h h sign h B sign h B is als ecessary o                       ( 0 , , 0 ) k h k n n n n LTI BIBO LTI Cau h B h h u s l h n a                  (1.114.1) (1.114.2) (1.114.3) (1.114.4) (1.114.5)
  • 115. ELEN 4304/5346 Digital Signal Processing Fall 2008 115 Causality test (for LTI) 0 0 0 0 0 0 1, 1, 1, 2, 2, 2, n k n k k n k k n k k k n n k n n n k n k k n k k n n k n n n k n k k n k k n n k n n y h x h x h x n y h x h x y h x h x                                        1, 2, 0 0 n n Since x x n n      0 1, 2, 1, 2, 1, 2, 0 0 0 0 ( ) {( ) 0} 0 0 0 n n k n k n k n k n k k n n k y y h x x x x n n h k n n and n n k                            , 0 0 n LTI causal h n      (1.115.1) (1.115.2)