%try cosine wave plot also %a=.5; pi=3.14; f=1; x=[0 0 0 1 1 0 1 1 0 0 1 0 1 1 0 1]; nx=size(x,2); i=1; while i