フィルターのクリア

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 Center および File ExchangeDetection, 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