www.pudn.com > BOC.rar > boc.asv


M=5; 
N=1; 
fs=80e6; 
ind=9900:10100; 
t=0:1/fs:10000/fs; 
f0=1.023e6; 
%code=cacode(1,N*1.023e6, fs,10000,0); 
code = gcode(N*1.023e6, fs, 10000); 
x=2*pi*f0*M*t(1:length(code)); 
 
Xnm1=code.*sign(exp(j*1*x)); 
Xnm1p=code.*sign(exp(-j*1*x)); 
Xnm3=code.*(exp(j*3*x)); 
Xnm3p=code.*(exp(-j*3*x)); 
Xnm5=code.*sign(exp(j*5*x)); 
Xnm5p=code.*sign(exp(-j*5*x)); 
Xnm7=code.*sign(exp(j*7*x)); 
Xnm7p=code.*sign(exp(-j*7*x)); 
 
CnmO=code.*sign(sin(x)); 
CnmQ=code.*sign(cos(x)); 
 
 
f = [0 0.02 0.02 1]; m = [1 1 0 0]; 
b = fir2(30,f,m); 
%Cnm=filter(b,1,CnmO); 
Cnm=CnmO; 
figure(1) 
subplot(3,1,1); 
tmp=abs(fft(Xnm3)); 
plot(20*log10(fftshift(tmp))); 
 
subplot(3,1,2); 
tmp=abs(fft(Cnm)); 
plot(20*log10(fftshift(tmp))); 
subplot(3,1,3); 
tmp=abs(fft(code.*cos(x))); 
plot(20 
 
figure(2) 
xc1=abs(xcorr(Cnm,Xnm1))+abs(xcorr(Cnm,Xnm1p)); 
xc3=abs(xcorr(Cnm,Xnm3))+abs(xcorr(Cnm,Xnm3p)); 
xc5=abs(xcorr(Cnm,Xnm5))+abs(xcorr(Cnm,Xnm5p)); 
xc7=abs(xcorr(Cnm,Xnm7))+abs(xcorr(Cnm,Xnm7p)); 
xctemp=abs(xcorr(Cnm,code.*cos(x))); 
xias=(ind-10000)*1.023/80; 
%plot(xias,xc2(9900:10100),xias,xc3(9900:10100),xias,xc1(9900:10100)+xc1n(9900:10100)); 
%figure(3) 
%plot(xias,sqrt(xc2(9900:10100).^2+xc3(9900:10100).^2),xias,xc4(9900:10100)); 
subplot(2,2,1) 
plot(xias,xc1(ind)); 
subplot(2,2,2) 
plot(xias,xc3(ind)); 
subplot(2,2,3) 
plot(xias,xc5(ind)); 
subplot(2,2,4) 
plot(xias,xc7(ind)); 
figure(3) 
plot(xias,xctemp(9900:10100))