我正在尝试计算并在symetric轴上绘制结果(-x:0:x) 但是我只能从0:x获得x轴上的结果 无论如何,我正在尝试模拟LAS cdma的LA代码自相关和互相关
我正在使用的代码:
Ko = 38;
n = 0:10;
for i = 1:length(n)
x(i) = Ko*i+i*(i-1);
end
for n = 11
x11 = x(10)+(Ko+22);
end
for n = 12
x12 = x11+(Ko+24);
end
for n = 13
x13 = x12+(Ko+30);
end
for n = 14
x14 = x13+(Ko+34);
end
for n = 15
x15 = x14+(Ko+38);
end
pulses = [x, x11, x12, x13, x14, x15];
spaces = 0:808;
samplespace = zeros(1,length(spaces));
samplespace(1) = dd(1);
samplespace(39) = dd(39);
samplespace(79) = dd(79);
samplespace(121) = dd(121);
samplespace(165) = dd(165);
samplespace(211) = dd(211);
samplespace(259) = dd(259);
samplespace(309) = dd(309);
samplespace(361) = dd(361);
samplespace(415) = dd(415);
samplespace(471) = dd(471);
samplespace(531) = dd(531);
samplespace(593) = dd(593);
samplespace(661) = dd(661);
samplespace(733) = dd(733);
samplespace(809) = dd(809);
LA_pulse = [samplespace];
otocor=LA_pulse;
N=length(otocor);
y=otocor;
z=otocor;
for i=1:N-1
for i=N-1:-1:1
otocor(i+1)=otocor(i);
end
otocor(1)=0;
z=[z; otocor];
end;
m=[z]*[y'];
m=m/N;
m2=fliplr(m)
stem(m);
如何绘制-808 : 808
的结果和0
x轴的symetric?
因为我不确定我是否正在这里为LAS cdma中的LA代码计算自相关
答案 0 :(得分:0)
我可以'测试它,但试试这个:
m_sym = [fliplr(m), m];
stem(linspace(-808, 808, numel(m_sym)),m_sym)