gold序列实验报告.docx
《gold序列实验报告.docx》由会员分享,可在线阅读,更多相关《gold序列实验报告.docx(13页珍藏版)》请在冰豆网上搜索。
gold序列实验报告
Gold序列实验报告
一、实验过程及分析
lm序列&G°ld序列的产生
(1)选取本原多项式/(x)=1+x+x3+x6+X7>产生m序列。
fbconnection_m=[l010011];
mseq=m_sequence(fbconnection_m);
(2)由本原多项式/(x)=1+?
+a-7&f(x)=\+x+x2+x3+x7生成的m序列为m序列优选对,以此优选对来产生Gold序列。
fbconnection_op_l=[0010001];
fbconnection_op_2=[l110001];
goldseq=gold_seq(fbconnection_op_l,fbconnection_op_2);
2m序列的相关特性
k
图lm序列自相关函数
图2m序列互相关函数
3Gold序列的相关特性
autocorrelationfunctionofgoldsequence
140(
autocorrelationfunctionofgoldsequence
120-
15
-20-150
cross-correlationfunctionofgoldsequence
10
5
-10
-100
-50
50
100
0k
0
150
图4Gold序列互相关函数
127
127
HL.crcss_anii31itude_3i2x=
41
gcld^cross^anplitude^Jiax=
图2-5m序列&Gold序列最小,最大相关值
4m序列&G°ld序列相关特性比较
autocorrelationfunctionofgoldsequence
140
120
100
80
60
40
20
0
-20
图6m序列&Gold序列自相关函数比校
cross-correlationfunctionofmsequencecross-correlationfunctionofgoldsequence
oc
k
k
图7m序列&Gold序列互相关函数比较
gold序列在时延不为0是三值的,这一点不如m序列,在时延为。
处具有与m序列相
同的峰值特性.显然,m序列的自相关特性比Gold序列的自相关特性要好。
Gold序列具有更小的互相关峰值,显然Gold序列的互相关特性比m序列的互相关特性性能要好。
5m序列优选对
m序列优选对也是gold序列族中的gold序列,所以其互相关函数与gold序列一致。
图8m序列优选对的互相关函数
6任选6个Gold序列,观察其自相关函数
图9任选6个Gold序列的自相关函数
7任选6对Gold序列,观察其互相关函数
图10任选6对Gold序列的互相关函数
任意两个Gold序列互相关函数幅度小于或等于17,符合Gold理论。
源码
(1)PN_Correlation.m
%=======================================
%PN_Correlation.m
%CorrelationanalysisofPNsequence
%
%Author:
jzh(04011646seu)
%Date:
2014.12.29
%=======================================
%clean
closeall;
clearall;
clc;
%optimumpairs
fbconnection_op_l=(0010001];
fbconnection_op_2=[l110001];
%anymsequencefortestfbconnection_m=[l010011];
%goldsequence
mseq_op_l=m_sequence(fbconnection_op_l);
mseq_op_2=m_sequence(fbconnection_op_2);
goldseq=gold_seq(fbconnection_op_lzfbconnection_op_2);
%msequence
mseq=m_sequence(fbconnection_m);
%mapping
mseq_op_l((mseq_op_l==0))=-l;
mseq_op_2((mseq_op_2==0))=-l;
goldseq((goldseq==0))=-l;
mseq((mseq==0))=-l;
m_auto=ccorr(mseq);
%anytwomsequencesexceptoptimumpairsm_cross=ccorr(mseq,mseq_op_l);
gold_auto=ccorr(goldseq(l,:
));
gold_cross=ccorr(goldseq(l/:
)/goldseq(2/:
));
m_op_cross=ccorr(mseq_op_l,mseq_op_2);
m_auto_max=max(m_auto)m_auto_min=min(m_auto)gold_auto_max=max(gold_auto)m_cross_amplitude_max=max(abs(m_cross))gold_cross_amplitude_max=max(abs(gold_cross))
N=length(mseq);%sequencelength
abscissa=-N+l:
N-l;%abscissaaxis
figure(l);
plot(abscissa,m_auto);
xlabel(k);ylabel('R(k)');
legendCautocorrelationfunctionofmsequence1);
title('autocorrelationfunctionofmsequence1);
figure
(2);
plot(abscissa,m_cross);
xlabelCk1);ylabelf'Rfk)1);
legend('cross-correlationfunctionofmsequence');
title('cross・correlationfunctionofmsequence1);
figure⑶;
plot(abscissa,gold_auto);
xlabel(k);ylabel('R(k)');
legend('autocorrelationfunctionofgoldsequence1);
title('autocorrelationfunctionofgoldsequence1);
figure(4);
plot(abscissa,gold_cross);
xlabel(k);ylabel('R(k)');
legend('cross-correlationfunctionofgoldsequence1);
titleCcross-correlationfunctionofgoldsequence1);
figure(S);
subplot(l,2,l);
plot(abscissazm_auto);
xlabel(k);ylabel(R(k)');
title('autocorrelationfunctionofmsequence1);
subplot(l,2,2);
plot(abscissa,gold_auto);
xlabel(k);ylabel('R(k)');
title('autocorrelationfunctionofgoldsequence1);
figure(6);
subplot(l,2,l);
plot(abscissa,m_cross);
xlabel(k);ylabel('R(k)');
titlef^ross-correlationfunctionofmsequence1);
subplot(l,2z2);
plot(abscissa,gold_cross);
xlabel(k);ylabel('R(k)');
title('cross・correlationfunctionofgoldsequence1);
figure⑺;
plot(abscissa,m_op_cross);
xlabel(k);ylabel('R(k)');
legendCcross-correlationfunctionofmsequenceoptimumpairs1);
title('cross-correlationfunctionofmsequenceoptimumpairs');
%testautocorrelationofanygoldsequence
fortest_time=1:
6
ii=ceil(rand()*(N+2));
figure。
;
temp_gold_auto=ccorr(goldseq(iiz:
));
plot(abscissaztemp_gold_auto);
xlabel(k);ylabel(・R(k)‘);
legend(strcat('seqnumber=,,num2str(ii)));
titlef^utocorrelationfunctionofarandomgoldsequence1);
end
%testcross-correlationofany2goldsequence
fortest_time=1:
6
ii=ceil(rand()*(N+2));
jj=ceil(rand()*(N+2));
whilejj==ii
jj=ceil(rand()*(N+2));
end
figure。
;
temp_gold_cross=ccorr(goldseq(ii,:
),goldseq(jj,:
));
plot(abscissa/temp_gold_cross);
xlabel(k);ylabel('R(k)‘);
legend(strcat('seqlnumber=,/num2str(ii)//seq2number='/num2str(jj)));
title(strcat('cross-correlationfunctionof2randomgoldsequence:
1,...
crosscorrelationamplitudeMAX=
num2str(max(abs(temp_gold_cross)))));
end
(2)m^sequence.m
%==============================
%m_sequence.m
%generatingmsequence
%
%Author:
jzh(04011646seu)
%Date:
2014.12.29
%==============================
functionmseq=m_sequence(fbconnection)
%==============================m^sequence==============================
%generatingmsequence
%
%Input:
%fbconnection:
feedbackconnectionrespondingtoprimitivepolynomial
%Output:
%msequ:
generationofmsequence,1-by-N
%========================================================================
n=length(fbconnection);
N=2An-l;%lengthofmsequence
register=[zeros(l,n・l)1];%initialstateofshiftregister
%preallocating
newregister=zeros(lzn);
mseq=zeros(lzN);
mseq(l)=register(n);
forii=2:
N
%feedback
newregister(l)=mod(sum(fbconnection.*register),2);
%shift
forjj=2:
n
newregister(jj)=register(jj-l);
end
register=newregister;%update
mseq(ii)=register(n);%outputmsequenceend
(3)gold.seq.m
%==================================
%gold_seq.m
%generatinggoldsequencefamily
%
%Author:
jzh(04011646seu)
%Date:
2014.12.29
%==================================
functiongoldseq=gold_seq(fbconnectionl,fbconnection2)
%===============================gold_seq===============================
%generatinggoldsequencefamily
%
%Input:
%fbconnectionl:
feedbackconnection1
%fbconnection2:
feedbackconnection2
%Note:
fbconnectionl&fbconnection2areoptimumpairs
%Output:
%goldseq:
generationofgoldsequencefamily,(N+2)-by-N
%========================================================================
mseql=m_sequence(fbconnectionl);
mseq2=m_sequence(fbconnection2);
N=2Alength(fbconnectionl)-1;
goldseq=zeros(N+2zN);%preallocating
%differentshiftamountoftwomsequence
forshift_amount=0:
N-l
shift_mseq2=(mseq2(shift_amount+l:
N)mseq2(l:
shift_amount)];
goldseq(shift_amount+1,:
)=mod(mseql+shift_mseq2/2);
end
goldseq(N+L:
)=mseql;
goldseq(N+2z:
)=mseq2;
(4)ccorr.m
%=======================================
%ccorr.m
%calculatecross-correlationfunction
%
%Author:
jzh(04011646seu)
%Date:
2014.12.29
%=======================================
functionr=ccorr(seql,seq2)
%================================ccorr=================================
%calculatecross-correlationfunction
%
%Input:
%seql:
sequence1
%seq2:
sequence2
%Note:
(a)lengthoftwosequencemustbethesame
%(b)twoinputsequence:
calculatecross-correlationfunction
%(c)oneinputsequence:
calculateautocorrelationfunction
%Output:
%r:
correlationfunction,l-by-2*N-l
%========================================================================
%oneinputsequence:
calculateautocorrelation
ifnargin==l
seq2=seql;
end
N=length(seql);
r=zeros(lz2*N-l);%preallocating
fork=-N+l:
-l
seq2_shift=(seq2(k+N+l:
N)seq2(l:
k+N)];
r(N+k)=seql*seq2_shift';
end
fork=O:
N-l
seq2_shift=[seq2(k+l:
N)seq2(l:
k)];
r(N+k)=seql*seq2_shift';
end