• 大小: 3KB
    文件类型: .m
    金币: 1
    下载: 0 次
    发布日期: 2021-05-20
  • 语言: Matlab
  • 标签: SC-FDMA  

资源简介

SC-FDMA PAPR matlab 实现,经过仿真测试,完全正确。

资源截图

代码片段和文件信息

%=============================================
%This is the PAPR simulator for SC-FDMA.
%=============================================
function paprSCFDMA()

dataType=‘16QAM‘;
totalSubcarriers=512;
numSymbols=16;
u=25;
A=0.03;
Q=totalSubcarriers/numSymbols;
Q_tilda=31;
subcarrierMapping=‘LFDMA‘;
pulseShaping=1;
filterType=‘rc‘;
rolloffFactor=0.0999999999;
%rolloffFactor=0.4;
Fs=5e6;
Ts=1/Fs;
Nos=4;

if filterType==‘rc‘psFilter=rcPulse(TsNosrolloffFactor);
elseif filterType==‘rr‘psFilter=rrcPulse(TsNosrolloffFactor);
end
numRuns=1e2;
papr=zeros(1numRuns);
for n=1:numRuns
    if dataType==‘Q-PSK‘
    tmp=round(rand(numSymbols2));
        tmp=tmp*2-1;
        data=(tmp(1:)+j*tmp(2:))/sqrt(2);
    elseif dataType==‘16QAM‘
        dataSet=[-3+3i -1+3i 1+3i 3+3i ...
            -3+i -1+i 1+i 3+i ...
            -3-i -1-i 1-i 3-i ...
            -3-3i -1-3i 1-3i 3-3i];
        dataSet=dataSet/sqrt(mean(abs(dataSet).^2));
        tmp=ceil(rand(1numSymbols)*16);
        for k=1:numSymbols
            if tmp(k)==0
                tmp(k)=1;
            end
            data(k)=dataSet(tmp(k));
        end
        data=data.‘;
    end
    
    X=fft(data);
    
    Y=zeros(1totalSubcarriers);
    if subcarrierMapping==‘IFDMA‘
        Y(1:Q:totalSubcarriers)=X;
    elseif subcarrierMapping==‘LFDMA‘
        Y(1:numSymbols)=X;
    elseif subcarrierMapping==‘DFDMA‘
        Y(1:Q_tilda:Q_tilda*numSymbols)=X;
    end
    
    
    y=ifft(Y);
    
    if pulseShaping==1
 

评论

共有 条评论

相关资源