0% found this document useful (0 votes)
8 views9 pages

NR 34

The document is a coursework assignment from the Polytechnic University of Tirana focusing on digital signal processing. It includes exercises involving signal construction, convolution, system function analysis, and frequency spectrum analysis. Various MATLAB code snippets and graphical outputs are provided to illustrate the results of the exercises.

Uploaded by

mirejmuca05
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)
8 views9 pages

NR 34

The document is a coursework assignment from the Polytechnic University of Tirana focusing on digital signal processing. It includes exercises involving signal construction, convolution, system function analysis, and frequency spectrum analysis. Various MATLAB code snippets and graphical outputs are provided to illustrate the results of the exercises.

Uploaded by

mirejmuca05
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
You are on page 1/ 9

UNIVERSITETI POLITEKNIK I TIRANES

FAKULTETI I TEKNOLOGJISE E INFORMACIONIT


INXHINIERI INFORMATIKE

DETYRE KURSI
NR:34

Lënda: Përpunim numerik i sinjaleve

Grupi: IIA

Punoi :HATIXHE KERCUKU Pranon :Dr.Evjola Spaho


Ushtrimi 1:

n=0:20;

[x1,n1]= stepseq(0,0,20); %ndertimi i u(n)


n2=n;
x2=(0.9).^n2;
x3=sigmult(x1,n1,x2,n2);
x4=0.75 * x3;

n3=n;
x5=(-0.9).^n3;
x6=sigmult(x1,n1,x5,n3);
x7=0.25 * x6;
X=sigdiff(x3,n,x7,n); %X(n)

%ndertimi i h(n)
n10=n;
[x10,n10]= stepseq(21,0,20);
x11=sigdiff(x1,n,x10,n10);
n12=n;
x12=(0.9).^n12;
x13=sigmult(x12,n,x11,n);
h=n.* x13; %h(n)

y=convTfr(X,h)

stem(y)

xlabel('indeksi kohor n');


ylabel('konvolucioni');
title('thurja e sinjalit nepermjet DTFT');

Grafiku:
Ans:
[>> ushtr1
y =Columns 1 through 12
14.5015 13.0641 13.3196 13.3513 14.4992 15.2501 16.7229 17.7212 19.1765
20.1412 21.3886 22.1670
Columns 13 through 24
23.1164 23.6396 24.2649 24.5169 24.8305 25.1409 25.3285 25.3285 25.2272
23.2515 20.3109 18.5457
Column 25
16.0331]
Ushtrimi 2:
a)

y(n)=x(n)-x(n-2)+3.95y(n-2)-3.9025y(n-3)

Y(z)=X(z)-X(z)*z^-2+3.95*Y(z)*z^-2-3.9025*Y(z)*z^-3

H(z)=Y(z)/X(z)

H(z)=(z^3-3.95*z+3.9025)/[z*(z^2-1)]

b)

b = [1,0,3.95,-3,9025]
a = [1,0,-1]
roots(a)
roots(b)
zplane(b,a) % boshti I z
[a,b] = eqtflength(a,b);
[z,p,k] = tf2zp(a,b)
text(real(z)+.1,imag(z),'Zero') % emertimi I zerove ne grafik
text(real(p)+.1,imag(p),'Pole') % emertimi I poleve ne grafik
title('Zero Dhe Pole ') % titulli I grafikut
c) Zek=?
b=0; % variable per piken x te qendres se rrethit
n=0; % variable per piken Y te qendres se rrethit
rr=4; % rrezja e rrethit te madh te mare si shembull
the = 0:pi/50:2*pi; % kendi
Xunit = rr * cos(the) + b;
Yunit = rr * sin(the) + n;
H = plot(Xunit, Yunit); % shfaqja e rrethit
hold on
x=0;
y=0;
r=1; % rrezja e rrethit actual nga qendra der ne polin me te larget
th = 0:pi/50:2*pi;
xunit = r * cos(th) + x;
yunit = r * sin(th) + y;
h = plot(xunit, yunit);
circle(0,0,4,'r') %ngjyrosja e zones se konvergjences
circle(0,0,1,'w')
title('Zona e konvergjences') %titulli I grafikut

Ans:
b = 1.0e+03 *

0.0010 0 0.0040 -0.0030 9.0250

a =1 0 -1

ans =

-1

ans =

-6.8200 + 6.9712i

-6.8200 - 6.9712i

6.8200 + 6.9554i

6.8200 - 6.9554i

z=

-1

p=

-6.8200 + 6.9712i

-6.8200 - 6.9712i

6.8200 + 6.9554i

6.8200 - 6.9554i
k=

Grafiku:

d)
n=[0:20]
x=cos(pi/2).*n.*[heaviside(n)]-cos(pi/2)*n.*[heaviside(n-16)]
yf=fft(x)
subplot(2,2,1); plot(n,abs(yf));title('Spektri i
Amplitudes');xlabel('frenkuenca');ylabel('|yf|')
subplot(2,2,2); plot(n,angle(yf));title('Spektri i
Fazes');xlabel('frenkuenca');ylabel('')
subplot(2,2,3); stem(n,real(yf));title('Pjesa reale');xlabel('k');ylabel('Re')
subplot(2,2,4); stem(n,imag(yf));title('Pjesa
imagjinare');xlabel('k');ylabel('Im')

stem(yf)%Nderton grafikun per sinjalin


Ans:

n =Columns 1 through 20

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Column 21

x=

1.0e-15 *

Columns 1 through 12

0 0.0612 0.1225 0.1837 0.2449 0.3062 0.3674 0.4286 0.4899 0.5511 0.6123 0.6736

Columns 13 through 21

0.7348 0.7960 0.8573 0.9185 0.4899 0 0 0 0

yf =

1.0e-14 *

Columns 1 through 6

0.7838 + 0.0000i -0.3879 + 0.0930i -0.0587 - 0.1544i 0.0892 - 0.0306i 0.0210 + 0.0672i -0.0512 +
0.0224i

Columns 7 through 12

-0.0217 - 0.0341i 0.0214 - 0.0159i 0.0105 + 0.0149i -0.0093 + 0.0082i -0.0052 - 0.0016i -0.0052 +
0.0016i

Columns 13 through 18

-0.0093 - 0.0082i 0.0105 - 0.0149i 0.0214 + 0.0159i -0.0217 + 0.0341i -0.0512 - 0.0224i 0.0210 -
0.0672i

Columns 19 through 21

0.0892 + 0.0306i -0.0587 + 0.1544i -0.3879 - 0.0930i

Grafiku:

You might also like