Professional Documents
Culture Documents
CSE - 610
Lecture # 2: Discrete Time Signals and Systems
0 n0
[ n]
1 n0
Unit step sequence
1 n0
u[n]
0 n0
3
Basic Types of Discrete Time Signals
Sinusoidal and exponential sequence
Sinusoidal sequence
x[n] cos(0 n)
Exponential sequence
4
Basic Operations
Ideal delay: A sequence y[n] is said to be a
delayed or shifted version of a sequence x[n] if
y[n] x[n n0 ]
where n0 is an integer
Multiplication
6
x[n] via Impulse Functions
7
x[n] x[k ] [n k ]
k
Unit Step and Impulse Functions
Unit step sequence
u[n] [n] [n 1] [n 2]
[n k ]
k 0
Impulse sequence
8
Combining Basic Sequences
An
n0
x[n]
0 n0
x[n] A u[n]
n
9
Periodic and Aperiodic Discrete Time
Signals
In discrete time, a periodic sequence is a
sequence for which
x[n] x[n N ] for all n
where the period N is necessarily an integer
x3[n] cos(n)
Solution:
There is no integer N such that x3[n+N] = x3[n]
12
Frequency of Discrete Time Signals
Consider the discrete time sinusoid
A cos(0 n )
13
Discrete Time System
Example:
Ideal delay system y[n] x[n n0 ]
M2
1
Moving average system y[n]
M1 M 2 1 k M1
x[n k ]
14
Discrete Time System
Linear system
A system (or process) is linear if it obeys the
principle of superposition
Principle of superposition
If the input of a system contains the sum of
multiple signals then the output of the system is
the sum of the system responses to each
separate signal
T {ax1[n] bx2 [n]} aT {x1[n]} bT {x2 [n]}
ay1[n] by2 [n]
15
Discrete Time System : Example
16
Is accumulator system linear?
n
y1[n] x [k ]
k
1
n
y2 [ n ] x [k ]
k
2
When input is x3[n] ax1[n] bx2 [n], the superposition requires the
output y3[n] ay1[n] by2 [n] for all possible values of a and b.
y3 [n] x [k ] ax [k ] bx [k ]
k
3
k
1 2
a x1[k ] b x2 [k ]
k k
y[n] x [n] 2
( i.e.T {.} (.) )
2
x [n] x2 [n]
1
2 2
18
MATLAB Example: Linearity
19 Linearity
Discrete Time System
20
Discrete Time System: Example
Is accumulator system time-invariant?
n
x[k n ]
k
0
Let k1 k n0
n n0
y1[n] x[k ] y[n n ]
k1
1 0
22
x[k ]h[n k ] x[n] h[n]
k
Convolution sum
Convolution
The sequence h[n] is commonly referred to as
impulse response of the system
h[n] x[n]
23
Properties of Convolution
Associativity x[n] {h1[n] h2 [n]}
{x[n] h1[n]} h2 [n]
24
Convolution: Example
Convolution of two rectangles
25 ConvRects
Convolution: Example
26
Convolution: Example
Convolution of two sequences
x[n] = […, 0, 1, 2, 3, 0, …], h[n] = […, 0, 2, 1, 0.5, 0, …]
27
Convolution: Example
28
Convolution: Example
h[n] u[n] u[n N ]
x[n] a u[n]
n
>> pi
ans =
3.1416
>> sin(ans/4)
ans =
0.7071
33
Built-in Functions
>> log(200)
ans =
5.2983
>> log10(1000)
ans =
10
>> cos(pi/6)
ans =
0.866
34
Lookfor Function
Syntax:
lookfor string
Example:
Results in
36
Matrices and Vectors
37
Matrices and Vectors
For manual entry, the elements in a vector are enclosed in
square brackets.
When creating a row matrix, separate elements by space
>> a = [1 2 4]
a =
1 2 4
39 SumOfSines.m
Signal Representation:
Weighted Sum of Sines
>> figure; plot(x); xlabel('n'); ylabel('Amplitude')
40
Vectorization
41 SumOfSinesV.m
M-File Programming
function x = SOS(N, a, w, phi)
% SOS weighted sum of sines
% Classical implementation of function SOS
% Inputs
% N = Number of samples
% a = weight vector for different sine waves
% w = frequency vector for different sine waves
% phi = phase vector for different sine waves
% Output
% x = weighted sum of sines
x = zeros(1,N);
for n = 0:N-1
for k = 1:3
x(n+1) = x(n+1) + a(k)*sin(w(k)*n + phi(k));
end
end
42
M-File Programming
43
M-File Programming
function x = SOSV(N, a, w, phi)
% SOS weighted sum of sines
% Vector implementation of function SOS
% Inputs
% N = Number of samples
% a = weight vector for different sine waves
% w = frequency vector for different sine waves
% phi = phase vector for different sine waves
% Output
% x = weighted sum of sines
n = 0:N-1;
x = sin(n'*w + phi(ones(1,N),:))*a';
44
Time Comparison
45
References
46