How to generate 2D complex white Gaussian sequence with a zero mean and identity covariance?

3 ビュー (過去 30 日間)
I'm trying to create a 2D complex white Gaussian with a mean of zero and a covariance of (N/2)I where N is the size of the matrix.
I've been trying it with the following code:
w = randn(N) + i*randn(N);
but if I do cov(w) or mean(w) it doesn't fit that criteria. I feel like my process is a gross oversimplification of making a 2D complex Gaussian.

採用された回答

Shaik
Shaik 2023 年 5 月 16 日
編集済み: Torsten 2023 年 5 月 16 日
N = 100; % Size of the matrix
w_real = randn(N) * sqrt(N/2); % Real part with mean 0 and variance N/2
w_imag = randn(N) * sqrt(N/2); % Imaginary part with mean 0 and variance N/2
w = w_real + 1i * w_imag; % Combine real and imaginary parts
% Verify mean and covariance properties
mean_w = mean(w(:)) % Mean of w
mean_w = -0.0326 - 0.0201i
cov_w = cov([real(w(:)), imag(w(:))]) % Covariance of w (real and imaginary parts)
cov_w = 2×2
51.1531 -0.5130 -0.5130 50.2423
Hey, can you check this modified code.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumerical Integration and Differential Equations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by