gaussian white noise with zero mean and 20 db power
조회 수: 6 (최근 30일)
이전 댓글 표시
how to generate gaussian white noise with zero mean and 20 dB power in Matlab
댓글 수: 0
답변 (1개)
Meg Noah
2025년 8월 6일
You also need to define the signal power level to get the order of magnitude.
signalPower = 2; % calculate the signal power from your signal data
nSamples = 1000;
snrDb = 20;
stdNoise = sqrt(signalPower / 10^(snrDb/10));
% generate the gaussian white noise
noiseMean = 0;
noiseValues = stdNoise*randn(nSamples,1) + noiseMean;
% verify the Signal-to-Noise value
noise_power_100_samples = sum(noiseValues.^2)/numel(noiseValues);
SNR = 10*log10(signalPower/noise_power_100_samples);
fprintf(1,"SNR: %f\n", SNR)
figure()
plot(1:nSamples,noiseValues);
ylabel('20dB Gaussian White Noise')
xlabel('Sample Index')
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!