Effacer les filtres
Effacer les filtres

correlated interference related to gaussian autoregressiv

1 vue (au cours des 30 derniers jours)
MUDASSAR RAZA
MUDASSAR RAZA le 11 Jan 2023
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

Réponse acceptée

Mathieu NOE
Mathieu NOE le 11 Jan 2023
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);

Plus de réponses (0)

Catégories

En savoir plus sur Measurements and Spatial Audio dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by