Você está na página 1de 6

. ;',.

:lj::,

i!*r':;
t ir,,

DE LA SALLE UNIVERSITY _ DASMARINAS

Dasmarinas, Cavite
COLLEGE OF ENGINEERING, ARCHITECTURE, AND TECHNQLOGY
ELECTRONICS FNGINEERING

Itlame:

Date Performed:

Course-Year & Section

Rating

Experinrent

i!o

Discrete-Tir*e Si!i na i Operations

OBJECTIVES:
This experintent will enable the studerrls io ieain how to perform discrete-tiile signal
addition multiplicaiion. shifting and foldrng Sanrlrie problems will be solved to iiiust;-a:ie the
process.

II{STRUMENTS AND TUATERIALS NEEDED:


PC WITH I.JIATLAB SOFTWARE INSTALLED

PROCEDURE:

SignalAddition
Write the following Matlab script to create a function to implemept
y(n) =x1(n) +x"1p1

>> function [y,nj = sigadd(x1 ,n1,x2,n2)

>> n = min(min(nl), min(n2)) : max(nrax{n'1), max(n2));


>> y'1 = zeros(1,length(n)); y? = y1'.
>> yl (find((n>=min(n1)) & (n<=max(n1))=='l ))=x1,

15
t
+:i4 r riT

!r r$!

!'1

-j

y2(find((n>=min(n2)) & (n<=max(n2))==1 ))=x2;

y=y1 +!2',

Save the file as sigadd.m

ti

Signal Multiplicatiorr
Create an m-f ile

irr

Mallab to write a functior"r to impienrenl


,'i r) I )i;ill)

x '(it)

>> function iyl ril = sigmult(x1 ,n1.x2.n?^)

))

;i = irrnirliir(lii). nrin(n2)) . ilax(rla>lq,r-,,,,,,.;.,

1;- y'l = reiosr(1 ie'ngth(n)) , y2 =


>>

v 1 (frn;111

,,'1

n:-=ur in(n 1 )) &. (n<=nrax(

ir.'l

)l==

-1

1=x

>> y2(fincj((n>=rlrin(n2)) & (n<=max(n2))== 1 );=v2


\\
"

\/ y -

\,1
Y I

* rt)
yL,

Save the file as sigmult.nr

llt

Signal Shifting
Write the follorving Matlab script to create a function to implement
Y(n)

=x(n-k)

>> functron [y,n] = sigshift(x.m.k)

>>n=m+k:
>>Y=x;
Save the file as sigshift.m

16

tv. Signal Folding


Write the following script to create a function to implement
y(n) = x(-n)

>> function [y,n] = sigfold(x,n)

>> y

>>

= -fliplr-in),

i-)

fliplr(x):

Save the file as sigtold

Example1Letx(n)

.{1?3

t'tt

Determine and plct the sequence


y(n)

=x(3-n) +x(n) .x(n-2)

otution: The first term can be written as x[-(n-3)] and can be obtained'by folding x(n) and then
shifting the result by 3 using sigfold and sigshift functions. x(n) and v{r-'-2) is
multiplied using sigmult function. The previous results can then be added using the
sigadd function to obtain the final output-

>> n = [-2'.10] ;x = 11

t'

.7,6:-1

: 1l

[x1,n1] = sigfold(x,n); [xl,n'1] = sigshift(x1 ,n1,3);

>> lx2,nZl = sigshift(x,n,2) ; lx2,n?l = sigmult(x,n,x2,n2);

tt

[y,n] = sigadd(xl ,nl,x2,n2)',

>> stem(n,y); title('sequence in Example 1')


>> xlabel('n'); yiabel('y(n)');

Tasks.

1.

a.

b
C.

f,;ata

{2,4, -3, 1, -5, 4,7 ) Gerrerate and plot each of the followiii{j
yr(n) =2x(n-3) +3x(n+4) -x(n)

Lel x(n) =

yz(n) = 4x(4 + n) + x(1 - n).[2x(n)]


ys(n) = 2e05nx(n) + cos(O.1nn).x(n +

2),

1,,"j".

-10 < n < iC

Decompose the followrng signals rnio iis even and odd


sigfold functions
a x,(n) = e" "' [i-titt+5) - iriil ll);j
b x:(n) = cos(Q llnn o ni-3) -.1(l': r'20

corrloireris

Llse sicacid aiid

;l*d t{esr,rlts.

Ciranh of ,v'irr) = x(3

n) + y1,',1 - x(n

2)

MATLAB Code and Graph of y1(n) = 2x(r't

3,) +

3x(n + a)- x(n)

1B

MATLAB Code and Graph ot y2fi) = 4x(4 * n) * x(1

MATLAB Cocie anci Graph of yj(n)

n)"[2x(n)]

2oc:': x(n) + cos(O. inn)-x(n + 2)

40
IJ

OBSERVATIONS/RESU LTS

CONCLUSION:

2A

1..
r ;y.';,r1:,qrr::r,::1|.ryffi@i!"er;S.ri.1tffi

l:inf

Você também pode gostar