<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239088</link>
    <title>MATLAB Central Newsreader - Unique Random Numbers</title>
    <description>Feed for thread: Unique Random Numbers</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Wed, 12 Nov 2008 00:25:03 -0500</pubDate>
      <title>Unique Random Numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239088#610396</link>
      <author>Jarrod </author>
      <description>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:&lt;br&gt;
&lt;br&gt;
N=10;&lt;br&gt;
alpha = [-sqrt(3)/2 -1/2 sqrt(3)/2 1/2];&lt;br&gt;
tx = randsrc(1,N,alpha)+j*randsrc(1,N,alpha);&lt;br&gt;
&lt;br&gt;
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.</description>
    </item>
    <item>
      <pubDate>Wed, 12 Nov 2008 04:26:03 -0500</pubDate>
      <title>Re: Unique Random Numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239088#610417</link>
      <author>Trevis Crane</author>
      <description>A very unelegant way would be to generate your real and imag parts separately&lt;br&gt;
&lt;br&gt;
rl = randsrc(1,N,alpha);&lt;br&gt;
im = randsrc(1,N,alpha);&lt;br&gt;
&lt;br&gt;
and remove the pairs that are identical&lt;br&gt;
&lt;br&gt;
rl(rl == im) = [];&lt;br&gt;
im(rl == im) = [];&lt;br&gt;
&lt;br&gt;
You can repeat this iteratively until you have a total number of N pairsthat  you need and then create your tx:&lt;br&gt;
&lt;br&gt;
tx = rl + j*im;&lt;br&gt;
&lt;br&gt;
just a first idea...&lt;br&gt;
&lt;br&gt;
&quot;Jarrod &quot; &amp;lt;jrmfzf@gmail.com&amp;gt; wrote in message &amp;lt;gfd7ov$46p$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; 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:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; N=10;&lt;br&gt;
&amp;gt; alpha = [-sqrt(3)/2 -1/2 sqrt(3)/2 1/2];&lt;br&gt;
&amp;gt; tx = randsrc(1,N,alpha)+j*randsrc(1,N,alpha);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.</description>
    </item>
    <item>
      <pubDate>Wed, 12 Nov 2008 06:31:02 -0500</pubDate>
      <title>Re: Unique Random Numbers</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/239088#610423</link>
      <author>Roger Stafford</author>
      <description>&quot;Jarrod &quot; &amp;lt;jrmfzf@gmail.com&amp;gt; wrote in message &amp;lt;gfd7ov$46p$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; 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:&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; N=10;&lt;br&gt;
&amp;gt; alpha = [-sqrt(3)/2 -1/2 sqrt(3)/2 1/2];&lt;br&gt;
&amp;gt; tx = randsrc(1,N,alpha)+j*randsrc(1,N,alpha);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; 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.&lt;br&gt;
---------&lt;br&gt;
&amp;nbsp;&amp;nbsp;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.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;In the example you give, you should have:&lt;br&gt;
&lt;br&gt;
&amp;nbsp;alpha = pi/6*[1,2,4,5,7,8,10,11];&lt;br&gt;
&amp;nbsp;tx = exp(randsrc(1,N,alpha)*j); % &amp;lt;-- Where j is sqrt(-1)&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
  </channel>
</rss>

