-
大小: 1KB文件类型: .rar金币: 1下载: 0 次发布日期: 2021-04-21
- 语言: Matlab
- 标签: zadoff sequence zadoff_chu Zadoff–Chu chu
资源简介
matlab code for zadoff-chu sequence
代码片段和文件信息
clc; clear all; close all;
u=7;
Nzc=353;
% N=126
for i=1:u
for n=1:Nzc
x(n)=exp(-j*((pi*u*n*(n+1))/Nzc));
end
end
n=1:Nzc;
figureplot(nx);
title(‘Zad off sequence for u=7 and Nzc=353‘);
xlabel(‘Time‘);
ylabel(‘Amplitude‘);
x1=abs(x);
figureplot(nx1);
x2=xcorr(x);
figureplot(1:(2*Nzc)-1x2);
x3=fft(x);
figureplot(nx3);
u=1;
for n=1:Nzc
x(n)=exp(-j*((pi*u*n*(n+1))/Nzc));
end
u=2;
for n=1:Nzc
y(n)=exp(-j*((pi*u*n*(n+1))/Nzc));
end
x5=xcorr(xy);
figureplot(1:(2*Nzc)-1x5);
%pss generation
pss_temp = zeros(312);
for n=1:31
pss_temp(n1) = exp(-1i*pi*u*(n-1)*n/63);
pss_temp(n2) = exp(-1i*pi*u*(n+31)*(n+32)/63);
end
pss = reshape(pss_temp62[]);
NID1=0; NID2=1;
qq = floor(NID1/30);
q = floor((NID1+qq*(qq+1)/2)/30);
mm = NID1+q*(q+1)/2;
m0 = mod(mm31);
m1 = mod(m0+floor(mm/31)+1 31);
PNgen = commsrc.pn(‘GenPoly‘ [1 0 0 1 0 1] ...
‘InitialStates‘ [1 0 0 0 0] ...
‘Shift‘ 0 ...
‘NumBitsOut‘ 31);
PNtemp = generate(PNgen).‘;
PNseq = 1-2*PNtemp;
SCgen1 = commsrc.pn(‘GenPoly‘ [1 0 1 0 0 1] ...
‘InitialStates‘ [1 0 0 0 0] ...
‘Shift‘ 0 ...
‘NumBitsOut‘ 31);
SCtemp = generate(SCgen1).‘;
SCseq1 = 1-2*SCtemp;
SCgen2 = commsrc.pn(‘GenPoly‘ [1 1 0 1 1 1] ...
‘InitialStates‘ [1 0 0 0 0] ...
‘Shift‘ 0 ...
‘NumBitsOut‘ 31);
SCtemp = generate(SCgen2).‘;
SCseq2 = 1-2*SCtemp;
SSS = zeros(621);
for n=0:30
SSS(2*n+1) = PNseq(mod(n+m031)+1).*SCseq1(mod(n+NID2 31)+1);
SSS(2*n+2) = PNseq(mod(n+m131)+1).*SCseq1(mod(n+NID2+331)+1).*SCseq2(mod(n+mod(m08)31)+1);
% case 6
% SSS(2*n+1) = PNseq(mod(n+m131)+1).*SCseq1(mod(n+NID2 31)+1);
% SSS(2*n+2) = PNseq(mod(n+m031)+1).*SCseq1(mod(n+NID2+331)+1).*SCseq2(mod(n+mod(m18)31)+1);
end
% for n=1:Nzc
% x1(n)=x(n+Nzc)
% end
% n=1:Nzc;
% figureplot(nx1);
% title(‘Zad off sequence for u=7 and Nzc=353‘);
% xlabel(‘Time‘);
% ylabel(‘Amplitude‘);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2278 2012-08-27 10:05 zcseq.m
----------- --------- ---------- ----- ----
2278 1
- 上一篇:交流电机及其故障仿真
- 下一篇:matlab的车牌定位提取
评论
共有 条评论