Difference between theoretical power spectral density and pwelch/periodogram ARMA models
Mostra commenti meno recenti
Hello,
I am calculating the power spectral density (PSD) of ARMA models in two different ways:
1) By simulating the ARMA model and using Welch's periodogram
2) By using the theoretical PSD form of an ARMA model:

Strangely, enough the two functions seems to be off always by a factor 3 in amplitude, no matter the length of the simulated signal input to the periodogram, nor the order of the ARMA model.
Where is this factor 3 coming from?
Here is a plot of the resulting PSD

Below the code I am using for testing:
%simulate ARMA signal
N = 1000;
mdl = arima('Constant',0,'Variance',1, 'MA',{0.8}, 'AR',{-0.75, - 0.25});
x = simulate(mdl,1000);
EstMdl = mdl;
%calculate periodogram
[psd0, w] = pwelch(x);
figure, plot(w,psd0)
theta = linspace(0,pi,1000);
% Calculate PSD by ARMA theoretical PSD
%form numerator
if ~isempty(EstMdl.MA)
bn = 1:size(EstMdl.MA,2);
epj_b_theta = ones(size(EstMdl.MA,2)+1,length(theta));
for n=1:size(EstMdl.MA,2)
epj_b_theta(n+1,:) = exp(-1j*n*theta);
end
Bn = repmat([1 cell2mat(EstMdl.MA)]', [1 length(theta)]);
Bz= sum(Bn.*epj_b_theta);
else
Bz =1;
end
%form denominator
if ~isempty(EstMdl.AR)
an = 1:size(EstMdl.AR,2);
epj_a_theta = ones(size(EstMdl.AR,2)+1,length(theta));
for n=1:size(EstMdl.AR,2)
epj_a_theta(n+1,:) = exp(-1j*n*theta);
end
An = repmat([1 -cell2mat(EstMdl.AR)]', [1 length(theta)]);
Az = sum(An.*epj_a_theta);
else
Az =1;
end
Hz = Bz./Az;
psd2 = EstMdl.Variance.*abs(Hz).^2;
% Plot
hold on, plot(theta, psd2)
hold on, plot(theta, psd2/3)
xlabel('\theta [rad]')
legend('pwelch', 'PSD_A_R_M_A', 'PSD_A_R_M_A/3')
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Spectral Estimation in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!




