NRZ/RZ信号,脉冲成形

close all;
clear all;
% 生成多个码元序列
Ts = 1;                          % 码元周期
Rs = 1/Ts;                     % 码元速率
N_sample = 10;            % 单个码元抽样点数
fs = N_sample*Rs;       % 采样频率
dt = Ts/N_sample;        % 抽样时间间隔
N = 6;                 % 本次仿真的码元总数
sig_len=N *N_sample;    % 本次仿真的采样点数
gt1 = ones(1, N_sample);
gt2 = [ones(1, N_sample / 2), zeros(1, N_sample / 2)]; % RZ
gt3 = [-ones(1, N_sample / 2), zeros(1, N_sample / 2)]; % RZ
% RAN = round(rand(1, N));% 生成20个随机数
RAN=[0,1,0,1,0,1];
se1 = [];               % 存放NRZ序列
se2 = [];               % 存放RZ序列
for i = 1 : N % 生成序列
   if RAN(i)==1
       se1 = [se1 gt1];
       se2 = [se2 gt2];
   else
       se1 = [se1 zeros(1, N_sample)];
       se2 = [se2 gt3];
   end
end
%% 1.观察NRZ序列与RZ序列的频谱
fft_se1=fftshift(abs(fft(se1,sig_len*10)));
fft_se2=fftshift(abs(fft(se2,sig_len*10)));
figure(1)
subplot(2,2,1);plot(se1);ylim([-1.5 1.5]);grid on;title('NRZ序列');
subplot(2,2,2);plot(fft_se1);grid on;title('NRZ序列的频谱');
subplot(2,2,3);plot(se2);ylim([-1.5 1.5]);grid on;title('RZ序列');
subplot(2,2,4);plot(fft_se2);grid on;title('RZ序列的频谱');

结论,由下图可见,NRZ的频谱相较于RZ的频谱要宽。即说明RZ编码的效率要低一些。

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值