correlated interference related to gaussian autoregressiv
1 次查看(过去 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
0 个评论
采纳的回答
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
% 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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Measurements and Spatial Audio 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!