tianweiye / tianweiye.github.io

TWY Blog tianweiye.github.io
https://tianweiye.github.io
1 stars 0 forks source link

Matlab OFDM 调制解调器 | Twy's Blog #21

Open tianweiye opened 5 years ago

tianweiye commented 5 years ago

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

tianweiye commented 5 years ago
tianweiye commented 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]

ofdm

tianweiye commented 5 years ago

参考网页

ofdmmod(...)

ofdmdemod(...)

comm.OFDMModulator(...)

comm.OFDMDemodulator(...)

awgn(...)