%**************************************************************************
%※ 星上数据接收端 ※%
%**************************************************************************
clc;
clear all;
close all;
load send_data2;
Rb=800000;%码元速率819.2k
k=1; %一个码元间隔包括1个载波周期/2
k2=8; %采样率
fc=k*Rb; % 载波频率,
fs=fc*k2; % 信号采样率
x_size=k*k2;
%正交下变频
%A/D模数变换
% [recievdataI,recievdataQ]=QPSK_demodu(upsenddata);
datalength=length(upsenddata);
recievdataI=upsenddataI;
recievdataQ=upsenddataQ;
%FFT分路
%*******解扩不解调************%
%产生本地载波恢复
carry_I(1:datalength)=cos(2*pi*fc*(1:datalength)/fs+pi/4);
carry_Q(1:datalength)=sin(2*pi*fc*(1:datalength)/fs+pi/4);
firstdemoduQ=recievdataQ.*carry_Q;
%产生15位扩频短码
shortPNcode=shortcode(datalength/k2);
% for var=1:channel
%产生42位扩频长码
longPNcode(1,:)=longcode1(datalength/k2,1);
%DSSoutdataI=mod(walshdata96I+longPNcode,2);
%DSSoutdataQ=mod(walshdata96Q+longPNcode,2);
%长短码进行摸2加,生成本地扰码
despreadcodeI(1,:)=mod(longPNcode(1,:)+shortPNcode(1,:),2);
despreadcodeQ(1,:)=mod(longPNcode(1,:)+shortPNcode(2,:),2);
%变为双极性码,0->1,1->-1
despreadcode1I(1,:)=-2*(despreadcodeI(1,:)-0.5);
despreadcode1Q(1,:)=-2*(despreadcodeQ(1,:)-0.5);
%对本地扰码进行8倍采样
for i=1:datalength/k2
despreadcode2I(1,1+(i-1)*k2:i*k2)=despreadcode1I(1,i);
despreadcode2Q(1,1+(i-1)*k2:i*k2)=despreadcode1Q(1,i);
end
%解扩
despreadout1I(1,:)=recievdataI.*despreadcode2I(1,:);
despreadout1Q(1,:)=recievdataQ.*despreadcode2Q(1,:);
firdemdespreQ=firstdemoduQ.*despreadcode2Q(1,:);
%%
%解调
N=9;
Wn=1/4;
B = fir1(N,Wn);
demoduoutI(1,:)=despreadout1I(1,:).*carry_I;
demoduoutQ(1,:)=despreadout1Q(1,:).*carry_Q;
demodudadaI(1,:)=filter2(B,demoduoutI(1,:));%filter2滤波器无延时,filter有延时
demodudataQ(1,:)=filter2(B,demoduoutQ(1,:));
demodudataI(1,k2/2+1:datalength)=demodudadaI(1,1:datalength-k2/2);
%[demodudataI(var,:),demodudataQ(var,:)]=QPSK_demodu2(despreadout1I(var,:),despreadout1Q(var,:));
% demodudata1I(var,:)=filter2(B,demodudataI(var,:));
% demodudata1Q(var,:)=filter2(B,demodudataQ(var,:));
%8:1下采样,spreadtimes=24;
k3=spreadtimes*k2;
for i=1:datalength/k3
demodudata2I(1,i)=demodudataI(1,k3/2+1+k3*(i-1));
demodudata2Q(1,i)=demodudataQ(1,k3/2+1+k3*(i-1));
end
% end
%% *******************************%
demodudata3I=-(sign(demodudata2I)-1)/2;
demodudata3Q=-(sign(demodudata2Q)-1)/2;
%*************星上交换**********%
%CWTDM复接,去下行调制器
%% *******************************%
figure(2)
subplot(4,1,1)
plot(despreadout1Q(1,:))
%axis([0 k3*8 -1.5 1.5])
axis([0 k3 -2 2])
title('输入解调信号')
grid on
subplot(4,1,2)
plot(carry_Q(1,:))
axis([0 k3 -1 1])
title('载波信号')
grid on
subplot(4,1,3)
plot(demoduoutQ(1,:))
axis([0 k3 -1 1])
title('解调输出信号')
grid on
subplot(4,1,4)
plot(demodudataQ(1,:))
axis([0 k3 -1 1])
title('滤波输出信号')
grid on
figure(3)
subplot(3,1,1)
stairs(despreadcode1Q(1,:))
%axis([0 k3*8 -1.5 1.5])
axis([1 k3/8+1 -1.2 1.2])
title('despreadcode1Q')
grid on
subplot(3,1,2)
plot(despreadcode2Q(1,:))
axis([0 k3 -2 2])
title('despreadcode2Q')
grid on
subplot(3,1,3)
plot(recievdataQ(1,:))
axis([0 k3 -1.2 1.2])
title('recievdataQ')
grid on
figure(4)
subplot(3,1,1)
plot(despreadcode2Q(1,:))
%axis([0 k3*8 -1.5 1.5])
axis([0 k3 -2 2])
title('despreadcode1Q')
grid on
subplot(3,1,2)
plot(firstdemoduQ(1,:))
axis([0 k3 -2 2])
title('firstdemoduQ')
grid on
subplot(3,1,3)
plot(firdemdespreQ)
axis([0 k3 -1.2 1.2])
title('firdemdespreQ')
grid on
% subplot(4,1,4)
% plot(carry_Q(1,:))
% axis([0 k3*2 -1 1])
% title('解调输出信号')
% grid on
% %%
% figure(4)
% subplot(3,1,1)
% plot(demoduoutQ(1,:))
% %axis([0 k3*8 -1.5 1.5])
% axis([0 k3*2 -1.2 1.2])
% title('解调输出信号demoduoutQ')
% grid on
% subplot(3,1,2)
% plot(demodudataQ(1,:))
% axis([0 k3*2 -1 1])
% title('滤波输出信号demodudataQ')
% grid on
% subplot(3,1,3)
% plot(demodudata2Q(1,:))
% axis([1 k3/4 -1 1])
% title('下采样输出信号demodudata2Q')
% grid on
% %% *******************************%
% figure(3)
% subplot(2,1,1)
% % stairs(despreadout2I(1,:))
% % axis([1 k3/4 -1.2 1.2])
% % title('原始发送信号')
% % grid on
% % subplot(3,1,2)
% stairs(demodudata3I(1,:))
% %axis([0 k3*8 -1.5 1.5])
% axis([1 k3/4 -0.2 1.2])
% title('解扩输出信号')
% grid on
% subplot(2,1,2)
% stairs(walshdataI(1,:))
% axis([1 k3/4 -0.2 1.2])
% title('原始发送信号')
% grid on
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
CDMA.rar (52个子文件)
CDMA
walshcode.m 830B
filer_PSK2.m 2KB
filer_PSK.m 2KB
longcode1.m 3KB
filer_QPSK2.m 3KB
1124-2.fig 114KB
recieve_onsat1.m 3KB
recieve_onsat24.m 5KB
filer_QPSK4q.m 2KB
p2.fig 1KB
ffttest.m 313B
test1.m 453B
filer_QPSK.m 2KB
filer_QPSK3q.m 2KB
longcode.m 865B
psk1.fig 80KB
filer_PSK1.m 3KB
QPSK2.m 3KB
filer_QPSK4.m 3KB
QPSK_demodu2.m 1KB
filter.m 905B
filer_QPSK3.m 2KB
QPSK_demodu1.m 1KB
psk3.fig 80KB
recieve_onsat.m 2KB
recieve_onsat_1.m 3KB
addniose.m 3KB
filter_try.m 3KB
system_upsend24.m 2KB
filer_QPSK2_1.m 3KB
QPSK1.m 3KB
filer_QPSK1.m 3KB
hh1.m 2KB
myfilter1.m 974B
mfilter.m 905B
recieve_onsat_2.m 3KB
n15.fig 8KB
test2.m 1KB
QPSK.m 2KB
n25.fig 9KB
1124-1.fig 34KB
system_upsend.m 1KB
system_upsend_1.m 3KB
QPSK_demodu.m 1KB
filer_PSK3.m 3KB
hh.m 57B
myfilter.m 939B
p1.fig 1KB
shortcode.m 1KB
shengyuxian.m 902B
filer_QPSK2q.m 3KB
www.pudn.com.txt 218B
共 52 条
- 1
alvarocfc
- 粉丝: 109
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0