BER VS SNR OF OFDM LTE AWGN (TRANSMITER AND RECIEVER)

버전 1.0.0.0 (1.95 KB) 작성자: raghav khandelwal
GENERAL PROGRAM CAN SIMULATE FOR ANY FFT SIZE
다운로드 수: 748
업데이트 날짜: 2015/5/14

라이선스 보기

clc;
clear all;
close all;
% Initializing parameters
Nfft=input('fft size N = ');
Nused=input('Number of OFDM symbols used m = ');
M=input('constellation size M = ');
Type=input('Type of Mapping (1 for PSK) and (2 for QAM) = ');
Phase_Offset=input('phase offset = ');

Ncp=input('cyclic prefix samples Ncp = ');

% 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

% data generation
Tx_data=randi([0 M-1],Nused,Nfft);
% modulation
mod_data=modulate(Tx,Tx_data);
% Serial to Parallel
s2p=mod_data.';
% insertion of pilots (upsmapling)
upsampled=upsample(s2p,1);
% Amplitude modulation (IDFT using fast version IFFT)
am=ifft(upsampled,Nfft);
% Parallel to serial
p2s=am.';
% Cyclic Prefixing
CP_part=p2s(:,end-Ncp+1:end); % this is the Cyclic Prefix part to be appended.
cp=[CP_part p2s];

% 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(cp,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,1);
% Parallel to serial
rserial=downsampled.';
% demodulation
Umap=demodulate(Rx,rserial);
% Calculating the Symbol Error Rate
[n, r(c)]=symerr(Tx_data,Umap);

end
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). BER VS SNR OF OFDM LTE AWGN (TRANSMITER AND RECIEVER) (https://www.mathworks.com/matlabcentral/fileexchange/50844-ber-vs-snr-of-ofdm-lte-awgn-transmiter-and-reciever), MATLAB Central File Exchange. 검색됨 .

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

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