from finding_ensemble_parameters_of_random_signals_in_a_communication_channel by Dimuthu Senanayaka
Find ensemble parameters of random signal in a communication channel.

run.m
t=1:100;

%for function 1        
v1=rp1(4,100);         

y11=v1(1,:);           %Taking the first function of above generated four random functions/y11 bear the values of first random function.
subplot(2,2,1)         %plotting the first random function of first type.
plot(t,y11);
Title('f(1,1)');
xlabel('time');
ylabel('amplitude');



y12=v1(2,:);          %Taking the second function of above generated four random functions/y12 bear the values of first random function.
subplot(2,2,2)
plot(t,y12);
Title('f(1,2)');
xlabel('time');
ylabel('amplitude');


y13=v1(3,:);       %Taking the third function of above generated four random functions/y13 bear the values of first random function.
subplot(2,2,3)
plot(t,y13);
Title('f(1,3)');
xlabel('time');
ylabel('amplitude');


y14=v1(4,:);         %Taking the fourth function of above generated four random functions/y14 bear the values of first random function.
subplot(2,2,4)
plot(t,y14);
Title('f(1,4)');
xlabel('time');
ylabel('amplitude');

 
pause;


%for function 2    %%generating 4 random signlas of second type (rp1 function has been used./v1 bear values of all 4 funcitons) 
v2=rp2(4,100);

y21=v2(1,:);
subplot(2,2,1)
plot(t,y21);
Title('f(2,1)');
xlabel('time');
ylabel('amplitude');


y22=v2(2,:);
subplot(2,2,2)
plot(t,y22);
Title('f(2,2)');
xlabel('time');
ylabel('amplitude');


y23=v2(3,:);
subplot(2,2,3)
plot(t,y23);
Title('f(2,3)');
xlabel('time');
ylabel('amplitude');


y24=v2(4,:);
subplot(2,2,4)
plot(t,y24);
Title('f(2,4)');
xlabel('time');
ylabel('amplitude');

 
pause;



%for futctiot 3
v3=rp3(4,100);    %%generating 4 random signlas of third type (rp1 function has been used./v1 bear values of all 4 funcitons) 

y31=v3(1,:);
subplot(2,2,1)
plot(t,y31);
Title('f(3,1)');
xlabel('time');
ylabel('amplitude');


y32=v3(2,:);
subplot(2,2,2)
plot(t,y32);
Title('f(3,2)');
xlabel('time');
ylabel('amplitude');


y33=v3(3,:);
subplot(2,2,3)
plot(t,y33);
Title('f(3,3)');
xlabel('time');
ylabel('amplitude');


y34=v3(4,:);
subplot(2,2,4);
plot(t,y34);
Title('f(3,4)');
xlabel('time');
ylabel('amplitude');



 
pause;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%computitg ensemble mean and the statdard deviation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%___________________________________________________



%futctiot 1
v1=rp1(80,100);   %generating 80 random signals of first type time length 100
mean1=mean(v1);   %calculating the ensembel mean of generated 80  first type random functions.
std1=std(v1);
subplot(3,2,1);
plot(t,mean1);
xlabel('time');
Title('Process -1');
ylabel('Ensemble Mean');
subplot(3,2,2);
plot(t,std1);            %calculating the ensembel standerd deviation of generated 80  first type random functions.
Title('Process -1');
xlabel('time');
ylabel('Ensemble STD');



%futctiot 2     

v2=rp2(80,100);          %generating 80 random signals of second type time length 100
mean2=mean(v2);
std2=std(v2);
subplot(3,2,3);
plot(t,mean2);
Title('Process -2');
xlabel('time');
ylabel('Ensemble Mean');

subplot(3,2,4);
plot(t,std2);
Title('Process -2');
xlabel('time');
ylabel('Ensemble STD');


%futctiot 3
v3=rp3(80,100);     %generating 80 random signals of third type time length 100

mean3=mean(v3);
std3=std(v3);
subplot(3,2,5);
plot(t,mean3);
Title('Process -3');
xlabel('time');
ylabel('Ensemble Mean');


subplot(3,2,6);
plot(t,std3);
Title('Process -3');
xlabel('time');
ylabel('Ensemble STD');

pause;


%%%%%%%%%%%%%%%%%%finding time averaged parameters of generated random functions%%%%%%%%%%%%%%%%%%%%
n=1:80;

%futctiot 1               %finding the time averaged parameters of random signals of first type/
fv1=transpose(v1);
mean1=mean(fv1);          %time average means of 80 random functions.
subplot(3,2,1);
plot(n,mean1);
xlabel('time');
Title('f1-4 mean');
ylabel('time average Mean');

std1=std(fv1);                  %time average standered deviations of 80 random functions.
subplot(3,2,2);
plot(n,std1);
Title('f1-4 mean');
xlabel('time');
ylabel('Time averaged STD');

%futctiot 2                      %finding the time averaged parameters of random signals of second type/
fv2=transpose(v2);
mean1=mean(fv2);
subplot(3,2,3);
plot(n,mean1);
xlabel('time');
Title('f2-4 mean');
ylabel('time average Mean');

std1=std(fv2);
subplot(3,2,4);
plot(n,std1);
Title('f2-4 mean');
xlabel('time');
ylabel('Time averaged STD');


%futctiot 3                %finding the time averaged parameters of random signals of third type/
fv3=transpose(v3);
mean1=mean(fv3);
subplot(3,2,5);
plot(n,mean1);
xlabel('time');
Title('f1-4 mean');
ylabel('time average Mean');

std1=std(fv3);
subplot(3,2,6);
plot(n,std1);
Title('f3-4 mean');
xlabel('time');
ylabel('Time averaged STD');

Contact us at files@mathworks.com