correlated interference related to gaussian autoregressiv

3 次查看(过去 30 天)
how can i generate the sequence of following equation
phi1=1.98;
phi2=-0.9801;
I(k)=phi1*i(k-1)+phi2*i(k-2)+e(k)
k=2:100
....i(-1),i(-2)......<0 are equal to zero
e(k)=white gaussian noise with variance 0.01

采纳的回答

Mathieu NOE
Mathieu NOE 2023-1-11
hello
weel, you where not very far from the code....
here is it
NB that the for loop start at indice 3 because matlab works with indices starting at 1 and not zero
phi1=1.98;
phi2=-0.9801;
samples = 100;
e = randn(samples,1); % e(k)=white gaussian noise with variance 0.01
v = var(e); % check variance
v_target = 0.01;
amp = sqrt(v_target/v); % compute amplitude factor correction to get target variance
e = e*amp;
v = var(e) % now we have the correct variance
v = 0.0100
% init I
I(1) = e(1); % ....i(-1),i(-2)......<0 are equal to zero
I(2) = phi1*I(1)+ 0 +e(2);
% main loop
for k=3:samples
I(k) = phi1*I(k-1)+phi2*I(k-2)+e(k);
end
plot(I);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Communications Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by