0% found this document useful (0 votes)
22 views8 pages

Digital Signal Processing Lab Report

The document discusses exercises on discrete-time signals and systems using Scilab. It includes definitions of basic signals and operations, as well as examples demonstrating how to represent and manipulate signals in Scilab including unit impulse, unit step, unit ramp, delay, scaling and more.

Uploaded by

phong0399266923
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views8 pages

Digital Signal Processing Lab Report

The document discusses exercises on discrete-time signals and systems using Scilab. It includes definitions of basic signals and operations, as well as examples demonstrating how to represent and manipulate signals in Scilab including unit impulse, unit step, unit ramp, delay, scaling and more.

Uploaded by

phong0399266923
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Digital Signal Processing HK232 anhpham@[Link].

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

1.1. Elementary Signals

▪ Unit sample sequence (impulse)

δ ( n )={1, n=00 , n ≠0

▪ Unit step signal

u ( n ) ={1 , n≥ 00 , n< 0

▪ Unit ramp signal

ur ( n )={n ,n ≥ 00 , n<0

1.2. Signal Properties

▪ 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 anhpham@[Link]

▪ Signal‘s average power


N
1

2
P x= |x ( n )|
2 N +1 n=−N
▪ Signal Symmetry

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


▪ Advance

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 anhpham@[Link]

PART 2. EXAMPLES & EXERCISES

Exercise 1.

Functions Description (will be filled by students)

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ó

bool2s(…) Chuyển đổi ma trận boolean sang ma trận 0 1. Nếu x là


ma trận “chuẩn”, bool2s(x) trả về giá trị khác 0 thay thế
cho 1.

deff(…) Được dùng để định danh một hàm

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 anhpham@[Link]

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)

Exercise 5. Given a discrete-time signal x(n)={1, 3↑, -2}.


Use Scilab to draw the signal x(n), the odd signal component x o(n), and the even signal
component xe(n). Each signal will be drawed by a single plot but they are displayed in a
single window. Please use title(), xlabel() and ylabel() to represent the name of each plot.
Trả lời:
Signal x(n):

4
Digital Signal Processing HK232 anhpham@[Link]

Odd signal component xo(n):

Even signal component xe(n):

5
Digital Signal Processing HK232 anhpham@[Link]

Exercise 6. Given two discrete-time signals


x1(n)={0↑, 1, 3, -2} and x2(n)={0, 1↑, 2, 3}.
Determine y(n) = x1(n) + x2(n). Then use Scilab to draw x1(n), x2(n) and y(n). Each signal
will be drawed by a single plot but they are displayed in a single window. Please use title(),
xlabel() and ylabel() to represent the name of each plot.
Trả lời:
x1(n) signal:

x(2)n signal:

6
Digital Signal Processing HK232 anhpham@[Link]

y(n) signal:

Exercise 7. Given two discrete-time signals


x1(n)={0↑, 1, 3, -2} and x2(n)={0, 1↑, 2, 3}.
Determine y(n) = x1(n).x2(n). Then use Scilab to draw x1(n), x2(n) and y(n). Each signal
will be drawed by a single plot but they are displayed in a single window. Please use title(),
xlabel() and ylabel() to represent the name of each plot.
x1(n), x2(n) như bài 6:
y(n) signal:

7
Digital Signal Processing HK232 anhpham@[Link]

Exercise 8. Given a discrete-time signal x(n)={1, -2, 3↑, 6}.


Determine the following signal and then use Scilab to draw the original signal x(n) and the
manipulated signal yi(n). Each pair of plots will be display in a single window. Please use
title(), xlabel() and ylabel() to represent the name of each plot.
a. y 1 ( n )=x (−n )
b. y 2 ( n )=x ( n+3 )
c. y 3 ( n )=2 x (−n−2 )
Trả lời:
a.

b.

Common questions

Powered by AI

To visualize the combination of two discrete signals in Scilab, you would plot each signal individually using plot functions and then display them in a single window while adding the plots together mathematically to create a third plot y(n) = x1(n) + x2(n). The Scilab functions title(), xlabel(), and ylabel() would be used to label this visualization .

To manipulate a discrete signal with a delay, you use the expression y(n) = x(n - k), where k > 0 indicates the delay in samples .

To generate and plot a unit ramp signal in Scilab ranging from indices -5 to 5, initialize n with n = -5:5, construct msignal using msignal = n.*bool2s(n >= 0), and then use plot2d3 to graph the indices versus msignal. These steps create a linear ramp for positive indices and zero elsewhere .

The energy of a discrete-time signal x(n) is calculated as Ex = Σ from n = -∞ to ∞ |x(n)|² .

The unit sample sequence, also known as an impulse, is defined as δ(n) = 1 for n = 0 and δ(n) = 0 for n ≠ 0 .

The bool2s function in Scilab converts a boolean matrix into a 0-1 matrix. If x is a standard matrix, bool2s(x) returns a non-zero value substituted for 1. This function is used to plot or display logical conditions like converting non-negative indices to 1s and showing them on a graph .

Simple manipulations of discrete signals include delay, advance, folding, addition, multiplication, and amplitude scaling. These are mathematically expressed as: delay y(n) = x(n-k), advance y(n) = x(n+k), folding y(n) = x(-n), addition y(n) = x1(n) + x2(n), multiplication y(n) = x1(n) * x2(n), and amplitude scaling y(n) = ax(n).

A discrete-time signal x(n) can be decomposed into even and odd components using the expressions: xe(n) = 1/2 [x(n) + x(-n)] for the even component and xo(n) = 1/2 [x(n) - x(-n)] for the odd component .

Resizing image files is important to reduce the overall size of the report file to ensure it can be submitted through the BKeL system, meeting submission constraints and requirements .

A discrete-time signal x(n) is periodic with a period N if and only if x(n + N) = x(n) for all n, where N is a positive integer .

You might also like