clcclear allclose allt= -4 : 0.005 : 4;a=1;%FOR X(T)
subplot(2,1,1)c1=2*pi;c2=4*pi;x2=a*cos(c1.*t);x1=a*cos(c2.*t);x=x1+x2ac=xcorr(x,x);[~,locs]=findpeaks(ac);sol=mean(diff(locs)*0.1)plot(t,x)xlabel('time->')ylabel('x(t)')title('Plot For x(t)')grid ongtext('1841014009')text(-1,-0.5, ['Period Of The Signal =', num2str(sol)])%FOR Y(T)
subplot(2,1,2)c1=2*pi;c2=2;y2=a*cos(c1.*t);y1=a*cos(c2.*t);y=y1+y2ac=xcorr(y,y);[~,locs]=findpeaks(ac);sol=mean(diff(locs)*0.1)plot(t,y)xlabel('time->')ylabel('y(t)')title('Plot For y(t)')grid ongtext('1841014009')text(-1,-0.5, ['Period Of The Signal =', num2str(sol)])
This is what i have done.
But i don't how to determine whether or not the following signals are periodic in MATLAB
Best Answer