필터 지우기
필터 지우기

correlated interference related to gaussian autoregressiv

조회 수: 1 (최근 30일)
MUDASSAR RAZA
MUDASSAR RAZA 2023년 1월 11일
답변: Mathieu NOE 2023년 1월 11일
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