complex gaussian noise generation

15 ビュー (過去 30 日間)
Jetty Rakesh Aditya
Jetty Rakesh Aditya 2020 年 10 月 24 日
回答済み: Harsh 2025 年 1 月 25 日 6:35
how can i generate a complex gaussian noise with zero mean and some variance in matlab?

回答 (1 件)

Harsh
Harsh 2025 年 1 月 25 日 6:35
Hi Jetty,
The randn function in MATLAB generates random numbers drawn from a standard normal distribution (Gaussian distribution) with a mean of 0 and a variance of 1. You can use it to create Gaussian noise and scale it to the desired variance or mean.
Below is an example code to generate a complex gaussian noise with zero mean and specific variance.
N = 1000; % Number of samples
variance = 2; % Variance
% Generate real and imaginary parts of the noise
realPart = sqrt(variance/2) * randn(N, 1); % Gaussian with zero mean and variance/2
imagPart = sqrt(variance/2) * randn(N, 1); % Gaussian with zero mean and variance/2
% Combine to form complex Gaussian noise
complexNoise = realPart + 1j * imagPart;
% Verify properties
disp(['Mean: ', num2str(mean(complexNoise))]);
disp(['Variance: ', num2str(var(complexNoise))]);
Refer to the following documentation to understand more about “randn” function - https://www.mathworks.com/help/matlab/ref/randn.html

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by