Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clear all;
- t=0:1/10000:5;
- N = length(t);
- sinus = 3*sin(2*pi*14*t+pi/3);
- prostk = square(5*t);
- narast = 1/2*t+3;
- jednost = rand(1,size(t,2));
- gauss = randn(1,size(t,2));
- [h1,ox1] = hist(sinus,100);
- [h2,ox2] = hist(prostk,100);
- [h3,ox3] = hist(narast,100);
- [h4,ox4] = hist(jednost,100);
- [h5,ox5] = hist(gauss,100);
- g1 = h1/N;
- g2 = h2/N;
- g3 = h3/N;
- g4 = h4/N;
- g5 = h5/N;
- F1 = cumsum(g1);
- F2 = cumsum(g2);
- F3 = cumsum(g3);
- F4 = cumsum(g4);
- F5 = cumsum(g5);
- [kox1,kor1] = xcorr(sinus,'unbiased');
- [kox2,kor2] = xcorr(prostk, 'unbiased');
- [kox3,kor3] = xcorr(narast, 'unbiased');
- [kox4,kor4] = xcorr(jednost, 'unbiased');
- [kox5,kor5] = xcorr(gauss, 'unbiased');
- figure();
- subplot(411);
- plot(t,sinus);
- subplot(412);
- plot(ox1,g1);
- subplot(413);
- plot(ox1,F1);
- subplot(414);
- plot(ox1,kor1);
- figure();
- subplot(411);
- plot(t,prostk);
- subplot(412);
- plot(ox2,g2);
- subplot(413);
- plot(ox2,F2);
- subplot(414);
- plot(ox2,kor2);
- figure();
- subplot(411);
- plot(t,jednost);
- subplot(412);
- plot(ox4,g4);
- subplot(413);
- plot(ox4,F4);
- subplot(414);
- plot(ox4,kor4);
- figure();
- subplot(411);
- plot(t,narast);
- subplot(412);
- plot(ox3,g3);
- subplot(413);
- plot(ox3,F3);
- subplot(414);
- plot(ox3, kor3);
- figure();
- subplot(411);
- plot(t,gauss);
- subplot(412);
- plot(ox5,g5);
- subplot(413);
- plot(ox5,F5);
- subplot(414);
- plot(ox5,kor5);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement