Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Unique Random Numbers
Date: Wed, 12 Nov 2008 04:26:03 +0000 (UTC)
Organization: University of Illinois
Lines: 24
Message-ID: <gfdlsr$ffp$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 1226463963 15865 172.30.248.38 (12 Nov 2008 04:26:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 12 Nov 2008 04:26:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 91506
Xref: news.mathworks.com comp.soft-sys.matlab:500341


A very unelegant way would be to generate your real and imag parts separately

rl = randsrc(1,N,alpha);
im = randsrc(1,N,alpha);

and remove the pairs that are identical

rl(rl == im) = [];
im(rl == im) = [];

You can repeat this iteratively until you have a total number of N pairsthat  you need and then create your tx:

tx = rl + j*im;

just a first idea...

"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.