Open tianweiye opened 5 years ago
clc;
%创建mod
mod = comm.OFDMModulator('FFTLength',64,'NumSymbols',2,...
'InsertDCNull',true);
%CP长
mod.CyclicPrefixLength=16;
%前后 GI 长度
mod.NumGuardBandCarriers=[0;0];
%开启pilot
mod.PilotInputPort = true;
%pilot位置
mod.PilotCarrierIndices = [7];
%symbol可视化
showResourceMapping(mod)
modDim = info(mod);
%生成发送symbol 16-1-1 null占一个Pilot占一个
dataIn = complex(randn(62,2),randn(62,2));
%生成发送pilot
pilotIn = complex(rand(1,2),rand(1,2));
%生成 OFDM symbols
modData = step(mod,dataIn,pilotIn);
%生成 OFDM解调器
demod = comm.OFDMDemodulator(mod);
%解调,输出
[dataOut, pilotOut] = step(demod,modData);
size(modData) = [160 1] size(dataOut) = [62 2] 64-1-1 cp长1 null长1 size(pilotOut) = [1 2]
https://tianweiye.github.io/2019/11/12/Matlab-OFDM-%E8%B0%83%E5%88%B6%E8%A7%A3%E8%B0%83%E5%99%A8/?cache-bust=1573496397636