Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- close all;
- figure;
- %Podpunkt a
- zakres = [-100 : 1 : 100];
- dlugosc = length(zakres);
- y = zeros(1, dlugosc);
- y(floor(dlugosc / 2)) = 1;
- subplot(2, 3, 1);
- stem(zakres, y);
- title('Impuls jedn');
- xlabel('Probki');
- ylabel('Wartosci');
- zakres = [-100 : 1 : 100];
- dlugosc = length(zakres);
- y = zeros(1, dlugosc);
- y(floor(dlugosc / 2)) = 1;
- subplot(2, 3, 2);
- stem(zakres + 40, y);
- axis([-60 140 0 1]);
- title('Impuls przes o 40');
- xlabel('Probki');
- ylabel('Wartosci');
- %B
- %Sine
- x = [0 : pi/20 : 10*pi];
- y = sin(x);
- subplot(2, 3, 3);
- stem(x, y);
- axis([0 35 -1 1]);
- title('Sinus');
- xlabel('Probki');
- ylabel('Wartosci');
- %Sawtooth
- x = [0 : pi/20 : 10*pi];
- y = sawtooth(x);
- subplot(2, 3, 4);
- stem(x, y);
- axis([0 35 -1 1]);
- title('Sawtooth');
- xlabel('Probki');
- ylabel('Wartosci');
- %Square
- x = [0 : pi/20 : 10*pi];
- y = square(x);
- subplot(2, 3, 5);
- stem(x, y);
- axis([0 35 -1 1]);
- title('Square');
- xlabel('Probki');
- ylabel('Wartosci');
- %C
- ilosc_probek = 200;
- przesuniecie = 0;
- sigma = 0.5;
- y = sigma + randn(ilosc_probek, 1) + przesuniecie;
- subplot(2, 3, 6);
- stem(y);
- title('Szum gaussowski');
- xlabel('Probki');
- ylabel('Wartosci');
- grid on;
- axis([0 200 -5 5]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement