t=linspace(0,2*pi,31); %Use 31 points equally spaced starting at 0, ending with 2\pi t=t(1:30)'; % We don't want to use the last point- Only 30 in this case. C1=0:15; C2=1:14; C=cos(t*C1); S=sin(t*C2); A=[C S]; Data=2*sin(2*t)-cos(2*t)+7*cos(8*t)+(1/2)*sin(8*t)+0.1*randn(size(t)); v1=cos(17*t); v2=cos(13*t);