%Bc. Roman Slabý
%%%sestavení funkce pro vykreslení

function [t1a,w1a,t1b,w1b,t1c,w1c,t1d,w1d,tp1,wp1,tp2,wp2,tp3,wp3,m_t,t] = fce_vykresleni(Dec1,Dec2,Dec3,Dec4,maxlimit,minlimit,f_m,deltat);


%%%%%%%Sestavení signalu%%%%%%%%%
t1a=(0:deltat:1/f_m);     
w1a(1:length(t1a))=Dec1;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t1ba=1/f_m;     
w1ba(1:length(t1ba))=Dec1;

t1bb=1/f_m+deltat;
w1bb(1:length(t1bb))=Dec2;

t1bc=1/f_m:deltat:2*(1/f_m);
w1bc(1:length(t1bc))=Dec2;

t1b=[t1ba t1bb t1bc];
w1b=[w1ba w1bb w1bc];


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

t1ca=2*(1/f_m);     
w1ca(1:length(t1ca))=Dec2;

t1cb=2*(1/f_m)+deltat;
w1cb(1:length(t1cb))=Dec3;

t1cc=2*(1/f_m):deltat:3*(1/f_m);
w1cc(1:length(t1cc))=Dec3;

t1c=[t1ca t1cb t1cc];
w1c=[w1ca w1cb w1cc];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
t1da=3*(1/f_m);     
w1da(1:length(t1da))=Dec3;

t1db=3*(1/f_m)+deltat;
w1db(1:length(t1db))=Dec4;

t1dc=3*(1/f_m):deltat:4*(1/f_m);
w1dc(1:length(t1dc))=Dec4;

t1d=[t1da t1db t1dc];
w1d=[w1da w1db w1dc];

m_t=[w1a,w1b,w1c,w1d];
t=[t1a,t1b,t1c,t1d];


%%%%%primky na odděleni signalu%%%%%%

tp1a=1/f_m;     
wp1a(1:length(tp1a))=-1;

tp1b=1/f_m+deltat;
wp1b(1:length(tp1b))=maxlimit+1;

tp1=[tp1a tp1b];
wp1=[wp1a wp1b];

tp2a=2*(1/f_m);     
wp2a(1:length(tp2a))=-1;

tp2b=2*(1/f_m)+deltat;
wp2b(1:length(tp2b))=maxlimit+1;

tp2=[tp2a tp2b];
wp2=[wp2a wp2b];

tp3a=3*(1/f_m);     
wp3a(1:length(tp3a))=-1;

tp3b=3*(1/f_m)+deltat;
wp3b(1:length(tp3b))=maxlimit+1;

tp3=[tp3a tp3b];
wp3=[wp3a wp3b];

end