clc; close all; clear all;
% waveform setting
ga=1; % g(t) magnibude
gr=2; % symbol rates,Mhz
gt=1/gr; % symbol interval
gd=0.5; %
gn=2^7; % g(t) symbol number
gs=64; % sampling points per symbol
gp=gn*gs; % total sampling point
dt=gt/gs; % symbo time interval
st=gp*dt; % total sampling time
df=1/st; % samping frequency interval
bw=gp*df; % system bandwidth
t=linspace(-st/2,st/2,gp); % time vector
f=linspace(-bw/2,bw/2,gp); % freq vector
loop=1000; % for smooth the curve
EP=zeros(1,gp);
for jj=1:loop
a=round(rand(1,gn)); % generate gn symbols
ma=mean(a,2);
ta=std(a,0,2);