diff --git a/garage_ip.m b/garage_ip.m index 8e86c6c..87d3057 100755 --- a/garage_ip.m +++ b/garage_ip.m @@ -95,7 +95,7 @@ bits = []; v_min = 0; % Threshold max v_max = 0; % Threshold min hyst_thr = 0.5; % Threshold hysteresis -rho_thr = 1e-5; % Threshold forgetting factor +rho_thr = 1e-4; % Threshold forgetting factor alpha_thr = 0.1; % Min/Max update factor k_leadLag = params.loopFilterGain; % Overall loopfilter gain (scales k_lead and k_lag) k_lead = 0.1; % Symbol syncronizer loop filter lead @@ -136,14 +136,15 @@ while ns < N end end + isSignal = (v_thr >=loopThreshold); % Calc error err = 0; - if (bitChg && (v_thr >=loopThreshold)) + if (bitChg && isSignal) err = -(count - fix(numSamplesPerSym/2)); end % Sample bit at baud rate = fs/numSamplesPerSym - if count == 0 + if count == 0 && isSignal smp = [smp ys]; smp_n = [smp_n n]; bits = [bits bit];