CLEANUP - changes to folder structure
This commit is contained in:
13
projects/MLSE_ML_based/interp_fec_cross.m
Normal file
13
projects/MLSE_ML_based/interp_fec_cross.m
Normal file
@@ -0,0 +1,13 @@
|
||||
function rop_fec = interp_fec_cross(rops, ber, fec_thr)
|
||||
if all(~isfinite(ber))
|
||||
rop_fec = NaN; return;
|
||||
end
|
||||
idx = find(ber < fec_thr, 1, 'first');
|
||||
if isempty(idx) || idx == 1
|
||||
rop_fec = NaN; return; % no crossing
|
||||
end
|
||||
% linear interpolation between the two nearest points
|
||||
x1 = rops(idx-1); x2 = rops(idx);
|
||||
y1 = ber(idx-1); y2 = ber(idx);
|
||||
rop_fec = interp1([y1 y2], [x1 x2], fec_thr, 'linear', NaN);
|
||||
end
|
||||
Reference in New Issue
Block a user