Skip to content

Instantly share code, notes, and snippets.

@nowls
Created September 10, 2015 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nowls/5b2bc2aada87dc197e3f to your computer and use it in GitHub Desktop.
Save nowls/5b2bc2aada87dc197e3f to your computer and use it in GitHub Desktop.
CPFSK implementation in gr-trellis
diff --git a/gr-trellis/examples/python/test_cpm.py b/gr-trellis/examples/python/test_cpm.py
index 6fe25ec..4790860 100755
--- a/gr-trellis/examples/python/test_cpm.py
+++ b/gr-trellis/examples/python/test_cpm.py
@@ -34,29 +34,29 @@ def run_test(seed,blocksize):
# Variables
##################################################
M = 2
- K = 1
- P = 2
+ K = 25
+ P = 3
h = (1.0*K)/P
- L = 3
+ L = 1
Q = 4
frac = 0.99
f = trellis.fsm(P,M,L)
# CPFSK signals
- #p = numpy.ones(L*Q)
- #q = numpy.cumsum(p)
- #q = q/q[-1]/2.0;
-
- # GMSK signals
- BT=0.3;
- tt=numpy.arange(0,L*Q)/(1.0*Q)-L/2.0;
- #print tt
- p=(0.5*scipy.special.erfc(2*math.pi*BT*(tt-0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0))-0.5*scipy.special.erfc(2*math.pi*BT*(tt+0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0)))/2.0;
- p=p/sum(p)*Q/2.0;
- #print p
- q=numpy.cumsum(p)/Q;
- q=q/q[-1]/2.0;
- #print q
+ p = numpy.ones(L*Q)
+ q = numpy.cumsum(p)
+ q = q/q[-1]/2.0;
+
+# # GMSK signals
+# BT=0.3;
+# tt=numpy.arange(0,L*Q)/(1.0*Q)-L/2.0;
+# #print tt
+# p=(0.5*scipy.special.erfc(2*math.pi*BT*(tt-0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0))-0.5*scipy.special.erfc(2*math.pi*BT*(tt+0.5)/math.sqrt(math.log(2.0))/math.sqrt(2.0)))/2.0;
+# p=p/sum(p)*Q/2.0;
+# #print p
+# q=numpy.cumsum(p)/Q;
+# q=q/q[-1]/2.0;
+# #print q
(f0T,SS,S,F,Sf,Ff,N) = fsm_utils.make_cpm_signals(K,P,M,L,q,frac)
#print N
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment