资源简介

载波频率2.4GHZ 码元速率500MHz 含有加噪处理过程 代码可运行 无问题 学渣草草之作 作业用 有点水

资源截图

代码片段和文件信息

function [Pe]=U201115115
%% 作者信息                          
%%沈培逸 U201115115 光电1107
%% 程序功能简述
%基带信号产生
%QPSK的调制和解调
%低通滤波器滤波
%绘制QPSK调制波形频谱图及星座图
%% 关键变量说明
%data  原始随机二进制序列
%data1 NRZ信号
%data_modul 总调制信号
%I_a 解调后I路信号 Q_a 解调后Q路信号

%% 代码部分
%-----------------------------基带信号产生----------------------------------
clc;
clear all;
data=randi([0 1]12^10);
f=2.4e9;                                                                   %载波频率2.4GHz
Rb=5e6;                                                                    %码元速率5MHz
Ts=1/f;
Ns=5;                                                                      %每个载波采样5个点 
sample=480*Ns;                                                             %每个码元采点数为2400                                                     
N=sample*length(data)/2;                                                   %总采样点数
data1=2*data-1;                                                            %正/负极性变换产生二进制不归零双极性码元


%-------------------------将信息源分成两路 ,分别对信号进行抽样-------------
data_1=zeros(1N);                                                         %定义一个长度为N的空数据data_1
for i1=1:512;
    data_1(sample*(i1-1)+1:sample*i1)=data1(2*i1-1);                       %对奇数码元进行采样
end

data_2=zeros(1N);
for i2=1:512;
    data_2(sample*(i2-1)+1:sample*i2)=data1(2*i2);                         %对偶数码元进行采样
end


                                                                           
a=zeros(1N);
b=zeros(1N);
for j1=1:N;                                                                
    a(j1)=cos(2*pi*f*(j1-1)*Ts/Ns);                                        %对余弦载波抽样每个周期采N个点
    b(j1)=-sin(2*pi*f*(j1-1)*Ts/Ns);                                       %对正弦载波抽样每个周期采N个点
end


%---------------------------------调制-------------------------------------
data_a=data_1.*a;                                                          %a路用余弦调制                         
data_b=data_2.*b;                                                          %b路用正弦调制


%--------------------------绘制调制后波形的频谱图---------------------------
figure(1)        
data_modul=data_a+data_b;                                                  %调制后总的信号
QPSK=10*log10(abs(fftshift(fft(data_modul))).^2);                          %信号的频率值
SFreq=linspace(-Rb*sample/2Rb*sample/2length(QPSK));                     %信号的频率谱范围
plot(SFreqQPSK);
title(‘QPSK调制波形频谱图‘);
axis([-6e9 6e9 -200 150]);
xlabel(‘Frequency‘);
ylabel(‘Amplitude‘);
hold on;

%---------------------------------解调-------------------------------------

data_I=2*data_modul.*a;                                                    %得到I路信号  其中乘2是为了让波形成为[0 1]序列
data_Q=2*data_modul.*b;

%--------------------------理想低通滤波器滤波-------------------------------
for j2=1:length(data_modul);                                               %构建理想低通滤波器
    if abs(SFreq

评论

共有 条评论