필터 지우기
필터 지우기

Need Urgent Help

조회 수: 2 (최근 30일)
Sherif
Sherif 2011년 3월 21일
clear all; clc; close all;
K = 128; % SIZE OF OFDM Symbol
IF = 2; % Interpolation factor (Oversampling factor)
N = K*IF; % SIZE OF FFT
CR = 4; % Clipping ratio (linear 4 <==>log 6dB)
QPSK_Set = [1 -1 1i -1i];
ITERATE_NUM = 4;
MAX_SYMBOLS = 1e4;
PAPR_Orignal = zeros(1,MAX_SYMBOLS);
PAPR_RCF = zeros(ITERATE_NUM,MAX_SYMBOLS);
for nSymbol=1:MAX_SYMBOLS
Index = RANDI(1,K,length(QPSK_Set))+1;
X = QPSK_Set(Index(1,:)); % Orignal Frequency domain signal
XX = [X(1:K/2) zeros(1,N-K) X(K/2+1:K)];
x = ifft(XX,[],2); % Time domain signal
Signal_Power = abs(x.^2);
Peak_Power = max(Signal_Power,[],2);
Mean_Power = mean(Signal_Power,2);
PAPR_Orignal(nSymbol) = 10*log10(Peak_Power./Mean_Power);
for nIter=1:ITERATE_NUM
% Clipping
x_tmp = x(Signal_Power>CR*Mean_Power);
x_tmp = sqrt(CR*Mean_Power)*x_tmp./abs(x_tmp);
x(Signal_Power>CR*Mean_Power) = x_tmp;
% Filtering
XX = fft(x,[],2);
XX(K/2+(1:N-K)) = zeros(1,N-K);
x = ifft(XX,[],2);
% PAPR Compute
Signal_Power = abs(x.^2);
Peak_Power = max(Signal_Power,[],2);
Mean_Power = mean(Signal_Power,2);
PAPR_RCF(nIter,nSymbol) = 10*log10(Peak_Power./Mean_Power);
end
end
[cdf0, PAPR0] = ecdf(PAPR_Orignal);
[cdf1, PAPR1] = ecdf(PAPR_RCF(1,:));
[cdf2, PAPR2] = ecdf(PAPR_RCF(2,:));
[cdf3, PAPR3] = ecdf(PAPR_RCF(3,:));
[cdf4, PAPR4] = ecdf(PAPR_RCF(4,:));
%--------------------------------------------------------------------------
semilogy(PAPR0,1-cdf0,'-b',PAPR1,1-cdf1,'-r',PAPR2,1-cdf2,'-g',PAPR3,1-cdf3,'-c',PAPR4,1-cdf4,'-m')
legend('Orignal','One clip and filter','Two clip and filter','Three clip and filter','Four clip and filter')
xlabel('PAPR0 [dB]');
ylabel('CCDF (Pr[PAPR>PAPR0])');
xlim([0 12])
grid on
when i run the following coding a error message comes as follows , and script is stop running.
??? Attempt to execute SCRIPT clipping as a function: C:\Users\SHEHAN\Desktop\clipping.m
please some one help me its really urgent unable eto find the error..have to amend it soon as possible.
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 3월 23일
"urgent", but no response from the author within 3 days?

댓글을 달려면 로그인하십시오.

답변 (1개)

Walter Roberson
Walter Roberson 2011년 3월 21일
Rename C:\Users\SHEHAN\Desktop\clipping.m to something else. You have accidentally used the same name as the name of an internal function, and your version is trying to take precedence over the internal version.

카테고리

Help CenterFile Exchange에서 Test and Measurement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by