OFDM MULTIPATH CODE LTE GENERAL

버전 1.0.0.0 (2.61 KB) 작성자: raghav khandelwal
OFDM MULTIPATH CODE LTE GENERAL
다운로드 수: 548
업데이트 날짜: 2015/5/14

라이선스 보기

clc;
clear all;
close all;
% Initializing parameters
Nfft=input('Size of fft N = ');
Nused=input('Number of OFDM symbols to be used m = ');
M=input('Size of constellation M = ');
Type=input('Type of Mapping (1 for PSK) and (2 for QAM) = ');
Phase_Offset=input('phase offset = ');
Ncp=input('cyclic prefix samples Ncp = ');
bw = 15*10^6;%%bandwidth
T = 1/bw;%time period
% Transmitter

if Type == 1
Tx = modem.pskmod('M',M,'PhaseOffset',Phase_Offset,'SymbolOrder','gray');
Rx = modem.pskdemod('M',M,'PhaseOffset',Phase_Offset,'SymbolOrder','gray');
else
Tx = modem.qammod('M',M,'PhaseOffset',Phase_Offset,'SymbolOrder','gray');
Rx = modem.qamdemod('M',M,'PhaseOffset',Phase_Offset,'SymbolOrder','gray');
end

%Indoor delay
in_delay = [0 50 110 170 290 310];
N_tap = ceil(max(in_delay)*(10^(-9))/T);
c_in = zeros(1,N_tap+1);
c_tap = ceil(in_delay./50)+1;
inPwr_dB = [0 -3 -10 -18 -26 -32];%% power in dB
inPwr = 10.^(inPwr_dB/10);%% converting to linear scale
c_r = abs(((inPwr/2).*randn(1,length(inPwr)))+((inPwr/2).*randn(1,length(inPwr)))*1i);

for k=1:length(c_tap)
c_in(c_tap(k))=c_r(k);
end
% c_in_s=sum(c_in);

% data generation
Tx_data=randi([0 M-1],Nused,Nfft/2);
% Mapping
mod_data=modulate(Tx,Tx_data);
% Serial to Parallel
s2p=mod_data.';
% insertion of pilots (upsmapling)

upsampled=upsample(s2p,2);

% Amplitude modulation (IDFT using fast version IFFT)

am=ifft(upsampled,Nfft);

% Parallel to serial

p2s=am.';

% Cyclic Prefixing

CP_part=p2s(:,Nfft-Ncp+1:Nfft); % this is the Cyclic Prefix part to be appended.
cp=[CP_part p2s];
% cp_v=reshape(cp,Nused,Nfft+Ncp);

%c_in_v=reshape(c_in,1,8);
conv_data=convn(cp ,c_in);
% Reciever
% Adding Noise using AWGN
SNRstart=3;
SNRincrement=2;
SNRend=11;
c=0;
r=zeros(size(SNRstart:SNRincrement:SNRend));
for snr=SNRstart:SNRincrement:SNRend
c=c+1;

noisy=awgn(conv_data,snr,'measured');
% Remove cyclic prefix part
cpr=noisy(:,Ncp+1:Nfft+Ncp); %remove the Cyclic prefix
% serial to parallel
parallel=cpr.';
% Amplitude demodulation (DFT using fast version FFT)
amdemod=fft(parallel,Nfft);
% Down-Sampling

downsampled=downsample(amdemod,2);
% Parallel to serial
rserial=downsampled.';
% demodulation
Umap=demodulate(Rx,rserial);
% Calculating the Symbol Error Rate
[n, r(c)]=symerr(Tx_data,Umap);

end
figure(1)
snr=SNRstart:SNRincrement:SNRend;
% Plotting SER vs SNR
semilogy(snr,r,'-ok');
grid;
title('OFDM Symbol Error Rate vs SNR');
ylabel('Symbol Error Rate');
xlabel('SNR [dB]');

인용 양식

raghav khandelwal (2024). OFDM MULTIPATH CODE LTE GENERAL (https://www.mathworks.com/matlabcentral/fileexchange/50845-ofdm-multipath-code-lte-general), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2009b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 OFDM에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0

GENERAL CODE