网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
02月15日漏签0天
matlab吧 关注:292,498贴子:1,659,377
  • 看贴

  • 图片

  • 吧主推荐

  • 游戏

  • 4回复贴,共1页
<<返回matlab吧
>0< 加载中...

求助扩频通信仿真

  • 只看楼主
  • 收藏

  • 回复
  • 石塘444
  • 四方游侠
    5
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
小弟想验证扩频通信比简单的2psk效果好,但是结果相反,求分析啊


  • 石塘444
  • 四方游侠
    5
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
clear all;
close all;
code_length=1000; %信息码元个数
x1=sign(rand(1,code_length)-0.5); %信息码
for i=1:1000
s2((1+(i-1)*10):i*10)=x1(i); %每个信息码元内含fs/f=310个采样点
end
T = length(s2);
figure(1);
subplot(211);
stem(x1);
title('a 脉冲信号');
subplot(212);
plot( s2 );
axis([ 0 1000 -1.2 1.2 ]);
title('b 矩形信号');
%*************************************************************************
% 2PSK 调制
t=linspace(0,50,10000);
si=sin(40*pi*t);
figure(2);
subplot(211);
plot(si);
axis([0,200,-1.2,1.2]);
title('a 载波信号si');
epsk=s2 .* si;
subplot(212);
plot(epsk);
axis([0,200,-1.2,1.2]);
title('b 2psk调制信号');
%************************************************************************
% 加入高斯白噪声
xinhao=awgn(epsk,10); % 通过高斯信道之后的信号
zaosheng=xinhao-epsk; % 高斯噪声曲线
figure(3);
subplot(211);
plot(xinhao);
title('a 加入高斯噪声后的信号');
axis([0,200,-2,2]);
subplot(212);
plot(zaosheng);
title('b 高斯噪声');
axis([0,200,-2,2]);
%********************************************************
% 2psk解调
jietiaoo = xinhao .* si;
figure(4);
subplot(211);
plot(jietiaoo);
axis([0,200,-1.2,1.2]);
title('a 与载波相乘之后的波形');
[f,af] = T2F(t,jietiaoo); %转变到频域
[t,jietiao2] = lpf(f,af,20); %通过低通滤波器,带宽为40
subplot(212);
plot(jietiao2);
axis([0,10000,-1.2,1.2]);
title('b 低通滤波之后的波形');
%**********************************************************
% 抽样判决
for mq=0:999;
if jietiao2( 1,10*mq+5 )<0; %取中间值进行判断
for j= mq*10+1:(mq+1)*10 ;
ji(1,j)=-1;
ab(mq+1)=-1;
end
else
for j=mq*10+1:(mq+1)*10;
ji(1,j)=1;
ab(mq+1)=1;
end
end
end
figure(5);
plot(ji);
axis([0,10000,-1.2,1.2]);
title('a 抽样判决后波形');
%******************************************************************
su = ab - x1;
figure(6);
stem(su);
title('b 检错电平');
%figure(7);
%stem(a);
%title('抽样后的脉冲波形');
A = length(find(su));
B = A/1000;


2026-02-15 07:05:21
广告
不感兴趣
开通SVIP免广告
  • 石塘444
  • 四方游侠
    5
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
怎样才能使2psk系统在信噪比10db的情况下有误码呢?


  • 石塘444
  • 四方游侠
    5
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
function [ t,st ] = F2T( f,sf )
%This function calculate the time signal using ifft function for the input
%signal's spectrum
df = f(2) - f(1);
Fmx = ( f(end)-f(1)+df );
dt = 1/Fmx;
N = length(sf);
T = dt*N;
sff = fftshift(sf);
t = 0 : dt : T-dt;
st = Fmx * ifft(sff);
st = real(st);
end


  • 石塘444
  • 四方游侠
    5
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
function [ t,st ] = lpf( f,sf,B )
% This function filter an input data using a lowpass filter
% Input : f ;frequency samples
% sf ;input data spectrum samples
% B ; lowpass's bandwidth with a rectangle lowpass
%Output: t: time samples
% st: output data's time samples
df = f(2) - f(1);
T = 1/df;
hf = zeros( 1,length(f) );
bf = [ -floor(B/df) :floor(B/df) ] + floor( length(f)/2 );
hf(bf) = 1;
yf = hf .* sf;
[t,st]=F2T( f,yf );
end


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 4回复贴,共1页
<<返回matlab吧
分享到:
©2026 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示