Directly on the code, using hist to draw frequency histogram and frequency histogram ...
%rand fs=1000;
n=10000;
T=0:1/FS: (N-1)/fs;
X1=rand (1,length (t));
Subplot (221) plot (t,x1), Xlabel (' time (s) '), Ylabel (' A random signal with a 10,000-point sample ') title (' A random signal with a 10,000-point sample: 0-1 uniformly distributed white noise '); % RANDN usage x3=mean3+sqrt (VAR3). *RANDN (1,n)%fs=1000;
n=100000;
%T=0:1/FS: (N-1)/fs x2=randn (1,length (t));
Subplot (222) plot (t,x2), Xlabel (' time (s) '), Ylabel (' A random signal with a 10,000-point sample ') title (' A random signal with a 10,000-point sample: The white noise of the standard normal distribution); % amplitude Statistics A1=max (X1)-min (X1)% calculated amplitude%N1=HISTC (X1, (min (X1): A1/100:max (X1))) subplot (223) hist (X1, (min (X1): A1/100:max (X1))
)%%[n1,bin1]=hist (X1, (min (X1): A1/100:max (X1)))% (' 0-1 evenly distributed white noise amplitude equal to 100 of the statistical Frequency distribution ') Xlabel (' Random variable x value ') Ylabel ("Frequency statistics after 100 of random variable x amplitude") A2=max (X1)-min (X1)%N2=HISTC (X2, (min (X2): A2/100:max (X2)))%n=n2/n;x= (min (X2): a2/
100:max (X2));
%figure%plot (x,n) subplot (224) hist (X2, (min (X2): A2/100:max (X2))); Title (' Statistical frequency distribution after equal to 100 of the white noise amplitude of the standard normal distribution ') Xlabel (' Random variable x value ') ylabel (' random variable x amplitude equal to 100 of the frequency Statistic value ') [N1,bin1]=hist (X1, (min (X1): A1
/100:max (X1));
Figure subplot (211);
Bar (bin1,n1/n); Title (' 0-1 uniformly distributed white noise amplitude equal to 100 post-statistical frequency distribution ') Xlabel (' Random variable x value ') ylabel (' random variable x amplitude equal to 100 after the statistical frequency distribution ') [N2,bin2]=hist (X2, (min (X2): A2/100:max (X2)));
Subplot (212);
Bar (bin2,n2/n); Title (' Normal normal distribution of white noise amplitude equal to 100 after statistical frequency distribution ') Xlabel (' Random variable x value ') ylabel (' random variable x amplitude equal to 100 after the statistical frequency distribution ')
The experimental results are shown in the following diagram:
2015-9-16 Less Art