필터 지우기
필터 지우기

Can someone please help me?

조회 수: 1 (최근 30일)
Alexandra Diaconu
Alexandra Diaconu 2018년 8월 29일
댓글: Yinglin Chen 2020년 1월 16일
I have this error: >> p5_7_Simulate_the_Error_Prob_of_OOK_NRZ_in_a_Multipath_Channel Undefined function or variable 'i_peak'.
Error in p5_7_Simulate_the_Error_Prob_of_OOK_NRZ_in_a_Multipath_Channel (line 25) pt = ones(1,nsamp).*i_peak;
What should I do? This is the code:
%%*****Channel Impulse response (using ceiling bounce model*************
Rb=200e6;
% Bit rate
Tb=1/Rb;
% bit duration
sig_length = 1e3;
% number of bits
nsamp = 10;
% samples per symbols
Tsamp = Tb/nsamp;
% sampling time
Dt=0.1;
% Normalized delay spread
Drms=Dt*Tb;
%RMS delay spread
a=12*sqrt(11/13)*Drms;
K=30*nsamp;
% number of channel taps
k=0:K;
h=((6*a^6)./(((k*Tsamp) + a).^7));
% channel impulse response
h=h./sum(h);
% normalizing for conservation of energy
%%system impulse response
pt = ones(1,nsamp).*i_peak;
% transmitter filter
rt=pt;
% receiver filter matched to pt
c=conv(pt,h);
c=conv(c,rt);
% overall impulse response of system
delay=find(c==max(c));
% channel delay
%%multipath simulation
if length(sig_length)==1
if sig_length>0
Range=[0, sig_length-1];
else Range=[sig_length+1, 0];
end
else Range =[min(sig_length), max(sig_length)];
end
OOK=randi(Range,1,sig_length);
% random signal generation
Tx_signal=rectpulse(OOK,nsamp).*i_peak;
% Pulse shaping function (rectangular pulse)
channel_output=conv(Tx_signal,h);
% channel output, without noise
Rx_signal=channel_output+sgma*randn(1,length(channel_output));
% received signal with noise
%Rx_signal=awgn(channel_output,EbN0+3-10*log10(nsamp), 'measured');
%%Matched filter simulation
MF_out=conv(Rx_signal,rt)*Tsamp;
% matched filter output
MF_out_downsamp=MF_out(delay:nsamp:end);
% sampling at end of bit period
MF_out_downsamp=MF_out_downsamp(1:sig_length);
% truncation
Rx_th=zeros(1,sig_length);
Rx_th(MF_out_downsamp > Ep/2) = 1;
  댓글 수: 3
Alexandra Diaconu
Alexandra Diaconu 2018년 8월 29일
Thank you. I solved it.
Yinglin Chen
Yinglin Chen 2020년 1월 16일
So what is i_peak? I am trying to wirte a similar function.

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

채택된 답변

KALYAN ACHARJYA
KALYAN ACHARJYA 2018년 8월 29일
Check here my previous answer

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Detection, Range and Doppler Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by