clear all
set(0,'defaultaxesfontsize',20);
N=10;
lag=[-N:N];
bark1=[1 1 1 -1 -1 1 -1 0 0 0 0];
r11=conv(bark1,conj(bark1(end:-1:1)));
figure(1)
set(gca,'FontSize',20);
stem(lag,r11,'Linewidth',3)
xlabel('Lag Value')
%
bark2=[0 1 1 1 -1 -1 1 -1 0 0 0];
r22=conv(bark2,conj(bark2(end:-1:1)));
figure(2)
set(gca,'FontSize',20);
stem(lag,r22,'Linewidth',3)
xlabel('Lag Value')
%
bark3=[0 0 1 1 1 -1 -1 1 -1 0 0];
r33=conv(bark3,conj(bark3(end:-1:1)));
figure(3)
set(gca,'FontSize',20);
stem(lag,r33,'Linewidth',3)
xlabel('Lag Value')
%
bark4=[0 0 0 1 1 1 -1 -1 1 -1 0];
%bark5=[0 0 0 1 1 1 -1 1 0 0 0];
r44=conv(bark4,conj(bark4(end:-1:1)));
figure(4)
set(gca,'FontSize',20);
stem(lag,r44,'Linewidth',3)
xlabel('Lag Value')
%
lagCT=[-4*7+1:4*7-1];
bark=[1 1 1 -1 -1 1 -1];
barkCT=kron(bark,ones(1,4));
r77=conv(barkCT,conj(barkCT(end:-1:1)));
figure(5)
set(gca,'FontSize',18);
plot(lagCT,r77,'Linewidth',3)
xlabel('Lag Value')
%
w0=pi/3;
x=exp(j*w0*[0:10]).*[1 1 1 -1 -1 1 -1 0 0 0 0];
rxx=conv(x,conj(x(end:-1:1)));
ryy=exp(j*w0*lag).*r11;
% x=cos(w0*[0:10]).*[1 1 1 -1 -1 1 -1 0 0 0 0];
% rxx=conv(x,conj(x(end:-1:1)));
% ryy=0.5*cos(w0*lag).*r11;
normd=norm(rxx-ryy)
[rxx' ryy']



