Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- y = w'*x;
- yd(i)=y;
- e(i) = y^2 - 1;
- w = w - mu * e(i) * y * x;
- N = 20000; % # symbols
- h = [1,.45,-.2]; % channel impulse response
- h = h/norm(h);
- Le = 20; % equalizer length
- mu = .001; % step size
- snr = 30; % snr in dB
- s0 = round( rand(N,1) )*2 - 1; % BPSK signal
- s = filter(h,1,s0); % filtered signal
- % add Gaussian noise at desired snr
- n = randn(N,1);
- vs = var(s);
- vn = vs*10^(-snr/10);
- n = sqrt(vn)*n;
- r = s + n; % received signal
- e = zeros(N,1); % error
- w = zeros(Le,1); % equalizer coefficients
- w(Le)=1; % actual filter taps are flipud(w)!
- yd = zeros(N,1);
- for i = 1:N-Le,
- x = r(i:Le+i-1);
- y = w'*x;
- yd(i)=y;
- e(i) = y^2 - 1;
- w = w - mu * e(i) * y * x;
- end
Add Comment
Please, Sign In to add comment