Professional Documents
Culture Documents
Question 2
Question 2
Question 2
% Perform MC simulations
for m = 1:M
% Generate a random sample of v[k] (assumed to be zero-mean)
v = sigma * randn(1, N);
1
% subplot(2, 2, 3);
% qqplot(real_parts_an(:));
% title('QQ Plot of Real Parts of a_n');
% subplot(2, 2, 4);
% qqplot(imaginary_parts_bn(:));
% title('QQ Plot of Imaginary Parts of b_n');
We can see that the DFT coefficients follow Gaussian distributions in MC simuations
% Parameters
M = 10000; % Number of realizations
N_values = [100, 200, 500, 1000, 10000]; % Different values of N
for i = 1:length(N_values)
N = N_values(i);
Pfn_realizations = zeros(M, N); % Store P[f_n] for each realization
for m = 1:M
% Generate a realization of the Gaussian process v[k]
vk = sigma * randn(1, N);
2
% Compute DFT coefficients and estimate PSD
V = fft(vk);
Pfn = abs(V).^2 / N;
Pfn_realizations(m, :) = Pfn;
end
3
Mean and variance don't go to zero but remains constant after large values of N , thus showing its not a
consistent estimator