% demonstrate power spectrum of simple channel noise % calculated by integrating a sequence of alternating 1's and -1's % at random times % npts=10000; %number of samples pchange=0.03; %probability of a state change z=double(rand(1,npts)