通信基础-matlab数字调制

数字信号调制

参数及之间的关系

  • \(f_b\):码元速率\(=1/T_b\)
  • \(f_c\):载波频率
  • \(f_s\):采样频率
  • \(\text{sps}\):一个符号采样多少个点
  • \(\text{span}\):表示截断的符号范围,对滤波器取了几个符号的长度

其中,\(f_s=\text{sps}\cdot f_b\)\(B_{2psk}=2f_b\)

image-20220509144938392

基带信号产生

产生随机数,\(M\)阶数

1
msg=randi([0 M-1],1,100);

星座图映射

1
msgmod=pskmod(msg,M);

成型滤波

插值

1
2
msgmod = [msgmod;zeros(sps-1, length(msgmod))];
msgmod = reshape(msgmod, 1, sps*length(msgmod));

设计滤波器

1
h = rcosdesign(0.35, span, sps);

滤波

1
msgmod = filter(h, 1, msgmod);% 使用filter函数滤波

上变频

1
2
3
t=(0:1:length(msgmod)-1)/fs;   
carry_c=exp(1i*2*pi*fc*t); %载波信号
y=real(msgmod.*carry_c); %上变频

Result

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
clear;clc;close all;
%% BPSK 调制
M=2; %BPSK
fc=7000; %载波频率
sps = 4;
span = 6;
fb = 1000; % 符号速率1e4
fs = sps*fb;

snr_dB=2000; %信噪比
msg=randi([0 M-1],1,100);
msgmod=pskmod(msg,M); %基带2-PSK调制

% figure(1)
% plot(abs(fft(msgmod)));
msgmod = [msgmod;zeros(sps-1, length(msgmod))];
msgmod = reshape(msgmod, 1, sps*length(msgmod));

h = rcosdesign(0.35, span, sps);

msgmod = filter(h, 1, msgmod);% 使用filter函数滤波

t=(0:1:length(msgmod)-1)/fs;
carry_c=exp(1i*2*pi*fc*t); %载波信号
y=real(msgmod.*carry_c); %上变频

figure(1)
plot((-length(y)/2:length(y)/2-1)/length(y)*fs, fftshift(abs(fft(y))))

202205093


通信基础-matlab数字调制
https://lcjoffrey.top/2022/05/09/modualtion-matlab/
作者
Joffrey
发布于
2022年5月9日
更新于
2022年5月9日
许可协议