DSP Lab02
DSP Lab02
DSP Lab02
vn
Lab #2
Objectives
- Review lecture notes of discrete-time signal and system
- Do additional exercises on SciLab
Report
1. For each function or group of functions that you did, you have to capture the screen as
evidence that you did by yourself.
2. Then, you add all screen captures in a single word file.
3. Finally, you upload your report to BKeL on time. You should down-size the image file to
reduce the report file in order to be able to submit it in BKeL.
---------------------------------
PART 1. REVIEW OF LECTURE NOTES
δ ( n )={1, n=00 , n ≠0
u ( n ) ={1 , n≥ 00 , n< 0
ur ( n )={n ,n ≥ 00 , n<0
▪ Periodic signal
A signal x(n) is periodic with a period N (N>0) if and only if x(n + N) = x(n), ∀n
▪ Signal’s energy
∞
E x = ∑ |x ( n )|
2
n=−∞
1
Digital Signal Processing HK232 [email protected]
Any arbitrary signal can be expressed by the sum of two signal components
x ( n )=x e ( n )+ x o ( n )
Even signal component
1
x e ( n )=
2
[ x ( n )+ x (−n ) ]
Odd signal component
1
x o ( n )=
2
[ x ( n )−x (−n ) ]
1.3. Simple manipulations
▪ Delay
y ( n )=x ( n+ k ) k >0
▪ Folding
y ( n )=x (−n )
▪ Addition
y ( n )=x 1 ( n ) + x 2 ( n )
▪ Multiplication
y ( n )=x 1 ( n ) . x 2 ( n )
▪ Amplitude scaling
y ( n )=ax ( n )
---------------------------------
2
Digital Signal Processing HK232 [email protected]
Exercise 1.
plot2d3(…)
min(…)
max(…)
subplot(…)
title(…)
xlabel(…) Thiết lập nhãn trục x hoặc/và các thuộc tính của nó
ylabel(…) Thiết lập nhãn trục y hoặc/và các thuộc tính của nó
Exercise 2. Try the following scripts on Scilab and report what your understanding after
observing the output.
scilab:> n = -5:5;
scilab:> msignal = bool2s (n >= 0);
scilab:> plot2d3(n, msignal)
Trả lời: Xuất hiện 1 đồ thị có trục hoành bao gồm các giá trị của n, trục tung gồm các giá trị
của msignal.
Exercise 3. Try the following scripts on Scilab and report what your understanding after
observing the output.
3
Digital Signal Processing HK232 [email protected]
scilab:> n = -5:5;
scilab:> msignal = bool2s (n == 0);
scilab:> plot2d3(n, msignal)
Trả lời: Xuất hiện 1 đồ thị có trục hoành bao gồm các giá trị của n, trục tung gồm các giá trị
của msignal.
Exercise 4. Use Scilab to draw the unit ramp signal ur(n) for n=-5:5
--> n = -5:5
--> msignal = n.*bool2s(n>=0)
--> plot2d3(n,msignal)
4
Digital Signal Processing HK232 [email protected]
5
Digital Signal Processing HK232 [email protected]
x(2)n signal:
6
Digital Signal Processing HK232 [email protected]
y(n) signal:
7
Digital Signal Processing HK232 [email protected]
b.