{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Program 3

Program 3 - Clear screen and variables clc clear all...

This preview shows pages 1–2. Sign up to view the full content.

clc clear all % Initialize variables alpha = 0.12; k = 1; % Iteration variable % Note that m1 indicates first run and m2 indicates second run value for % m(k) Ev = 0; % E[v(k)^2] Evv = 0; % E[v(k-1)^2] Ev1 = 0; % E[v(k)v(k-1)] Em1v = 0; % E[s(k)m1(k)]+E[m1(k)v(k)] = E[m1(k)v(k)] Em2v = 0; % E[s(k)m2(k)]+E[m2(k)v(k)] = E[m2(k)v(k)] Em1vv = 0; % E[s(k)v(k-1)]+E[m1(k)v(k-1)] = E[m1(k)v(k-1)] Em2vv = 0; % E[s(k)v(k-1)]+E[m2(k)v(k-1)] = E[m2(k)v(k-1)] Es = 2^3 * 2 / (3 * 4); % E[s(k)^2] Em1 = 0; % E[m1(k)^2] Em2 = 0; % E[m2(k)^2] % Defining functions for v=inline('1.2*sin(2*pi*k/3)'); % Function for noise source m1=inline('0.12*sin(2*pi*k/3+(pi/2))'); % m(k) for the first run m2=inline('1.2*sin(2*pi*k/3-(3*pi/2))'); % m(k) for the second run % Calculate Expectation while k < 4 Ev = Ev + v(k) * v(k); Evv = Evv + v(k-1) * v(k-1); Ev1 = Ev1 + v(k) * v(k-1); Em1v = Em1v + m1(k) * v(k); Em2v = Em2v + m2(k) * v(k); Em1vv = Em1vv + m1(k) * v(k-1); Em2vv = Em2vv + m2(k) * v(k-1); Em1 = Em1 + m1(k) * m1(k); Em2 = Em2 + m2(k) * m2(k);

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 4

Program 3 - Clear screen and variables clc clear all...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online