Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Unique Random Numbers
Date: Wed, 12 Nov 2008 06:31:02 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 18
Message-ID: <gfdt76$3d7$1@fred.mathworks.com>
References: <gfd7ov$46p$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1226471462 3495 172.30.248.38 (12 Nov 2008 06:31:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 12 Nov 2008 06:31:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:500347


"Jarrod " <jrmfzf@gmail.com> wrote in message <gfd7ov$46p$1@fred.mathworks.com>...
> I'm creating a random complex signal that consists of a real and imaginary part.  The coefficient of each part comes from a predetermined alphabet.  Providing the code below:
> 
> N=10;
> alpha = [-sqrt(3)/2 -1/2 sqrt(3)/2 1/2];
> tx = randsrc(1,N,alpha)+j*randsrc(1,N,alpha);
> 
> The only problem with this is that I need the real and imaginary parts to always be different.  If you examine my alpha closely, it's points on the unit circle; however the points are only accurate if real does not equal imaginary.  Any suggestions on how to use the same fix this?  Thanks.
---------
  If you want your complex values to lie on some curve in the complex plane such as the unit circle, you should be generating your random values as a single random parameter from which the real and imaginary parts are derived, not from two independent random sources.

  In the example you give, you should have:

 alpha = pi/6*[1,2,4,5,7,8,10,11];
 tx = exp(randsrc(1,N,alpha)*j); % <-- Where j is sqrt(-1)

Roger Stafford