实现信道仅有噪声的整个通信流程的demo,也可以加入频偏相偏
2026/8/21 21:44:01 网站建设 项目流程

实现信道仅有噪声的整个通信流程的demo,也可以加入频偏相偏

clear
clc
%% 实现信道仅有噪声的整个通信流程的demo,也可以加入频偏相偏
% Set the example parameters.
fs = 10e6; % Sample rate (Hz)
sps = 4; % Samples per symbol
M = 16; % Modulation order, 16QAM调制
k = log2(M); % Bits per symbol
% Convert the Eb/N0 to SNR and then pass the signal through an AWGN channel.
EbNo = 7;
snr = EbNo + 10log10(k) - 10log10(sps);
rolloff = 0.35;
span = 6;
% rrcFilter = genRRCfilter(rolloff, span, sps); % 重构的构造根升余弦滤波器代码
rrcFilter = rcosdesign(rolloff, span, sps);
phaseFreqOffset = comm.PhaseFrequencyOffset(…
‘FrequencyOffset’,400,…
‘PhaseOffset’,30,…
‘SampleRate’,fs);

data = randi([0 M-1],10000,1);
modSig = qammod(data,M);
x=complex(zeros(length(modSig)*sps - (sps-1),1));% - (sps-1) 是因为最后一个符号不用再插值了,只插在中间
x(1:sps:end)=modSig(1:end);
txSig = conv(x,rrcFilter); % y即txSig
% freqOffsetSig = phaseFreqOffset(txSig);
rxSig = awgn(txSig, snr, ‘measured’);

% Filter and downsample the received signal. Remove a portion of the signal to account for the filter delay.
rxFilt = upfirdn(rxSig, rrcFilter, 1, sps);
rxFilt = rxFilt(span+1:end-span);
scatterplot(rxSig)
scatterplot(rxFilt)

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询