📄 paprofdmbpsk.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Creative Commons% Attribution-Noncommercial 2.5 India% You are free:% to Share — to copy, distribute and transmit the work% to Remix — to adapt the work% Under the following conditions:% Attribution. You must attribute the work in the manner % specified by the author or licensor (but not in any way % that suggests that they endorse you or your use of the work). % Noncommercial. You may not use this work for commercial purposes. % For any reuse or distribution, you must make clear to others the % license terms of this work. The best way to do this is with a % link to this web page.% Any of the above conditions can be waived if you get permission % from the copyright holder.% Nothing in this license impairs or restricts the author's moral rights.% http://creativecommons.org/licenses/by-nc/2.5/in/% Author : Krishna% Email : krishna@dsplog.com% Version : 1.0% Date : 24 February 2008% Modified by : Subhasis% Version : 1.0% Date : April 20, 2009% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Script for computing the per symbol peak to average PAPR for % an OFDM transmit waveform (loosely based on IEEE 802.11A % specifications) % Further, Cumulative Distribution Function (CDF) plots of the % PAPR is capturedclearnFFTSize = 64;% for each symbol bits a1 to a52 are assigned to subcarrier % index [-26 to -1 1 to 26] subcarrierIndex = [-26:-1 1:26];subcarriersymIndex = [-30:-27 27:30];subcarriersymIndex_new = [-28:-27 27:28];nBit = 10000; ip = rand(1,nBit) > 0.5; % generating 1's and 0'snBitPerSymbol = 52;nSymbol = ceil(nBit/nBitPerSymbol);% BPSK modulation% bit0 --> -1% bit1 --> +1ipMod = 2*ip - 1; ipMod = [ipMod zeros(1,nBitPerSymbol*nSymbol-nBit)];ipMod = reshape(ipMod,nSymbol,nBitPerSymbol);st = zeros(nSymbol*80,1);%[];st_slm = zeros(nSymbol*80,1);%[];paprSymbol = zeros(nSymbol,1);paprSymbol_slm = zeros(nSymbol,1);min = 10000;seqs1 = zeros(256,8);for i=0:255seqs1(i+1,:) = 2*bitget(i,8:-1:1)-ones(1,8);end%% conventional SLM, all possible 8 element sequences (total 256)for ii = 1:nSymbolfprintf(1,'%d\n',ii);min = 1000;for seq=0:255R = seqs1(seq+1,:);S = ones(nFFTSize/8,1)*R;Q = S(:)';Q = bitrevorder(Q);inputiFFT = zeros(1,nFFTSize);symboliFFT = zeros(1,nFFTSize);% assigning bits a1 to a52 to subcarriers [-26 to -1, 1 to 26]inputiFFT(subcarrierIndex+nFFTSize/2+1) = ipMod(ii,:);% assigning bits R(1:8) to subcarriers [-30 to -27, 27 to 30]symboliFFT(subcarriersymIndex+nFFTSize/2+1) = R(:);% shift subcarriers at indices [-26 to -1] to fft input indices [38 to 63]inputiFFT = fftshift(inputiFFT);symboliFFT = fftshift(symboliFFT);% doing iFFToutputiFFT = 64*ifft(Q.*inputiFFT,nFFTSize);symboliFFT = 64*ifft(symboliFFT,nFFTSize);outputiFFT = outputiFFT + symboliFFT;% adding cyclic prefix of 16 samples outputiFFT_with_CP = [outputiFFT(49:64) outputiFFT];% computing the peak to average power ratio for each symbolmeanSquareValue = outputiFFT*outputiFFT'/length(outputiFFT);peakValue = max(outputiFFT.*conj(outputiFFT));if(min > peakValue/meanSquareValue) min = peakValue/meanSquareValue; outputiFFT_with_CP_min = outputiFFT_with_CP;end;endpaprSymbol_slm(ii) = min;% concatenating the symbols to form the final outputst_slm((ii-1)*80+1:ii*80) = outputiFFT_with_CP;end%% plottingclose allpaprSymboldB = 10*log10(paprSymbol);paprSymboldB_slm = 10*log10(paprSymbol_slm);[n x] = hist(paprSymboldB,0:0.1:15);[n_slm x] = hist(paprSymboldB_slm,0:0.1:15);plot(x,[1-cumsum(n)/nSymbol; 1-cumsum(n_slm)/nSymbol],'LineWidth',2)xlabel('papr, x dB')ylabel('Probability, X <=x')title('CCDF plots of PAPR from an IEEE 802.11a Tx with BPSK modulation')grid on
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -