Use more library functions; generalized to 2^k-PSK
[4yp.git] / randomPSK.m
diff --git a/randomPSK.m b/randomPSK.m
deleted file mode 100644 (file)
index 7521bef..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-function x = randomPSK(n, len)
-  % symbols: nth roots of unity
-  % i.e. solutions to polynomial x^n - 1 = 0
-  symbols = roots([1 zeros(1, n-1) -1]);
-
-  x = zeros(1, len);
-  for i = 1:len
-    x(i) = randomChoice(symbols);
-  end
-end
-
-function x = randomChoice(arr)
-  i = randi(length(arr));
-  x = arr(i);
-end