Level crossing rate (LCR) and average fade duration (AFD) are two statistics
which describe how the channel changes with time. Although they provide the
same information as channel coherence time and Doppler spread, LCR and AFD
are easier to derive and allow practical measurement.
MOHAMMED ELAMASSIE (2021). Level crossing rate (LCR) and average fade duration (AFD) (https://www.mathworks.com/matlabcentral/fileexchange/54750-level-crossing-rate-lcr-and-average-fade-duration-afd), MATLAB Central File Exchange. Retrieved .
Can somone help to correct this code:
%%% DAta Prep %%%%%%
ampitude=sqrt((Re .^2)+(Im .^2)); % amplitude value
ampitudedB= 20*log10(ampitude); % amplitude in dB
plot (Time,ampitudedB); %Amplitudein db verus time
%calculation of the average fade duration and level crossing rate
% I need an algorithm that can calculate the AFD and LCR for different RMS
% values from -15up till, 5 and gives me an plot in the end of AFD versus the
% different RMS values and LCR versus different RMS values.
data= ampitudedB; % imported |S21| in dB
TH=[-5: 0.2: 5] ; % threshold in dB below RMS level,
MD=10; % measurement duration in se
Fs=length(data)/MD; % sampling frequency in Hz
LCR= num_fad/MD; % in 1 sec
FD=sum(d_fad)/Fs/num_fad; % in sec
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!