Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cyfrowe.m
- Type
- Text
- Size
- 2 KB (1,911 bytes)
- Storage used
- 2 KB (1,911 bytes)
- Location
- 09
- Owner
- me
- Modified
- 11:37 AM by me
- Opened
- 11:37 AM by me
- Created
- 11:37 AM with Google Drive Web
- Add a description
- Viewers can download
- %zadanie 1
- %zadanie 2
- t=-20:20;
- u1=zeros(1,41);
- u1(21:41)=ones(1);
- stem(t,u1);
- axis([-20 20 0 3])
- t=-20:20;
- u1=zeros(1,41);
- u1(21+3:41)=ones(1);
- stem(t,u1);
- axis([-20 20 0 3])
- %zadanie 3
- t=[0,3]
- x = [1,1]
- stem(t,x);
- axis([-2 4 0 2])
- % zadanie 4
- t=-20:20;
- u1=zeros(1,41);
- u1(21:41)=ones(1);
- u2=zeros(1,41);
- u2(26:41)=ones(1);
- u3=u1-u2;
- stem(t,u3);
- axis([-20 20 0 2])
- %zadanie 5
- t1=0:1/10:4;
- t2=0:1/100:4;
- u1 = sin(2*pi*t1);
- u2 = sin(2*pi*t2);
- stem(t1,u1);
- axis([0 4 -2 2])
- stem(t2,u2);
- axis([0 4 -2 2])
- %zadanie 6
- t1=0:1/10:4;
- t2=0:1/100:4;
- u1 = cos(2*pi*t1);
- u2 = cos(2*pi*t2);
- stem(t1,u1);
- axis([0 4 -2 2])
- stem(t2,u2);
- axis([0 4 -2 2])
- %zadanie 7
- t1 = 0:0.1:10;
- u = gaussmf(t,[1 5]);
- u1 = gaussmf(t,[1 5]);
- subplot(2,1,1);
- plot(t,u)
- axis([0 10 0 1])
- subplot(2,1,2);
- stem(t,u);
- axis([0 10 0 1])
- %zadanie 8
- figure
- t = -3:3;
- y1=[1,3,5,6,7,9,2];
- y2=[2,4,7,2,9,5,6];
- y3 = y1 .* y2;
- stem(t,y3);
- axis([-3 3 0 70])
- %zadanie 9
- n = 0:20;
- x=[1,zeros(1,20)];
- a=[1];
- b=[1 -0.5 0.7];
- y=filter(a,b,x);
- stem(n,y)
- %zadanie 10
- n = 128;
- k = 0:n;
- t = k/128;
- A = 1;
- fo = 2;
- p = 0;
- y = A*sin((2*pi*fo*t)+p);
- figure
- plot(k,y)
- axis([0 140 -1 1])
- %zadanie 11
- n = 128;
- k = 0:n;
- t = k/128;
- A = 1;
- fo = 5;
- p = 0;
- y = A*sin((2*pi*fo*t)+p);
- figure
- plot(k,y)
- axis([0 140 -1 1])
- %zadanie 12
- figure
- T = 10*(1/50);
- fs = 100;
- t = 0:1/fs:T-1/fs;
- x = sawtooth(2*pi*50*t);
- plot(t,x)
- %zadnie 13
- figure
- T = 10*(1/50);
- fs = 500;
- t = 0:1/fs:T-1/fs;
- x = square(2*pi*50*t);
- plot(t,x)
- axis([0 0.2 -1.2 1.2])
- %zadanie 14
- fs = 10000;
- t = -1:1/fs:1;
- x1 = tripuls(t,80e-3);
- x2 = rectpuls(t,80e-3);
- subplot(2,1,1)
- plot(t,x1)
- axis([-0.1 0.1 -0.2 1.2])
- title('Triangular Aperiodic Pulse')
- subplot(2,1,2)
- plot(t,x2)
- axis([-0.1 0.1 -0.2 1.2])
- title('Rectangular Aperiodic Pulse')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement