Main Code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close all,
clear all,
clc,
Fs=1000;
F=50;
T = 1/Fs;
L=10000;
t=(0:(L-1))*T;
ShowLength=150;
length(t)
d = 0.7*sin(2*pi*F*t);
Noise = rand(size(t)); %Full Scale Noise Input to Filter
x = d + 10*Noise;
subplot(5,1,1); plot(Fs*t(1:ShowLength),d(1:ShowLength)); grid on,
title('Original Clean Signal');
subplot(5,1,2); plot(Fs*t(1:ShowLength),Noise(1:ShowLength)); grid
on, title('Full Scale Noise Signal');
subplot(5,1,3); plot(Fs*t(1:ShowLength),x(1:ShowLength)); grid on,
title('Original Signal Corrupted with Full Scale Zero Mean Random
Noise');
Order=31;
h = fir1(Order,0.5); % FIR system to be identified
delta = 0.001; % LMS step size.
N= length(h);
DesiredSignal = filter(h,1,x)+ (Noise); % Desired signal at 10
times the Full scale Noise
[h,y] = mylms(x,DesiredSignal,delta,N,Fs,t);
subplot(5,1,4); plot(Fs*t(1:ShowLength),2*y(1:ShowLength)); grid
on, title('Filtered Signal');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Function Code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [h, y] = mylms(x,d,delta,N,Fs,t)
M = length(x);
h = zeros(1,N);
for n=N:M
x1 = x(n:-1:n-N+1);
y(n) = h*x1';
e = d(n)-y(n);
h=h+delta*e*x1;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
As the step size decreases, the ASE decreases.
LMS project Using the notes discussed in class: Implementing the LMS Algorithm First generate some signals clear all c...
LMS project Using the notes discussed in class: Implementing the LMS Algorithm First generate some signals clear all close al1: Generate signals for testing the LMS Algorithm 1000 Fs Sampling frequency Sample time 1/Fs 10000: = L Length of signal S Time vector (0:L-1) *T ; Sum of a 50 Hz sinusoid and a 120 Hz sinusoid 0.7 sin (2*pi*50*t); inuside X d+ 10 randn (size (t)); Sinusoids 5O0000000L plus noise fiqure (1) plot (Fs*t (1:150),x (1:1500)) title('Signal Corrupted with...
solve 2.40 a,b,c, e using Fourier series. 2.40 part a,b,c,e 2.40 Consider the continuous-time signals depicted in Fig. P2.40. Evaluate the following convolution integrals: (a) m(t) x(t) y(t) (b) m(t)x(t)z(t) (c) m(t) x(t) ft) (d) m(t) x(t) a(t) (e) m(t)y(t) z(t) (f) m(t) -y(t) w(t) (g) m(t) y(t)g(t) (h) m(t)y(t) c(t) (i) m(t) z(t) f(t) (j) m(t) z(t) g(t) (k) m(t) z(t)b(t) (1) m(t) w(t) g(t) (m) m(t) w(t) a(t) (n) m(t) f(t) g(t (o) m(t) fo) . do) (p)...