- added overall loopfilter gain k_leadLag
- renamed vars git-svn-id: http://moon:8086/svn/matlab/trunk@106 801c6759-fa7c-4059-a304-17956f83a07c
This commit is contained in:
+9
-8
@@ -24,8 +24,8 @@
|
|||||||
|
|
||||||
function [bits] = garage_ip (varargin)
|
function [bits] = garage_ip (varargin)
|
||||||
|
|
||||||
params = struct ('x', [], 'baudrate', 9600, 'numSamplesPerSym', 16, 'with_filter', 0, 'k_noise', 0.00);
|
params = struct ('x', [], 'sampleRate', 48000, 'numSamplesPerSym', 16, 'with_filter', 0, 'k_noise', 0.00);
|
||||||
units = struct ('x', '', 'baudrate', 'baud', 'numSamplesPerSym', 'sps', 'with_filter', '', 'k_noise', '');
|
units = struct ('x', '', 'sampleRate', '1/s', 'numSamplesPerSym', 'sps', 'with_filter', '', 'k_noise', '');
|
||||||
|
|
||||||
% Parse parameters
|
% Parse parameters
|
||||||
names = fieldnames(params);
|
names = fieldnames(params);
|
||||||
@@ -43,8 +43,8 @@ k_n = params.k_noise; % NOise
|
|||||||
k_s = 1.0; % Sym
|
k_s = 1.0; % Sym
|
||||||
|
|
||||||
numSamplesPerSym = params.numSamplesPerSym;
|
numSamplesPerSym = params.numSamplesPerSym;
|
||||||
baud_init = 2900;
|
fs = params.sampleRate;
|
||||||
fs = baud_init * numSamplesPerSym;
|
baud_init = fs / numSamplesPerSym;
|
||||||
|
|
||||||
numSyms = 100;
|
numSyms = 100;
|
||||||
numBursts = 3;
|
numBursts = 3;
|
||||||
@@ -97,8 +97,9 @@ v_max = 0; % Threshold min
|
|||||||
hyst_thr = 0.5; % Threshold hysteresis
|
hyst_thr = 0.5; % Threshold hysteresis
|
||||||
rho_thr = 1e-5; % Threshold forgetting factor
|
rho_thr = 1e-5; % Threshold forgetting factor
|
||||||
alpha_thr = 0.1; % Min/Max update factor
|
alpha_thr = 0.1; % Min/Max update factor
|
||||||
alpha_lead = 0.1; % Symbol syncronizer loop filter lead
|
k_leadLag = 2.0; % Overall loopfilter gain (scales k_lead and k_lag)
|
||||||
alpha_lag = 0.0001; % Symbol syncronizer loop filter lag
|
k_lead = 0.1; % Symbol syncronizer loop filter lead
|
||||||
|
k_lag = 0.0001; % Symbol syncronizer loop filter lag
|
||||||
lag_accu = 0; % Symbol syncronizer loop filter
|
lag_accu = 0; % Symbol syncronizer loop filter
|
||||||
k_leak = 0; % Lag forgetting factor
|
k_leak = 0; % Lag forgetting factor
|
||||||
loopThreshold = 0.1; % Processing threshold
|
loopThreshold = 0.1; % Processing threshold
|
||||||
@@ -152,8 +153,8 @@ while ns < N
|
|||||||
else
|
else
|
||||||
count = countReload;
|
count = countReload;
|
||||||
end
|
end
|
||||||
vcorr = alpha_lead*err + lag_accu;
|
vcorr = k_leadLag*k_lead*err + lag_accu;
|
||||||
lag_accu = lag_accu + alpha_lag*err;
|
lag_accu = lag_accu + k_leadLag*k_lag*err;
|
||||||
lag_accu = lag_accu * (1-k_leak);
|
lag_accu = lag_accu * (1-k_leak);
|
||||||
baud = (1+vcorr)*fs/numSamplesPerSym;
|
baud = (1+vcorr)*fs/numSamplesPerSym;
|
||||||
_err(n) = err;
|
_err(n) = err;
|
||||||
|
|||||||
Reference in New Issue
Block a user