Complex random variable with unity amplitude and uniform phase distribution?
조회 수: 6 (최근 30일)
이전 댓글 표시
Hi,
I need to add a random phase shift to a vector. What can I use to create a complex random variable with unity amplitude and a uniform phase distribution over [0,2pi)?
Thank you!
댓글 수: 0
채택된 답변
Ameer Hamza
2020년 9월 29일
n = 1000; % generate n complex numbers
mag = 1; % magnitude of complex numbers
phases = rand(1, n)*2*pi; % phases of complex numbers from 0 to 2*pi
[re, im] = pol2cart(phases, mag);
rand_complex = re + im*1i;
댓글 수: 2
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!