diff options
43 files changed, 3059 insertions, 631 deletions
diff --git a/gnuradio-runtime/lib/math/fast_atan2f.cc b/gnuradio-runtime/lib/math/fast_atan2f.cc index 20e21be32b..f968310ff8 100644 --- a/gnuradio-runtime/lib/math/fast_atan2f.cc +++ b/gnuradio-runtime/lib/math/fast_atan2f.cc @@ -31,7 +31,7 @@ namespace gr { #define TAN_MAP_RES 0.003921569 /* (smallest non-zero value in table) */ #define RAD_PER_DEG 0.017453293 - #define TAN_MAP_SIZE 256 + #define TAN_MAP_SIZE 255 /* arctangents from 0 to pi/4 radians */ static float @@ -99,8 +99,8 @@ namespace gr { 7.551044e-01, 7.571798e-01, 7.592472e-01, 7.613064e-01, 7.633576e-01, 7.654008e-01, 7.674360e-01, 7.694633e-01, 7.714826e-01, 7.734940e-01, 7.754975e-01, 7.774932e-01, - 7.794811e-01, 7.814612e-01, 7.834335e-01, 7.853983e-01, - 7.853983e-01 + 7.794811e-01, 7.814612e-01, 7.834335e-01, 7.853982e-01, + 7.853982e-01 }; @@ -118,7 +118,7 @@ namespace gr { determine the final angle value in the range of -180 to 180 degrees. Note that this function uses the small angle approximation for values close to zero. This routine calculates the arc tangent - with an average error of +/- 0.045 degrees. + with an average error of +/- 3.56e-5 degrees (6.21e-7 radians). *****************************************************************************/ float @@ -135,7 +135,6 @@ namespace gr { if(!((y_abs > 0.0f) || (x_abs > 0.0f))) return 0.0; - //z = (y_abs < x_abs ? y_abs / x_abs : x_abs / y_abs); if(y_abs < x_abs) z = y_abs / x_abs; else @@ -147,14 +146,13 @@ namespace gr { base_angle = z; else { /* find index and interpolation value */ - alpha = z * (float)TAN_MAP_SIZE - .5; - index = (int)alpha & 0xff; + alpha = z * (float)TAN_MAP_SIZE; + index = ((int)alpha) & 0xff; alpha -= (float)index; /* determine base angle based on quadrant and */ /* add or subtract table value from base angle based on quadrant */ - base_angle = fast_atan_table[index]; - base_angle += - (fast_atan_table[index + 1] - fast_atan_table[index]) * alpha; + base_angle = fast_atan_table[index]; + base_angle += (fast_atan_table[index + 1] - fast_atan_table[index]) * alpha; } if(x_abs > y_abs) { /* -45 -> 45 or 135 -> 225 */ diff --git a/gnuradio-runtime/lib/math/qa_fast_atan2f.cc b/gnuradio-runtime/lib/math/qa_fast_atan2f.cc index b704756798..154998f79a 100644 --- a/gnuradio-runtime/lib/math/qa_fast_atan2f.cc +++ b/gnuradio-runtime/lib/math/qa_fast_atan2f.cc @@ -47,11 +47,11 @@ qa_fast_atan2f::t1() for(float j =-N/2; i < N/2; i++) { float x = i/10.0; float y = j/10.0; - c_atan2 = atan2(x, y); + c_atan2 = atan2(y, x); - gr_atan2f = gr::fast_atan2f(x, y); + gr_atan2f = gr::fast_atan2f(y, x); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0001); + CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0); } } } @@ -69,71 +69,69 @@ qa_fast_atan2f::t2() /* Test x as INF */ x = inf; y = 0; - c_atan2 = atan2(x, y); - gr_atan2f = gr::fast_atan2f(x, y); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0001); + c_atan2 = atan2(y, x); + gr_atan2f = gr::fast_atan2f(y, x); + CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0); x = -inf; y = 0; - c_atan2 = atan2(x, y); - gr_atan2f = gr::fast_atan2f(x, y); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0001); + c_atan2 = atan2(y, x); + gr_atan2f = gr::fast_atan2f(y, x); + CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0); /* Test y as INF */ x = 0; y = inf; - c_atan2 = atan2(x, y); - gr_atan2f = gr::fast_atan2f(x, y); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0001); + c_atan2 = atan2(y, x); + gr_atan2f = gr::fast_atan2f(y, x); + CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0); x = 0; y = -inf; - c_atan2 = atan2(x, y); - gr_atan2f = gr::fast_atan2f(x, y); - CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0001); + c_atan2 = atan2(y, x); + gr_atan2f = gr::fast_atan2f(y, x); + CPPUNIT_ASSERT_DOUBLES_EQUAL(c_atan2, gr_atan2f, 0.0); /* Test x and y as INF */ x = inf; y = inf; - gr_atan2f = gr::fast_atan2f(x, y); + gr_atan2f = gr::fast_atan2f(y, x); CPPUNIT_ASSERT(isnan(gr_atan2f)); /* Test x as NAN */ x = nan; y = 0; - gr_atan2f = gr::fast_atan2f(x, y); + gr_atan2f = gr::fast_atan2f(y, x); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0f, gr_atan2f, 0.0001); x = -nan; y = 0; - gr_atan2f = gr::fast_atan2f(x, y); + gr_atan2f = gr::fast_atan2f(y, x); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0f, gr_atan2f, 0.0001); /* Test y as NAN */ x = 0; y = nan; - gr_atan2f = gr::fast_atan2f(x, y); + gr_atan2f = gr::fast_atan2f(y, x); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0f, gr_atan2f, 0.0001); x = 0; y = -nan; - gr_atan2f = gr::fast_atan2f(x, y); + gr_atan2f = gr::fast_atan2f(y, x); CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0f, gr_atan2f, 0.0001); - /* Test mixed NAN and INF */ x = inf; y = nan; - gr_atan2f = gr::fast_atan2f(x, y); + gr_atan2f = gr::fast_atan2f(y, x); CPPUNIT_ASSERT(isnan(gr_atan2f)); x = nan; y = inf; - gr_atan2f = gr::fast_atan2f(x, y); + gr_atan2f = gr::fast_atan2f(y, x); CPPUNIT_ASSERT(isnan(gr_atan2f)); } - diff --git a/gnuradio-runtime/lib/vmcircbuf_sysv_shm.cc b/gnuradio-runtime/lib/vmcircbuf_sysv_shm.cc index 27ad4f3829..c3681280d6 100644 --- a/gnuradio-runtime/lib/vmcircbuf_sysv_shm.cc +++ b/gnuradio-runtime/lib/vmcircbuf_sysv_shm.cc @@ -77,7 +77,7 @@ namespace gr { } if((shmid2 = shmget(IPC_PRIVATE, 2 * size + 2 * pagesize, IPC_CREAT | 0700)) == -1) { - perror("gr::vmcircbuf_sysv_shm: shmget(1)"); + perror("gr::vmcircbuf_sysv_shm: shmget (1)"); shmctl(shmid_guard, IPC_RMID, 0); continue; } @@ -91,7 +91,7 @@ namespace gr { void *first_copy = shmat (shmid2, 0, 0); if(first_copy == (void *) -1) { - perror("gr::vmcircbuf_sysv_shm: shmat(1)"); + perror("gr::vmcircbuf_sysv_shm: shmat (1)"); shmctl(shmid_guard, IPC_RMID, 0); shmctl(shmid2, IPC_RMID, 0); shmctl(shmid1, IPC_RMID, 0); @@ -111,7 +111,7 @@ namespace gr { // first read-only guard page if(shmat(shmid_guard, first_copy, SHM_RDONLY) == (void *) -1) { - perror("gr::vmcircbuf_sysv_shm: shmat(2)"); + perror("gr::vmcircbuf_sysv_shm: shmat (2)"); shmctl(shmid_guard, IPC_RMID, 0); shmctl(shmid1, IPC_RMID, 0); continue; @@ -137,7 +137,7 @@ namespace gr { // second read-only guard page if(shmat(shmid_guard, (char*)first_copy + pagesize + 2 * size, SHM_RDONLY) == (void *) -1) { - perror("gr::vmcircbuf_sysv_shm: shmat(5)"); + perror("gr::vmcircbuf_sysv_shm: shmat (5)"); shmctl(shmid_guard, IPC_RMID, 0); shmctl(shmid1, IPC_RMID, 0); shmdt(first_copy); @@ -155,7 +155,7 @@ namespace gr { break; } if(attempts_remain<0){ - throw std::runtime_error("gr_vmcircbuf_sysv_shm"); + throw std::runtime_error("gr::vmcircbuf_sysv_shm"); } #endif } @@ -169,7 +169,7 @@ namespace gr { || shmdt(d_base) == -1 || shmdt(d_base + d_size) == -1 || shmdt(d_base + 2 * d_size) == -1){ - perror("gr::vmcircbuf_sysv_shm: shmdt(2)"); + perror("gr::vmcircbuf_sysv_shm: shmdt (2)"); } #endif } diff --git a/gnuradio-runtime/python/gnuradio/gr/__init__.py b/gnuradio-runtime/python/gnuradio/gr/__init__.py index 4fc55c68b2..9717390e3e 100644 --- a/gnuradio-runtime/python/gnuradio/gr/__init__.py +++ b/gnuradio-runtime/python/gnuradio/gr/__init__.py @@ -50,9 +50,17 @@ from gateway import basic_block, sync_block, decim_block, interp_block prefs = prefs.singleton log = gr.logger("log") -log.add_console_appender(prefs().get_string("LOG", "log_level", "off"), 'gr::log %d :%p: %m%n') log.set_level(prefs().get_string("LOG", "log_level", "notset")) +log_file = gr.prefs().get_string("LOG", "log_file", ""); +if(log_file == "stderr" or log_file == "stdout"): + log.add_console_appender(log_file, "gr::log %d :%p: %m%n") +else: + log.add_file_appender(log_file, True, "%r :%p: %c{1} - %m%n") log_debug = gr.logger("log_debug") -log_debug.add_console_appender(prefs().get_string("LOG", "debug_level", "off"), 'gr::debug %d :%p: %m%n') log_debug.set_level(prefs().get_string("LOG", "debug_level", "notset")) +log_debug_file = gr.prefs().get_string("LOG", "debug_file", ""); +if(log_debug_file == "stderr" or log_file == "stdout"): + log_debug.add_console_appender(log_debug_file, "gr::log %d :%p: %m%n") +else: + log_debug.add_file_appender(log_debug_file, True, "%r :%p: %c{1} - %m%n") diff --git a/gr-analog/python/analog/qa_pll_carriertracking.py b/gr-analog/python/analog/qa_pll_carriertracking.py index d05e49641a..10ad414644 100755 --- a/gr-analog/python/analog/qa_pll_carriertracking.py +++ b/gr-analog/python/analog/qa_pll_carriertracking.py @@ -33,106 +33,106 @@ class test_pll_carriertracking(gr_unittest.TestCase): self.tb = None def test_pll_carriertracking(self): - expected_result = ((1.00000238419+7.21919457547e-09j), - (0.998025715351+0.062790453434j), - (0.992777824402+0.119947694242j), - (0.985192835331+0.171441286802j), - (0.976061582565+0.217501848936j), - (0.966034710407+0.258409559727j), - (0.95565611124+0.294477283955j), - (0.945357382298+0.326030552387j), - (0.935475051403+0.353395611048j), - (0.926258146763+0.376889169216j), - (0.917895197868+0.39681750536j), - (0.910515546799+0.413470208645j), - (0.904196679592+0.427117019892j), - (0.898972511292+0.438006043434j), - (0.894769787788+0.446523308754j), - (0.891652584076+0.452715367079j), - (0.8895829916+0.456773489714j), - (0.888502895832+0.458873122931j), - (0.888343691826+0.459175437689j), - (0.889035582542+0.457833081484j), - (0.890497922897+0.454985737801j), - (0.892645597458+0.450762689114j), - (0.895388305187+0.445282936096j), - (0.898648142815+0.438664674759j), - (0.902342617512+0.431016951799j), - (0.906392872334+0.422441422939j), - (0.910642921925+0.413191765547j), - (0.915039420128+0.403358519077j), - (0.919594764709+0.392864197493j), - (0.92425006628+0.381792247295j), - (0.928944349289+0.370217680931j), - (0.933634519577+0.358220815659j), - (0.938279032707+0.345874190331j), - (0.942840516567+0.333247303963j), - (0.947280526161+0.32040438056j), - (0.951574921608+0.307409763336j), - (0.955703914165+0.294323593378j), - (0.959648966789+0.281201630831j), - (0.963392794132+0.268095195293j), - (0.966880619526+0.255221515894j), - (0.970162451267+0.242447137833j), - (0.973235487938+0.229809194803j), - (0.97609680891+0.217341512442j), - (0.978744983673+0.20507311821j), - (0.981189727783+0.193033605814j), - (0.983436584473+0.181248426437j), - (0.985490739346+0.169738590717j), - (0.987353682518+0.158523857594j), - (0.989041447639+0.147622272372j), - (0.990563035011+0.137049794197j), - (0.991928339005+0.126818582416j), - (0.993117690086+0.117111675441j), - (0.994156062603+0.107930034399j), - (0.995076179504+0.0990980416536j), - (0.995887458324+0.0906178802252j), - (0.996591091156+0.0824909061193j), - (0.997202515602+0.0747182965279j), - (0.997730851173+0.0672992765903j), - (0.998185396194+0.0602316558361j), - (0.99856698513+0.0535135567188j), - (0.998885989189+0.0471420884132j), - (0.99915266037+0.0411129891872j), - (0.999372899532+0.0354214012623j), - (0.999548316002+0.0300626158714j), - (0.999680638313+0.0252036750317j), - (0.999784469604+0.020652115345j), - (0.999865531921+0.0163950324059j), - (0.999923825264+0.0124222636223j), - (0.999960243702+0.00872156023979j), - (0.999983668327+0.00528120994568j), - (0.999997138977+0.00209015607834j), - (1.00000119209-0.00086285173893j), - (0.999992132187-0.00358882546425j), - (0.999979138374-0.00609711557627j), - (0.999963641167-0.00839691981673j), - (0.999947249889-0.0104993218556j), - (0.999924004078-0.0122378543019j), - (0.999904811382-0.0136305987835j), - (0.999888062477-0.0148707330227j), - (0.9998742342-0.0159679055214j), - (0.999856114388-0.0169314742088j), - (0.999839782715-0.0177700817585j), - (0.999826967716-0.0184917747974j), - (0.999818325043-0.0191045701504j), - (0.999807476997-0.0196143388748j), - (0.999797284603-0.0200265944004j), - (0.999791204929-0.0203481912613j), - (0.99978852272-0.0205836892128j), - (0.99978530407-0.0207380950451j), - (0.999785065651-0.0206423997879j), - (0.999787807465-0.0204866230488j), - (0.999794304371-0.0202808082104j), - (0.999800384045-0.0200312435627j), - (0.999803245068-0.0197458267212j), - (0.9998087883-0.0194311738014j), - (0.999816894531-0.0190933048725j), - (0.999825954437-0.0187371373177j), - (0.999829888344-0.0183679759502j), - (0.999835848808-0.017987690866j), - (0.999844014645-0.0176006518304j)) + expected_result = ((1.000002384185791+7.219194575469601e-09j), + (0.9980257153511047+0.06279045343399048j), + (0.992796003818512+0.11979719996452332j), + (0.9852395057678223+0.17117266356945038j), + (0.9761406779289246+0.2171468883752823j), + (0.9661445617675781+0.25799843668937683j), + (0.9557913541793823+0.29403796792030334j), + (0.9455097317695618+0.3255884349346161j), + (0.935634434223175+0.35297322273254395j), + (0.9264140129089355+0.37650591135025024j), + (0.918036699295044+0.3964899182319641j), + (0.9106329679489136+0.4132115840911865j), + (0.9042812585830688+0.42693787813186646j), + (0.899017333984375+0.4379141628742218j), + (0.89484703540802+0.4463684558868408j), + (0.891755223274231+0.45251286029815674j), + (0.8897027969360352+0.4565400779247284j), + (0.8886303901672363+0.45862627029418945j), + (0.8884686827659607+0.4589335024356842j), + (0.8891477584838867+0.4576151967048645j), + (0.8905870318412781+0.4548112750053406j), + (0.8927018642425537+0.4506511092185974j), + (0.8954030275344849+0.4452534019947052j), + (0.898613452911377+0.43873584270477295j), + (0.9022520780563354+0.4312065541744232j), + (0.9062415361404419+0.42276597023010254j), + (0.9104995131492615+0.4135076403617859j), + (0.9149653315544128+0.4035266935825348j), + (0.9195748567581177+0.3929111361503601j), + (0.9242699146270752+0.3817441761493683j), + (0.9289909601211548+0.37010061740875244j), + (0.9336962103843689+0.3580598831176758j), + (0.9383456707000732+0.3456934690475464j), + (0.9429033994674683+0.3330692648887634j), + (0.9473329186439514+0.3202497363090515j), + (0.9516113996505737+0.3072968125343323j), + (0.9557210206985474+0.2942683696746826j), + (0.9596443772315979+0.2812172472476959j), + (0.963365912437439+0.2681918740272522j), + (0.9668760299682617+0.2552390694618225j), + (0.9701738357543945+0.24240154027938843j), + (0.9732568264007568+0.22971850633621216j), + (0.9761228561401367+0.21722495555877686j), + (0.9787704944610596+0.20495179295539856j), + (0.9812103509902954+0.1929289996623993j), + (0.98344886302948+0.18118229508399963j), + (0.9854917526245117+0.1697331666946411j), + (0.9873413443565369+0.1586003601551056j), + (0.989014744758606+0.147801473736763j), + (0.9905213713645935+0.1373506784439087j), + (0.9918720126152039+0.12725868821144104j), + (0.9930678606033325+0.1175333634018898j), + (0.9941287040710449+0.10818269848823547j), + (0.9950648546218872+0.0992119163274765j), + (0.995887041091919+0.09062285721302032j), + (0.9965973496437073+0.08241605758666992j), + (0.9972119927406311+0.07459107041358948j), + (0.997741162776947+0.06714606285095215j), + (0.9981945753097534+0.06007742881774902j), + (0.9985741376876831+0.05337977409362793j), + (0.9988903999328613+0.04704824090003967j), + (0.9991542100906372+0.04107558727264404j), + (0.9993717074394226+0.03545379638671875j), + (0.9995449185371399+0.03017553687095642j), + (0.9996798634529114+0.025230854749679565j), + (0.999785304069519+0.02061113715171814j), + (0.9998669624328613+0.01630493998527527j), + (0.9999253749847412+0.012303531169891357j), + (0.999961256980896+0.008596181869506836j), + (0.9999842047691345+0.005170613527297974j), + (0.9999972581863403+0.0020167529582977295j), + (1.0000011920928955-0.0008766651153564453j), + (0.9999923706054688-0.0035211145877838135j), + (0.999980092048645-0.00592736154794693j), + (0.9999660849571228-0.008106544613838196j), + (0.9999516606330872-0.010069712996482849j), + (0.9999289512634277-0.011828280985355377j), + (0.9999079704284668-0.013392657041549683j), + (0.9998894333839417-0.01477348804473877j), + (0.9998739957809448-0.015980780124664307j), + (0.9998545050621033-0.017024904489517212j), + (0.9998371601104736-0.017916440963745117j), + (0.9998237490653992-0.01866436004638672j), + (0.999815046787262-0.01927858591079712j), + (0.9998044967651367-0.019767403602600098j), + (0.9997949600219727-0.020140081644058228j), + (0.9997900128364563-0.020405471324920654j), + (0.9997888207435608-0.020570307970046997j), + (0.9997872114181519-0.020643681287765503j), + (0.9997851848602295-0.020633310079574585j), + (0.9997866153717041-0.020545780658721924j), + (0.9997920989990234-0.020388543605804443j), + (0.9997975826263428-0.02016708254814148j), + (0.9998003840446472-0.019888341426849365j), + (0.99980628490448-0.019558459520339966j), + (0.9998152256011963-0.019182950258255005j), + (0.9998254179954529-0.01876668632030487j), + (0.9998309016227722-0.01831553876399994j), + (0.999838650226593-0.017833217978477478j), + (0.9998488426208496-0.017324130982160568j)) sampling_freq = 10e3 freq = sampling_freq / 100 diff --git a/gr-analog/python/analog/qa_pll_freqdet.py b/gr-analog/python/analog/qa_pll_freqdet.py index 0166a40258..c7a8aa8363 100755 --- a/gr-analog/python/analog/qa_pll_freqdet.py +++ b/gr-analog/python/analog/qa_pll_freqdet.py @@ -34,105 +34,105 @@ class test_pll_freqdet(gr_unittest.TestCase): def test_pll_freqdet(self): expected_result = (0.0, - 4.33888922882e-08, - 0.367369994515, - 1.08135249597, - 2.10983253908, - 3.42221529438, - 4.98940390402, - 6.78379190842, - 8.77923286024, - 10.9510106794, - 13.2758363182, - 15.7317829127, - 18.2982902299, - 20.9561068599, - 23.6755271122, - 26.452952094, - 29.2731265301, - 32.1219053479, - 34.9862418188, - 37.8540971414, - 40.7144315483, - 43.5571390869, - 46.3730179743, - 49.1537231663, - 51.8917218889, - 54.58026103, - 57.2015358514, - 59.7513664199, - 62.2380533124, - 64.657612252, - 67.006640002, - 69.2822432184, - 71.4820384499, - 73.6041047056, - 75.6469478817, - 77.6094829742, - 79.4909866472, - 81.2911031615, - 83.0097850853, - 84.6355598352, - 86.1820937186, - 87.6504420946, - 89.0418441206, - 90.3577286819, - 91.5996432431, - 92.7692775646, - 93.8684162704, - 94.8989269904, - 95.8627662892, - 96.7619381633, - 97.598505899, - 98.362769679, - 99.0579904444, - 99.6992633875, - 100.288805948, - 100.828805921, - 101.321421457, - 101.76878699, - 102.17300138, - 102.536116055, - 102.860158727, - 103.147085962, - 103.398830608, - 103.617254366, - 103.792467691, - 103.939387906, - 104.060030865, - 104.15631756, - 104.230085975, - 104.283067372, - 104.316933727, - 104.333238432, - 104.333440018, - 104.318914008, - 104.290941063, - 104.250742554, - 104.187634452, - 104.103822339, - 104.013227468, - 103.916810336, - 103.815448432, - 103.709936239, - 103.600997093, - 103.489283183, - 103.375351833, - 103.259712936, - 103.142828952, - 103.025091195, - 102.90686726, - 102.776726069, - 102.648078982, - 102.521459607, - 102.397294831, - 102.275999684, - 102.157882471, - 102.043215927, - 101.93218978, - 101.824958181, - 101.72159228, - 101.622151366) + 4.338889228818161e-08, + 0.3776331578612825, + 1.0993741049896133, + 2.1332509128284287, + 3.448827166947317, + 5.017193050406445, + 6.810936277840595, + 8.804128662605573, + 10.972292025122194, + 13.292363360097312, + 15.742678902380248, + 18.302902979158944, + 20.954030233328815, + 23.678333003762834, + 26.459293141999492, + 29.2815901542755, + 32.13105969864019, + 34.99462836613535, + 37.860284035876894, + 40.71702547869386, + 43.5548208542428, + 46.364569172614004, + 49.138038040003174, + 51.86783994277676, + 54.547378886619114, + 57.17080592915505, + 59.73298657053974, + 62.229444428114014, + 64.65634937843706, + 67.01044048049889, + 69.28902004673668, + 71.48990028218192, + 73.61137363954212, + 75.65217724529884, + 77.61146325478951, + 79.48876920728905, + 81.28396466515709, + 82.9972452848542, + 84.62912095897468, + 86.18033873945902, + 87.65188876657749, + 89.0449983399466, + 90.36106669970881, + 91.6016768844999, + 92.76854829957963, + 93.86354857479924, + 94.88865206171563, + 95.84592204664062, + 96.73751075064077, + 97.56564154258655, + 98.33257336525031, + 99.04061259327368, + 99.69208931723288, + 100.28935141465512, + 100.83475862103487, + 101.33065881389933, + 101.77937615484109, + 102.18323480545271, + 102.54452335342484, + 102.8654948125462, + 103.14836662270359, + 103.39530879191456, + 103.6084320383601, + 103.78982336428665, + 103.94148676616939, + 104.06536695064705, + 104.16337305045634, + 104.23733119256288, + 104.28900821409572, + 104.32008794641274, + 104.33220678900258, + 104.32694185151738, + 104.30578723783803, + 104.27016590404165, + 104.22144151636876, + 104.16091845122337, + 104.08982993720561, + 104.00932619714447, + 103.9205337379343, + 103.82447234476369, + 103.72213808688659, + 103.6144440277858, + 103.50225579907487, + 103.38636788456353, + 103.26755105212685, + 103.14649306386876, + 103.02383425002395, + 102.90019122489248, + 102.7761213129379, + 102.65211069081985, + 102.5286218192634, + 102.40608158509168, + 102.28486944325857, + 102.16532927481605, + 102.04778124488143, + 101.93248622873554, + 101.81969324369186, + 101.70961573316195, + 101.60243156665544) sampling_freq = 10e3 freq = sampling_freq / 100 diff --git a/gr-analog/python/analog/qa_pll_refout.py b/gr-analog/python/analog/qa_pll_refout.py index f85a027aa3..835b6a4522 100755 --- a/gr-analog/python/analog/qa_pll_refout.py +++ b/gr-analog/python/analog/qa_pll_refout.py @@ -34,105 +34,105 @@ class test_pll_refout(gr_unittest.TestCase): def test_pll_refout(self): expected_result = ((1+0j), - (1+6.4087357643e-10j), - (0.999985277653+0.00542619498447j), - (0.999868750572+0.0162021834403j), - (0.99948567152+0.0320679470897j), - (0.99860727787+0.0527590736747j), - (0.996953129768+0.0780025869608j), - (0.994203746319+0.107512556016j), - (0.990011692047+0.140985429287j), - (0.984013140202+0.178095817566j), - (0.975838363171+0.218493551016j), - (0.965121984482+0.261800557375j), - (0.95151245594+0.307610183954j), - (0.934681296349+0.355486690998j), - (0.914401650429+0.404808044434j), - (0.890356600285+0.455263823271j), - (0.862329125404+0.506348133087j), - (0.830152392387+0.557536482811j), - (0.793714106083+0.608290970325j), - (0.752960026264+0.658066213131j), - (0.707896590233+0.706316053867j), - (0.658591926098+0.752500295639j), - (0.605175673962+0.796091973782j), - (0.547837555408+0.836584687233j), - (0.48682525754+0.873499393463j), - (0.42244040966+0.906390726566j), - (0.355197101831+0.934791445732j), - (0.285494059324+0.958380460739j), - (0.213591173291+0.976923108101j), - (0.139945343137+0.990159213543j), - (0.065038472414+0.997882783413j), - (-0.0106285437942+0.999943494797j), - (-0.0865436866879+0.996248066425j), - (-0.162189796567+0.986759603024j), - (-0.23705175519+0.971496999264j), - (-0.310622543097+0.950533330441j), - (-0.38240903616+0.923993110657j), - (-0.451937526464+0.89204955101j), - (-0.518758952618+0.854920566082j), - (-0.582311093807+0.812966048717j), - (-0.642372369766+0.76639264822j), - (-0.698591887951+0.715520322323j), - (-0.750654160976+0.660695314407j), - (-0.798280358315+0.602286040783j), - (-0.841228663921+0.540679454803j), - (-0.87929558754+0.476276367903j), - (-0.912315964699+0.409486919641j), - (-0.940161883831+0.340728074312j), - (-0.962742805481+0.270418733358j), - (-0.980004072189+0.198977485299j), - (-0.991925954819+0.126818284392j), - (-0.99851256609+0.0545223206282j), - (-0.999846458435-0.0175215266645j), - (-0.996021270752-0.0891158208251j), - (-0.987133920193-0.159895718098j), - (-0.973306238651-0.2295101583j), - (-0.954683184624-0.297624111176j), - (-0.931430280209-0.363919824362j), - (-0.903732538223-0.428097635508j), - (-0.871792256832-0.489875763655j), - (-0.835827112198-0.548992812634j), - (-0.796068251133-0.605206847191j), - (-0.752758979797-0.658296227455j), - (-0.706152498722-0.70805978775j), - (-0.656641483307-0.754202902317j), - (-0.604367733002-0.79670548439j), - (-0.549597978592-0.835429251194j), - (-0.492602348328-0.870254516602j), - (-0.433654457331-0.901079237461j), - (-0.373029649258-0.927819430828j), - (-0.31100410223-0.950408577919j), - (-0.247853919864-0.968797445297j), - (-0.183855071664-0.982953369617j), - (-0.119282215834-0.992860376835j), - (-0.0544078871608-0.998518764973j), - (0.0104992967099-0.999944865704j), - (0.0749994292855-0.997183561325j), - (0.138844624162-0.990314185619j), - (0.201967850327-0.979392170906j), - (0.264124274254-0.964488625526j), - (0.325075358152-0.945688128471j), - (0.3845885396-0.92308807373j), - (0.442438393831-0.89679890871j), - (0.498407125473-0.866943061352j), - (0.552284479141-0.833655714989j), - (0.603869199753-0.797083437443j), - (0.652970373631-0.757383465767j), - (0.69940674305-0.714723825455j), - (0.743007957935-0.66928255558j), - (0.78350687027-0.62138313055j), - (0.820889055729-0.571087777615j), - (0.855021059513-0.51859331131j), - (0.885780930519-0.46410369873j), - (0.913058102131-0.407829582691j), - (0.936754107475-0.349988251925j), - (0.956783294678-0.290801793337j), - (0.973072886467-0.230497643352j), - (0.985563337803-0.169307261705j), - (0.9942086339-0.1074674353j), - (0.9989772439-0.0452152714133j)) + (1+6.408735764296125e-10j), + (0.9999844431877136+0.005577784031629562j), + (0.9998642802238464+0.016474783420562744j), + (0.9994739890098572+0.032431427389383316j), + (0.9985847473144531+0.05318402871489525j), + (0.996917188167572+0.07846084982156754j), + (0.9941533207893372+0.10797744989395142j), + (0.9899479150772095+0.14143235981464386j), + (0.9839394092559814+0.1785029172897339j), + (0.9757603406906128+0.2188417762517929j), + (0.9650475978851318+0.26207470893859863j), + (0.9514514803886414+0.30779871344566345j), + (0.9346449971199036+0.35558223724365234j), + (0.9143316149711609+0.40496626496315j), + (0.8902531862258911+0.4554659426212311j), + (0.8621962666511536+0.5065743923187256j), + (0.8299974799156189+0.5577671527862549j), + (0.7935484647750854+0.6085070967674255j), + (0.7527987360954285+0.6582507491111755j), + (0.7077582478523254+0.7064547538757324j), + (0.6584978699684143+0.7525825500488281j), + (0.6051493883132935+0.7961119413375854j), + (0.547903835773468+0.8365413546562195j), + (0.48700881004333496+0.8733970522880554j), + (0.42276495695114136+0.90623939037323j), + (0.35552138090133667+0.9346681237220764j), + (0.2856702208518982+0.9583280086517334j), + (0.21364101767539978+0.976912260055542j), + (0.13989387452602386+0.9901664853096008j), + (0.06491273641586304+0.9978909492492676j), + (-0.01080091018229723+0.9999416470527649j), + (-0.08673560619354248+0.9962313771247864j), + (-0.16237612068653107+0.9867289662361145j), + (-0.23721040785312653+0.9714583158493042j), + (-0.3107353150844574+0.95049649477005j), + (-0.3824624717235565+0.9239710569381714j), + (-0.45192304253578186+0.892056941986084j), + (-0.5186731219291687+0.8549726009368896j), + (-0.5822963714599609+0.812976598739624j), + (-0.6424083709716797+0.7663624882698059j), + (-0.6986585855484009+0.7154552340507507j), + (-0.7507330775260925+0.6606056690216064j), + (-0.7983550429344177+0.6021870970726013j), + (-0.841286301612854+0.5405898094177246j), + (-0.879327654838562+0.47621726989746094j), + (-0.912318229675293+0.4094819128513336j), + (-0.9401354789733887+0.340800940990448j), + (-0.9626938104629517+0.27059316635131836j), + (-0.979943573474884+0.1992751508951187j), + (-0.9918696284294128+0.12725839018821716j), + (-0.9984893202781677+0.054946307092905045j), + (-0.9998509287834167-0.017267409712076187j), + (-0.9960314631462097-0.08900183439254761j), + (-0.9871346950531006-0.1598907858133316j), + (-0.9732890129089355-0.2295832633972168j), + (-0.9546451568603516-0.29774588346481323j), + (-0.9313743710517883-0.3640628457069397j), + (-0.9036663174629211-0.42823725938796997j), + (-0.8717266321182251-0.48999255895614624j), + (-0.8357754945755005-0.5490713119506836j), + (-0.7960456013679504-0.6052366495132446j), + (-0.7527803182601929-0.658271849155426j), + (-0.706232488155365-0.7079799771308899j), + (-0.6566619873046875-0.7541850209236145j), + (-0.6043350696563721-0.7967302799224854j), + (-0.5495226979255676-0.8354787826538086j), + (-0.4924990236759186-0.8703129887580872j), + (-0.4335414469242096-0.9011335968971252j), + (-0.3729270100593567-0.927860677242279j), + (-0.3109343349933624-0.9504314064979553j), + (-0.2478405237197876-0.9688008427619934j), + (-0.18392162024974823-0.9829409122467041j), + (-0.11945075541734695-0.9928401112556458j), + (-0.05469784513115883-0.9985029697418213j), + (0.010069688782095909-0.9999492764472961j), + (0.07459097355604172-0.9972141981124878j), + (0.13860897719860077-0.9903472065925598j), + (0.2018725872039795-0.979411780834198j), + (0.2641367018222809-0.964485228061676j), + (0.32516375184059143-0.9456577301025391j), + (0.3847236633300781-0.9230318069458008j), + (0.44259318709373474-0.8967224955558777j), + (0.49855801463127136-0.8668563365936279j), + (0.5524120926856995-0.8335711359977722j), + (0.6039596796035767-0.7970148921012878j), + (0.6530137062072754-0.7573460936546326j), + (0.6993972063064575-0.7147331833839417j), + (0.7429447770118713-0.6693527102470398j), + (0.7835012078285217-0.6213902235031128j), + (0.8209227919578552-0.5710391998291016j), + (0.8550769090652466-0.5185011625289917j), + (0.8858439326286316-0.46398329734802246j), + (0.9131162166595459-0.4076994061470032j), + (0.936798632144928-0.3498689830303192j), + (0.956809401512146-0.2907160222530365j), + (0.9730796813964844-0.23046888411045074j), + (0.9855544567108154-0.16935895383358002j), + (0.9941920042037964-0.10762103646993637j), + (0.9989647269248962-0.045491550117731094j)) sampling_freq = 10e3 freq = sampling_freq / 100 diff --git a/gr-blocks/python/blocks/qa_udp_source_sink.py b/gr-blocks/python/blocks/qa_udp_source_sink.py index a8dcdef5ea..905b9e08a0 100644 --- a/gr-blocks/python/blocks/qa_udp_source_sink.py +++ b/gr-blocks/python/blocks/qa_udp_source_sink.py @@ -89,7 +89,7 @@ class test_udp_sink_source(gr_unittest.TestCase): rcv_port = udp_rcv.get_port() udp_snd = blocks.udp_sink(gr.sizeof_float, '127.0.0.1', port) - udp_snd.connect('localhost', rcv_port) + udp_snd.connect('127.0.0.1', rcv_port) n_data = 16 src_data = [float(x) for x in range(n_data)] diff --git a/gr-digital/examples/CMakeLists.txt b/gr-digital/examples/CMakeLists.txt index 2ece0692c2..8faad96708 100644 --- a/gr-digital/examples/CMakeLists.txt +++ b/gr-digital/examples/CMakeLists.txt @@ -73,12 +73,13 @@ install( # DEMOD install( FILES + demod/constellation_soft_decoder.grc demod/digital_freq_lock.grc demod/mpsk_demod.grc demod/pam_sync.grc demod/pam_timing.grc demod/ber_simulation.grc - demod/dpsk_loopback.grc + demod/dpsk_loopback.grc demod/gfsk_loopback.grc demod/test_corr_and_sync.grc demod/uhd_corr_and_sync_tx.grc diff --git a/gr-digital/examples/demod/constellation_soft_decoder.grc b/gr-digital/examples/demod/constellation_soft_decoder.grc new file mode 100644 index 0000000000..25a99c99ad --- /dev/null +++ b/gr-digital/examples/demod/constellation_soft_decoder.grc @@ -0,0 +1,2242 @@ +<?xml version='1.0' encoding='ASCII'?> +<?grc format='1' created='3.7.5'?> +<flow_graph> + <timestamp>Wed Dec 3 19:11:18 2014</timestamp> + <block> + <key>options</key> + <param> + <key>id</key> + <value>constellation_soft_decoder</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>title</key> + <value>Soft Decoder Example</value> + </param> + <param> + <key>author</key> + <value>Tom Rondeau</value> + </param> + <param> + <key>description</key> + <value>Explore Soft Decoding of constellations. Selec the constellation from the available objects.</value> + </param> + <param> + <key>window_size</key> + <value>2000, 2000</value> + </param> + <param> + <key>generate_options</key> + <value>qt_gui</value> + </param> + <param> + <key>category</key> + <value>Custom</value> + </param> + <param> + <key>run_options</key> + <value>prompt</value> + </param> + <param> + <key>run</key> + <value>True</value> + </param> + <param> + <key>max_nouts</key> + <value>0</value> + </param> + <param> + <key>realtime_scheduling</key> + <value></value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(10, 10)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>samp_rate</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>100000</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(312, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>rrc_taps</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>firdes.root_raised_cosine(nfilts, nfilts, 1.0/float(sps), 0.35, 11*sps*nfilts)</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(288, 347)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>arity</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>4</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(173, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>sps</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>4</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(239, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable</key> + <param> + <key>id</key> + <value>nfilts</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>value</key> + <value>32</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(216, 347)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>import</key> + <param> + <key>id</key> + <value>import_math</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>import</key> + <value>import math</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(400, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>import</key> + <param> + <key>id</key> + <value>import_cmath</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>import</key> + <value>import cmath</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(488, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_pfb_clock_sync_xxx</key> + <param> + <key>id</key> + <value>digital_pfb_clock_sync_xxx_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>ccf</value> + </param> + <param> + <key>sps</key> + <value>sps</value> + </param> + <param> + <key>loop_bw</key> + <value>6.28/100.0</value> + </param> + <param> + <key>taps</key> + <value>rrc_taps</value> + </param> + <param> + <key>filter_size</key> + <value>nfilts</value> + </param> + <param> + <key>init_phase</key> + <value>nfilts/2</value> + </param> + <param> + <key>max_dev</key> + <value>1.5</value> + </param> + <param> + <key>osps</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(240, 203)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_binary_slicer_fb</key> + <param> + <key>id</key> + <value>digital_binary_slicer_fb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(736, 208)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(752, 267)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_constellation_soft_decoder_cf</key> + <param> + <key>id</key> + <value>digital_constellation_soft_decoder_cf_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>constellation</key> + <value>constel</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(504, 203)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(880, 203)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_unpack_k_bits_bb</key> + <param> + <key>id</key> + <value>blocks_unpack_k_bits_bb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>constel.bits_per_symbol()</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(576, 267)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>channels_channel_model</key> + <param> + <key>id</key> + <value>channels_channel_model_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>noise_voltage</key> + <value>noise_volt</value> + </param> + <param> + <key>freq_offset</key> + <value>0.0</value> + </param> + <param> + <key>epsilon</key> + <value>1.0</value> + </param> + <param> + <key>taps</key> + <value>1.0</value> + </param> + <param> + <key>seed</key> + <value>0</value> + </param> + <param> + <key>block_tags</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(496, 67)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_constellation_modulator</key> + <param> + <key>id</key> + <value>digital_constellation_modulator_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>constellation</key> + <value>constel</value> + </param> + <param> + <key>differential</key> + <value>False</value> + </param> + <param> + <key>samples_per_symbol</key> + <value>sps</value> + </param> + <param> + <key>excess_bw</key> + <value>0.35</value> + </param> + <param> + <key>verbose</key> + <value>False</value> + </param> + <param> + <key>log</key> + <value>False</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(240, 75)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_unpack_k_bits_bb</key> + <param> + <key>id</key> + <value>blocks_unpack_k_bits_bb_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>k</key> + <value>8</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(224, 427)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_qtgui_chooser</key> + <param> + <key>id</key> + <value>delay</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Delay</value> + </param> + <param> + <key>type</key> + <value>int</value> + </param> + <param> + <key>num_opts</key> + <value>3</value> + </param> + <param> + <key>value</key> + <value>29</value> + </param> + <param> + <key>options</key> + <value>[0, 1, 2]</value> + </param> + <param> + <key>labels</key> + <value>[]</value> + </param> + <param> + <key>option0</key> + <value>29</value> + </param> + <param> + <key>label0</key> + <value>BPSK</value> + </param> + <param> + <key>option1</key> + <value>58</value> + </param> + <param> + <key>label1</key> + <value>QPSK</value> + </param> + <param> + <key>option2</key> + <value>116</value> + </param> + <param> + <key>label2</key> + <value>QAM16</value> + </param> + <param> + <key>option3</key> + <value>3</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>option4</key> + <value>4</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>widget</key> + <value>combo_box</value> + </param> + <param> + <key>orient</key> + <value>Qt.QVBoxLayout</value> + </param> + <param> + <key>gui_hint</key> + <value>0,1,1,1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1112, 11)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_constellation</key> + <param> + <key>id</key> + <value>constel</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>sym_map</key> + <value>digital.psk_4()[1]</value> + </param> + <param> + <key>const_points</key> + <value>digital.psk_4()[0]</value> + </param> + <param> + <key>rot_sym</key> + <value>4</value> + </param> + <param> + <key>dims</key> + <value>1</value> + </param> + <param> + <key>precision</key> + <value>8</value> + </param> + <param> + <key>soft_dec_lut</key> + <value>'auto'</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(184, 547)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_constellation</key> + <param> + <key>id</key> + <value>constel</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>sym_map</key> + <value>digital.psk_2()[1]</value> + </param> + <param> + <key>const_points</key> + <value>digital.psk_2()[0]</value> + </param> + <param> + <key>rot_sym</key> + <value>4</value> + </param> + <param> + <key>dims</key> + <value>1</value> + </param> + <param> + <key>precision</key> + <value>8</value> + </param> + <param> + <key>soft_dec_lut</key> + <value>'auto'</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(352, 547)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_time_sink_x</key> + <param> + <key>id</key> + <value>qtgui_time_sink_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>float</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>ylabel</key> + <value>Amplitude</value> + </param> + <param> + <key>yunit</key> + <value>""</value> + </param> + <param> + <key>size</key> + <value>500</value> + </param> + <param> + <key>srate</key> + <value>samp_rate</value> + </param> + <param> + <key>grid</key> + <value>False</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-1</value> + </param> + <param> + <key>ymax</key> + <value>2</value> + </param> + <param> + <key>nconnections</key> + <value>3</value> + </param> + <param> + <key>update_time</key> + <value>0.05</value> + </param> + <param> + <key>entags</key> + <value>True</value> + </param> + <param> + <key>gui_hint</key> + <value>1,1,1,1</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_delay</key> + <value>0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value>Soft</value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>1</value> + </param> + <param> + <key>marker1</key> + <value>-1</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value>Hard</value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>1</value> + </param> + <param> + <key>marker2</key> + <value>-1</value> + </param> + <param> + <key>alpha2</key> + <value>1.0</value> + </param> + <param> + <key>label3</key> + <value>Orig</value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"green"</value> + </param> + <param> + <key>style3</key> + <value>1</value> + </param> + <param> + <key>marker3</key> + <value>-1</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"black"</value> + </param> + <param> + <key>style4</key> + <value>1</value> + </param> + <param> + <key>marker4</key> + <value>-1</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"cyan"</value> + </param> + <param> + <key>style5</key> + <value>1</value> + </param> + <param> + <key>marker5</key> + <value>-1</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"magenta"</value> + </param> + <param> + <key>style6</key> + <value>1</value> + </param> + <param> + <key>marker6</key> + <value>-1</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"yellow"</value> + </param> + <param> + <key>style7</key> + <value>1</value> + </param> + <param> + <key>marker7</key> + <value>-1</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"dark red"</value> + </param> + <param> + <key>style8</key> + <value>1</value> + </param> + <param> + <key>marker8</key> + <value>-1</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"dark green"</value> + </param> + <param> + <key>style9</key> + <value>1</value> + </param> + <param> + <key>marker9</key> + <value>-1</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"blue"</value> + </param> + <param> + <key>style10</key> + <value>1</value> + </param> + <param> + <key>marker10</key> + <value>-1</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1072, 240)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_constellation</key> + <param> + <key>id</key> + <value>constel</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>sym_map</key> + <value>digital.psk_2()[1]</value> + </param> + <param> + <key>const_points</key> + <value>digital.psk_2()[0]</value> + </param> + <param> + <key>rot_sym</key> + <value>4</value> + </param> + <param> + <key>dims</key> + <value>1</value> + </param> + <param> + <key>precision</key> + <value>8</value> + </param> + <param> + <key>soft_dec_lut</key> + <value>digital.soft_dec_table_generator(digital.sd_psk_2, 8, 1)</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(1008, 547)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_constellation</key> + <param> + <key>id</key> + <value>constel</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>sym_map</key> + <value>digital.psk_4()[1]</value> + </param> + <param> + <key>const_points</key> + <value>digital.psk_4()[0]</value> + </param> + <param> + <key>rot_sym</key> + <value>4</value> + </param> + <param> + <key>dims</key> + <value>1</value> + </param> + <param> + <key>precision</key> + <value>8</value> + </param> + <param> + <key>soft_dec_lut</key> + <value>digital.soft_dec_table_generator(digital.sd_psk_4, 8, 1)</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(840, 547)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_constellation</key> + <param> + <key>id</key> + <value>constel</value> + </param> + <param> + <key>_enabled</key> + <value>False</value> + </param> + <param> + <key>sym_map</key> + <value>digital.qam_16()[1]</value> + </param> + <param> + <key>const_points</key> + <value>digital.qam_16()[0]</value> + </param> + <param> + <key>rot_sym</key> + <value>4</value> + </param> + <param> + <key>dims</key> + <value>1</value> + </param> + <param> + <key>precision</key> + <value>8</value> + </param> + <param> + <key>soft_dec_lut</key> + <value>digital.soft_dec_table_generator(digital.sd_qam_16, 8, 1)</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(664, 547)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_constellation</key> + <param> + <key>id</key> + <value>constel</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>sym_map</key> + <value>digital.qam_16()[1]</value> + </param> + <param> + <key>const_points</key> + <value>digital.qam_16()[0]</value> + </param> + <param> + <key>rot_sym</key> + <value>4</value> + </param> + <param> + <key>dims</key> + <value>1</value> + </param> + <param> + <key>precision</key> + <value>8</value> + </param> + <param> + <key>soft_dec_lut</key> + <value>'auto'</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(8, 547)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>note</key> + <param> + <key>id</key> + <value>note_py</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>note</key> + <value>Python-generated LUT</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(664, 499)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>qtgui_const_sink_x</key> + <param> + <key>id</key> + <value>qtgui_const_sink_x_1</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>complex</value> + </param> + <param> + <key>name</key> + <value></value> + </param> + <param> + <key>size</key> + <value>1024</value> + </param> + <param> + <key>grid</key> + <value>False</value> + </param> + <param> + <key>autoscale</key> + <value>False</value> + </param> + <param> + <key>ymin</key> + <value>-2</value> + </param> + <param> + <key>ymax</key> + <value>2</value> + </param> + <param> + <key>xmin</key> + <value>-2</value> + </param> + <param> + <key>xmax</key> + <value>2</value> + </param> + <param> + <key>nconnections</key> + <value>1</value> + </param> + <param> + <key>update_time</key> + <value>0.10</value> + </param> + <param> + <key>gui_hint</key> + <value>1,0,1,1</value> + </param> + <param> + <key>tr_mode</key> + <value>qtgui.TRIG_MODE_FREE</value> + </param> + <param> + <key>tr_slope</key> + <value>qtgui.TRIG_SLOPE_POS</value> + </param> + <param> + <key>tr_level</key> + <value>0.0</value> + </param> + <param> + <key>tr_chan</key> + <value>0</value> + </param> + <param> + <key>tr_tag</key> + <value>""</value> + </param> + <param> + <key>label1</key> + <value></value> + </param> + <param> + <key>width1</key> + <value>1</value> + </param> + <param> + <key>color1</key> + <value>"blue"</value> + </param> + <param> + <key>style1</key> + <value>0</value> + </param> + <param> + <key>marker1</key> + <value>0</value> + </param> + <param> + <key>alpha1</key> + <value>1.0</value> + </param> + <param> + <key>label2</key> + <value></value> + </param> + <param> + <key>width2</key> + <value>1</value> + </param> + <param> + <key>color2</key> + <value>"red"</value> + </param> + <param> + <key>style2</key> + <value>0</value> + </param> + <param> + <key>marker2</key> + <value>0</value> + </param> + <param> + <key>alpha2</key> + <value>1.0</value> + </param> + <param> + <key>label3</key> + <value></value> + </param> + <param> + <key>width3</key> + <value>1</value> + </param> + <param> + <key>color3</key> + <value>"red"</value> + </param> + <param> + <key>style3</key> + <value>0</value> + </param> + <param> + <key>marker3</key> + <value>0</value> + </param> + <param> + <key>alpha3</key> + <value>1.0</value> + </param> + <param> + <key>label4</key> + <value></value> + </param> + <param> + <key>width4</key> + <value>1</value> + </param> + <param> + <key>color4</key> + <value>"red"</value> + </param> + <param> + <key>style4</key> + <value>0</value> + </param> + <param> + <key>marker4</key> + <value>0</value> + </param> + <param> + <key>alpha4</key> + <value>1.0</value> + </param> + <param> + <key>label5</key> + <value></value> + </param> + <param> + <key>width5</key> + <value>1</value> + </param> + <param> + <key>color5</key> + <value>"red"</value> + </param> + <param> + <key>style5</key> + <value>0</value> + </param> + <param> + <key>marker5</key> + <value>0</value> + </param> + <param> + <key>alpha5</key> + <value>1.0</value> + </param> + <param> + <key>label6</key> + <value></value> + </param> + <param> + <key>width6</key> + <value>1</value> + </param> + <param> + <key>color6</key> + <value>"red"</value> + </param> + <param> + <key>style6</key> + <value>0</value> + </param> + <param> + <key>marker6</key> + <value>0</value> + </param> + <param> + <key>alpha6</key> + <value>1.0</value> + </param> + <param> + <key>label7</key> + <value></value> + </param> + <param> + <key>width7</key> + <value>1</value> + </param> + <param> + <key>color7</key> + <value>"red"</value> + </param> + <param> + <key>style7</key> + <value>0</value> + </param> + <param> + <key>marker7</key> + <value>0</value> + </param> + <param> + <key>alpha7</key> + <value>1.0</value> + </param> + <param> + <key>label8</key> + <value></value> + </param> + <param> + <key>width8</key> + <value>1</value> + </param> + <param> + <key>color8</key> + <value>"red"</value> + </param> + <param> + <key>style8</key> + <value>0</value> + </param> + <param> + <key>marker8</key> + <value>0</value> + </param> + <param> + <key>alpha8</key> + <value>1.0</value> + </param> + <param> + <key>label9</key> + <value></value> + </param> + <param> + <key>width9</key> + <value>1</value> + </param> + <param> + <key>color9</key> + <value>"red"</value> + </param> + <param> + <key>style9</key> + <value>0</value> + </param> + <param> + <key>marker9</key> + <value>0</value> + </param> + <param> + <key>alpha9</key> + <value>1.0</value> + </param> + <param> + <key>label10</key> + <value></value> + </param> + <param> + <key>width10</key> + <value>1</value> + </param> + <param> + <key>color10</key> + <value>"red"</value> + </param> + <param> + <key>style10</key> + <value>0</value> + </param> + <param> + <key>marker10</key> + <value>0</value> + </param> + <param> + <key>alpha10</key> + <value>1.0</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(512, 387)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_map_bb</key> + <param> + <key>id</key> + <value>digital_map_bb_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>map</key> + <value>constel.pre_diff_code()</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(752, 331)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>digital_constellation_decoder_cb</key> + <param> + <key>id</key> + <value>digital_constellation_decoder_cb_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>constellation</key> + <value>constel</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(520, 331)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_delay</key> + <param> + <key>id</key> + <value>blocks_delay_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>delay</key> + <value>int(delay)</value> + </param> + <param> + <key>num_ports</key> + <value>1</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(512, 451)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>blocks_char_to_float</key> + <param> + <key>id</key> + <value>blocks_char_to_float_0_0_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>scale</key> + <value>1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(880, 451)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>note</key> + <param> + <key>id</key> + <value>note_auto</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>note</key> + <value>auto-build LUT</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(8, 499)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>analog_random_source_x</key> + <param> + <key>id</key> + <value>analog_random_source_x_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>min</key> + <value>0</value> + </param> + <param> + <key>max</key> + <value>256</value> + </param> + <param> + <key>num_samps</key> + <value>200</value> + </param> + <param> + <key>repeat</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(48, 171)</value> + </param> + <param> + <key>_rotation</key> + <value>180</value> + </param> + </block> + <block> + <key>blocks_throttle</key> + <param> + <key>id</key> + <value>blocks_throttle_0</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>type</key> + <value>byte</value> + </param> + <param> + <key>samples_per_second</key> + <value>samp_rate</value> + </param> + <param> + <key>vlen</key> + <value>1</value> + </param> + <param> + <key>ignoretag</key> + <value>True</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>affinity</key> + <value></value> + </param> + <param> + <key>minoutbuf</key> + <value>0</value> + </param> + <param> + <key>maxoutbuf</key> + <value>0</value> + </param> + <param> + <key>_coordinate</key> + <value>(48, 123)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <block> + <key>variable_qtgui_range</key> + <param> + <key>id</key> + <value>noise_volt</value> + </param> + <param> + <key>_enabled</key> + <value>True</value> + </param> + <param> + <key>label</key> + <value>Channel: Noise Voltage</value> + </param> + <param> + <key>value</key> + <value>0.0001</value> + </param> + <param> + <key>start</key> + <value>0</value> + </param> + <param> + <key>stop</key> + <value>1</value> + </param> + <param> + <key>step</key> + <value>0.01</value> + </param> + <param> + <key>widget</key> + <value>slider</value> + </param> + <param> + <key>orient</key> + <value>Qt.Horizontal</value> + </param> + <param> + <key>min_len</key> + <value>200</value> + </param> + <param> + <key>gui_hint</key> + <value>0,0,1,1</value> + </param> + <param> + <key>alias</key> + <value></value> + </param> + <param> + <key>_coordinate</key> + <value>(8, 283)</value> + </param> + <param> + <key>_rotation</key> + <value>0</value> + </param> + </block> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>digital_constellation_modulator_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_constellation_modulator_0</source_block_id> + <sink_block_id>channels_channel_model_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>channels_channel_model_0</source_block_id> + <sink_block_id>digital_pfb_clock_sync_xxx_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_pfb_clock_sync_xxx_0</source_block_id> + <sink_block_id>qtgui_const_sink_x_1</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_pfb_clock_sync_xxx_0</source_block_id> + <sink_block_id>digital_constellation_soft_decoder_cf_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_pfb_clock_sync_xxx_0</source_block_id> + <sink_block_id>digital_constellation_decoder_cb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>1</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_binary_slicer_fb_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_constellation_soft_decoder_cf_0</source_block_id> + <sink_block_id>digital_binary_slicer_fb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_char_to_float_0_0_0</source_block_id> + <sink_block_id>qtgui_time_sink_x_0</sink_block_id> + <source_key>0</source_key> + <sink_key>2</sink_key> + </connection> + <connection> + <source_block_id>blocks_throttle_0</source_block_id> + <sink_block_id>blocks_unpack_k_bits_bb_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_map_bb_0_0</source_block_id> + <sink_block_id>blocks_unpack_k_bits_bb_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_unpack_k_bits_bb_0_0</source_block_id> + <sink_block_id>blocks_delay_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>blocks_delay_0</source_block_id> + <sink_block_id>blocks_char_to_float_0_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>digital_constellation_decoder_cb_0</source_block_id> + <sink_block_id>digital_map_bb_0_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> + <connection> + <source_block_id>analog_random_source_x_0</source_block_id> + <sink_block_id>blocks_throttle_0</sink_block_id> + <source_key>0</source_key> + <sink_key>0</sink_key> + </connection> +</flow_graph> diff --git a/gr-digital/include/gnuradio/digital/constellation.h b/gr-digital/include/gnuradio/digital/constellation.h index f2b796ea7f..0c29eff13d 100644 --- a/gr-digital/include/gnuradio/digital/constellation.h +++ b/gr-digital/include/gnuradio/digital/constellation.h @@ -39,7 +39,7 @@ namespace gr { /* */ /* Base class defining interface. */ /************************************************************/ - + class constellation; typedef boost::shared_ptr<constellation> constellation_sptr; @@ -82,13 +82,13 @@ namespace gr { unsigned int decision_maker_pe(const gr_complex *sample, float *phase_error); //! Calculates distance. //unsigned int decision_maker_e(const gr_complex *sample, float *error); - + //! Calculates metrics for all points in the constellation. //! For use with the viterbi algorithm. virtual void calc_metric(const gr_complex *sample, float *metric, gr::digital::trellis_metric_type_t type); virtual void calc_euclidean_metric(const gr_complex *sample, float *metric); virtual void calc_hard_symbol_metric(const gr_complex *sample, float *metric); - + //! Returns the set of points in this constellation. std::vector<gr_complex> points() { return d_constellation;} //! Returns the vector of points in this constellation. @@ -111,7 +111,7 @@ namespace gr { { return floor(log(double(d_constellation.size()))/d_dimensionality/log(2.0)); } - + unsigned int arity() { return d_arity; @@ -120,7 +120,7 @@ namespace gr { constellation_sptr base() { return shared_from_this(); - } + } pmt::pmt_t as_pmt() { @@ -185,7 +185,12 @@ namespace gr { //! Returns True if the soft decision LUT has been defined, False otherwise. bool has_soft_dec_lut(); - + + + std::vector< std::vector<float> > soft_dec_lut(); + + + /*! \brief Returns the soft decisions for the given \p sample. * * \details Returns the soft decisions for the given \p @@ -200,7 +205,7 @@ namespace gr { protected: std::vector<gr_complex> d_constellation; - std::vector<int> d_pre_diff_code; + std::vector<int> d_pre_diff_code; bool d_apply_pre_diff_code; unsigned int d_rotational_symmetry; unsigned int d_dimensionality; @@ -244,7 +249,7 @@ namespace gr { * Make a general constellation object that calculates the Euclidean distance for hard decisions. * * \param constell List of constellation points (order of list matches pre_diff_code) - * \param pre_diff_code List of alphabet symbols (before applying any differential + * \param pre_diff_code List of alphabet symbols (before applying any differential * coding) (order of list matches constell) * \param rotational_symmetry Number of rotations around unit circle that have the same representation. * \param dimensionality Number of dimensions to the constellation. @@ -287,7 +292,7 @@ namespace gr { * Make a sectorized constellation object. * * \param constell List of constellation points (order of list matches pre_diff_code) - * \param pre_diff_code List of alphabet symbols (before applying any differential + * \param pre_diff_code List of alphabet symbols (before applying any differential * coding) (order of list matches constell) * \param rotational_symmetry Number of rotations around unit circle that have the same representation. * \param dimensionality Number of z-axis dimensions to the constellation @@ -342,13 +347,13 @@ namespace gr { * Make a rectangular constellation object. * * \param constell List of constellation points (order of list matches pre_diff_code) - * \param pre_diff_code List of alphabet symbols (before applying any differential + * \param pre_diff_code List of alphabet symbols (before applying any differential * coding) (order of list matches constell) * \param rotational_symmetry Number of rotations around unit circle that have the same representation. * \param real_sectors Number of sectors the real axis is split in to. * \param imag_sectors Number of sectors the imag axis is split in to. * \param width_real_sectors width of each real sector to calculate decision boundaries. - * \param width_imag_sectors width of each imag sector to calculate decision boundaries. + * \param width_imag_sectors width of each imag sector to calculate decision boundaries. */ static constellation_rect::sptr make(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, @@ -402,7 +407,7 @@ namespace gr { * the closest constellation point, however sometimes it's nice to * have the flexibility. */ - class DIGITAL_API constellation_expl_rect + class DIGITAL_API constellation_expl_rect : public constellation_rect { public: @@ -440,17 +445,17 @@ namespace gr { /* constellation_psk */ /************************************************************/ - /*! + /*! * \brief constellation_psk * \ingroup digital * * Constellation space is divided into pie slices sectors. * - * Each slice is associated with the nearest constellation point. + * Each slice is associated with the nearest constellation point. * - * Works well for PSK but nothing else. + * Works well for PSK but nothing else. * - * Assumes that there is a constellation point at 1.x + * Assumes that there is a constellation point at 1.x */ class DIGITAL_API constellation_psk : public constellation_sector { @@ -466,7 +471,7 @@ namespace gr { protected: unsigned int get_sector(const gr_complex *sample); - + unsigned int calc_sector_value(unsigned int sector); constellation_psk(std::vector<gr_complex> constell, @@ -482,7 +487,7 @@ namespace gr { /* */ /************************************************************/ - /*! + /*! * \brief Digital constellation for BPSK . * \ingroup digital * @@ -515,7 +520,7 @@ namespace gr { /* */ /************************************************************/ - /*! + /*! * \brief Digital constellation for QPSK * \ingroup digital * @@ -585,7 +590,7 @@ namespace gr { /* */ /************************************************************/ - /*! + /*! * \brief Digital constellation for 8PSK. * \ingroup digital * diff --git a/gr-digital/lib/constellation.cc b/gr-digital/lib/constellation.cc index 7d2c170d34..a477aa83ed 100644 --- a/gr-digital/lib/constellation.cc +++ b/gr-digital/lib/constellation.cc @@ -1,6 +1,6 @@ /* -*- c++ -*- */ /* - * Copyright 2010-2012 Free Software Foundation, Inc. + * Copyright 2010-2012,2014 Free Software Foundation, Inc. * * This file is part of GNU Radio * @@ -32,6 +32,7 @@ #include <cfloat> #include <stdexcept> #include <boost/format.hpp> +#include <iostream> namespace gr { namespace digital { @@ -129,7 +130,7 @@ namespace gr { unsigned int min_index = 0; float min_euclid_dist; float euclid_dist; - + min_euclid_dist = get_distance(0, sample); min_index = 0; for(unsigned int j = 1; j < d_arity; j++){ @@ -244,21 +245,22 @@ namespace gr { void constellation::gen_soft_dec_lut(int precision, float npwr) { - max_min_axes(); - d_lut_scale = powf(2.0, static_cast<float>(precision)); - float xstep = (d_re_max - d_re_min) / (d_lut_scale-1); - float ystep = (d_im_max - d_im_min) / (d_lut_scale-1); d_soft_dec_lut.clear(); - - float y = d_im_min; - while(y < d_im_max) { - float x = d_re_min; - while(x < d_re_max) { + d_lut_scale = powf(2.0f, static_cast<float>(precision)); + + // We know we've normalized the constellation, so the min/max + // dimensions in either direction are scaled to +/-1. + float maxd = 1.0f; + float step = (2.0f*maxd) / (d_lut_scale-1); + float y = -maxd; + while(y < maxd+step) { + float x = -maxd; + while(x < maxd+step) { gr_complex pt = gr_complex(x, y); d_soft_dec_lut.push_back(calc_soft_dec(pt, npwr)); - x += xstep; + x += step; } - y += ystep; + y += step; } d_lut_precision = precision; @@ -267,22 +269,19 @@ namespace gr { std::vector<float> constellation::calc_soft_dec(gr_complex sample, float npwr) { + int v; int M = static_cast<int>(d_constellation.size()); int k = static_cast<int>(log(static_cast<double>(M))/log(2.0)); std::vector<float> tmp(2*k, 0); std::vector<float> s(k, 0); - float scale = d_scalefactor*d_scalefactor; - int v; - for(int i = 0; i < M; i++) { // Calculate the distance between the sample and the current // constellation point. - float dist = powf(std::abs(sample - d_constellation[i]), 2.0f); - + float dist = std::abs(sample - d_constellation[i]); // Calculate the probability factor from the distance and // the scaled noise power. - float d = expf(-dist / (2.0*npwr*scale)); + float d = expf(-dist/npwr); if(d_apply_pre_diff_code) v = d_pre_diff_code[i]; @@ -307,7 +306,7 @@ namespace gr { // probability of ones (tmp[2*i+1]) over the probability of a zero // (tmp[2*i+0]). for(int i = 0; i < k; i++) { - s[k-1-i] = (logf(tmp[2*i+1]) - logf(tmp[2*i+0])) * scale; + s[k-1-i] = (logf(tmp[2*i+1]) - logf(tmp[2*i+0])); } return s; @@ -330,30 +329,40 @@ namespace gr { return d_soft_dec_lut.size() > 0; } + std::vector< std::vector<float> > + constellation::soft_dec_lut() + { + return d_soft_dec_lut; + } + std::vector<float> constellation::soft_decision_maker(gr_complex sample) { if(has_soft_dec_lut()) { - float xre = sample.real(); - float xim = sample.imag(); - - float xstep = (d_re_max-d_re_min) / d_lut_scale; - float ystep = (d_im_max-d_im_min) / d_lut_scale; - - float xscale = (d_lut_scale / (d_re_max-d_re_min)) - xstep; - float yscale = (d_lut_scale / (d_im_max-d_im_min)) - ystep; - - xre = floorf((-d_re_min + std::min(d_re_max, std::max(d_re_min, xre))) * xscale); - xim = floorf((-d_im_min + std::min(d_im_max, std::max(d_im_min, xim))) * yscale); + // Clip to just below 1 --> at 1, we can overflow the index + // that will put us in the next row of the 2D LUT. + float xre = branchless_clip(sample.real(), 0.99); + float xim = branchless_clip(sample.imag(), 0.99); + + // We normalize the constellation in the ctor, so we know that + // the maximum dimenions go from -1 to +1. We can infer the x + // and y scale directly. + float scale = d_lut_scale / (2.0f); + + // Convert the clipped x and y samples to nearest index offset + xre = floorf((1.0f + xre) * scale); + xim = floorf((1.0f + xim) * scale); int index = static_cast<int>(d_lut_scale*xim + xre); int max_index = d_lut_scale*d_lut_scale; - if(index > max_index) { - return d_soft_dec_lut[max_index-1]; - } - if(index < 0) - throw std::runtime_error("constellation::soft_decision_maker: input sample out of range."); + // Make sure we are in bounds of the index + while(index >= max_index) { + index -= d_lut_scale; + } + while(index < 0) { + index += d_lut_scale; + } return d_soft_dec_lut[index]; } @@ -412,7 +421,7 @@ namespace gr { unsigned int dimensionality) : constellation(constell, pre_diff_code, rotational_symmetry, dimensionality) {} - + // Chooses points base on shortest distance. // Inefficient. unsigned int @@ -435,11 +444,11 @@ namespace gr { n_sectors(n_sectors) { } - + constellation_sector::~constellation_sector() { } - + unsigned int constellation_sector::decision_maker(const gr_complex *sample) { @@ -447,7 +456,7 @@ namespace gr { sector = get_sector(sample); return sector_values[sector]; } - + void constellation_sector::find_sector_values() { @@ -457,11 +466,11 @@ namespace gr { sector_values.push_back(calc_sector_value(i)); } } - - + + /********************************************************************/ - - + + constellation_rect::sptr constellation_rect::make(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, @@ -495,31 +504,31 @@ namespace gr { d_width_imag_sectors *= d_scalefactor; find_sector_values(); } - + constellation_rect::~constellation_rect() { } - + unsigned int constellation_rect::get_sector(const gr_complex *sample) { int real_sector, imag_sector; unsigned int sector; - + real_sector = int(real(*sample)/d_width_real_sectors + n_real_sectors/2.0); if(real_sector < 0) real_sector = 0; if(real_sector >= (int)n_real_sectors) real_sector = n_real_sectors-1; - + imag_sector = int(imag(*sample)/d_width_imag_sectors + n_imag_sectors/2.0); if(imag_sector < 0) imag_sector = 0; if(imag_sector >= (int)n_imag_sectors) imag_sector = n_imag_sectors-1; - + sector = real_sector * n_imag_sectors + imag_sector; return sector; } @@ -536,7 +545,7 @@ namespace gr { (imag_sector + 0.5 - n_imag_sectors/2.0) * d_width_imag_sectors); return sector_center; } - + unsigned int constellation_rect::calc_sector_value(unsigned int sector) { @@ -547,8 +556,8 @@ namespace gr { } /********************************************************************/ - - constellation_expl_rect::sptr + + constellation_expl_rect::sptr constellation_expl_rect::make(std::vector<gr_complex> constellation, std::vector<int> pre_diff_code, unsigned int rotational_symmetry, @@ -565,7 +574,7 @@ namespace gr { width_real_sectors, width_imag_sectors, sector_values)); } - + constellation_expl_rect::constellation_expl_rect( std::vector<gr_complex> constellation, std::vector<int> pre_diff_code, @@ -580,16 +589,16 @@ namespace gr { d_sector_values(sector_values) { } - + constellation_expl_rect::~constellation_expl_rect() { } - + /********************************************************************/ - - - constellation_psk::sptr - constellation_psk::make(std::vector<gr_complex> constell, + + + constellation_psk::sptr + constellation_psk::make(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int n_sectors) { @@ -597,7 +606,7 @@ namespace gr { (constell, pre_diff_code, n_sectors)); } - + constellation_psk::constellation_psk(std::vector<gr_complex> constell, std::vector<int> pre_diff_code, unsigned int n_sectors) : @@ -606,11 +615,11 @@ namespace gr { { find_sector_values(); } - + constellation_psk::~constellation_psk() { } - + unsigned int constellation_psk::get_sector(const gr_complex *sample) { @@ -621,7 +630,7 @@ namespace gr { sector += n_sectors; return sector; } - + unsigned int constellation_psk::calc_sector_value(unsigned int sector) { @@ -635,7 +644,7 @@ namespace gr { /********************************************************************/ - constellation_bpsk::sptr + constellation_bpsk::sptr constellation_bpsk::make() { return constellation_bpsk::sptr(new constellation_bpsk()); @@ -665,7 +674,7 @@ namespace gr { /********************************************************************/ - constellation_qpsk::sptr + constellation_qpsk::sptr constellation_qpsk::make() { return constellation_qpsk::sptr(new constellation_qpsk()); @@ -679,7 +688,7 @@ namespace gr { d_constellation[1] = gr_complex(SQRT_TWO, -SQRT_TWO); d_constellation[2] = gr_complex(-SQRT_TWO, SQRT_TWO); d_constellation[3] = gr_complex(SQRT_TWO, SQRT_TWO); - + /* d_constellation[0] = gr_complex(SQRT_TWO, SQRT_TWO); d_constellation[1] = gr_complex(-SQRT_TWO, SQRT_TWO); @@ -701,7 +710,7 @@ namespace gr { constellation_qpsk::~constellation_qpsk() { } - + unsigned int constellation_qpsk::decision_maker(const gr_complex *sample) { @@ -731,7 +740,7 @@ namespace gr { /********************************************************************/ - constellation_dqpsk::sptr + constellation_dqpsk::sptr constellation_dqpsk::make() { return constellation_dqpsk::sptr(new constellation_dqpsk()); @@ -791,7 +800,7 @@ namespace gr { /********************************************************************/ - constellation_8psk::sptr + constellation_8psk::sptr constellation_8psk::make() { return constellation_8psk::sptr(new constellation_8psk()); diff --git a/gr-digital/lib/constellation_soft_decoder_cf_impl.cc b/gr-digital/lib/constellation_soft_decoder_cf_impl.cc index cd0a844119..aeab660746 100644 --- a/gr-digital/lib/constellation_soft_decoder_cf_impl.cc +++ b/gr-digital/lib/constellation_soft_decoder_cf_impl.cc @@ -1,19 +1,19 @@ /* -*- c++ -*- */ /* * Copyright 2013 Free Software Foundation, Inc. - * + * * This file is part of GNU Radio - * + * * GNU Radio is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. - * + * * GNU Radio is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with GNU Radio; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, diff --git a/gr-digital/python/digital/ofdm_sync_pn.py b/gr-digital/python/digital/ofdm_sync_pn.py index 4c6a30f802..8bf7ed782a 100644 --- a/gr-digital/python/digital/ofdm_sync_pn.py +++ b/gr-digital/python/digital/ofdm_sync_pn.py @@ -42,9 +42,9 @@ class ofdm_sync_pn(gr.hier_block2): Synchonization for OFDM," IEEE Trans. Communications, vol. 45, no. 12, 1997. """ - - gr.hier_block2.__init__(self, "ofdm_sync_pn", - gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature + + gr.hier_block2.__init__(self, "ofdm_sync_pn", + gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature2(2, 2, gr.sizeof_float, gr.sizeof_char)) # Output signature self.input = blocks.add_const_cc(0) @@ -59,25 +59,15 @@ class ofdm_sync_pn(gr.hier_block2): self.corr = blocks.multiply_cc(); # Create a moving sum filter for the corr output - if 1: - moving_sum_taps = [1.0 for i in range(fft_length//2)] - self.moving_sum_filter = filter.fir_filter_ccf(1,moving_sum_taps) - else: - moving_sum_taps = [complex(1.0,0.0) for i in range(fft_length//2)] - self.moving_sum_filter = filter.fft_filter_ccc(1,moving_sum_taps) + self.moving_sum_filter = filter.fir_filter_ccf(1, [1.0] * (fft_length//2)) # Create a moving sum filter for the input self.inputmag2 = blocks.complex_to_mag_squared() - movingsum2_taps = [1.0 for i in range(fft_length//2)] - - if 1: - self.inputmovingsum = filter.fir_filter_fff(1,movingsum2_taps) - else: - self.inputmovingsum = filter.fft_filter_fff(1,movingsum2_taps) + self.inputmovingsum = filter.fir_filter_fff(1, [1.0] * (fft_length//2)) self.square = blocks.multiply_ff() self.normalize = blocks.divide_ff() - + # Get magnitude (peaks) and angle (phase/freq error) self.c2mag = blocks.complex_to_mag_squared() self.angle = blocks.complex_to_arg() @@ -87,10 +77,9 @@ class ofdm_sync_pn(gr.hier_block2): #ML measurements input to sampler block and detect self.sub1 = blocks.add_const_ff(-1) self.pk_detect = blocks.peak_detector_fb(0.20, 0.20, 30, 0.001) - #self.pk_detect = blocks.peak_detector2_fb(9) self.connect(self, self.input) - + # Calculate the frequency offset from the correlation of the preamble self.connect(self.input, self.delay) self.connect(self.input, (self.corr,0)) @@ -130,4 +119,3 @@ class ofdm_sync_pn(gr.hier_block2): self.connect(self.pk_detect, blocks.file_sink(gr.sizeof_char, "ofdm_sync_pn-peaks_b.dat")) self.connect(self.sample_and_hold, blocks.file_sink(gr.sizeof_float, "ofdm_sync_pn-sample_and_hold_f.dat")) self.connect(self.input, blocks.file_sink(gr.sizeof_gr_complex, "ofdm_sync_pn-input_c.dat")) - diff --git a/gr-digital/python/digital/ofdm_sync_pnac.py b/gr-digital/python/digital/ofdm_sync_pnac.py index ee7c82927a..55a6c21f4c 100644 --- a/gr-digital/python/digital/ofdm_sync_pnac.py +++ b/gr-digital/python/digital/ofdm_sync_pnac.py @@ -43,23 +43,22 @@ class ofdm_sync_pnac(gr.hier_block2): This implementation is meant to be a more robust version of the Schmidl and Cox receiver design. By correlating against the preamble and using that as the input to the time-delayed correlation, - this circuit produces a very clean timing signal at the end of the preamble. The timing is + this circuit produces a very clean timing signal at the end of the preamble. The timing is more accurate and does not have the problem associated with determining the timing from the plateau structure in the Schmidl and Cox. This implementation appears to require that the signal is received with a normalized power or signal - scalling factor to reduce ambiguities intorduced from partial correlation of the cyclic prefix and + scaling factor to reduce ambiguities introduced from partial correlation of the cyclic prefix and the peak detection. A better peak detection block might fix this. Also, the cross-correlation falls apart as the frequency offset gets larger and completely fails when an integer offset is introduced. Another thing to look at. """ - gr.hier_block2.__init__(self, "ofdm_sync_pnac", - gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature + gr.hier_block2.__init__(self, "ofdm_sync_pnac", + gr.io_signature(1, 1, gr.sizeof_gr_complex), # Input signature gr.io_signature2(2, 2, gr.sizeof_float, gr.sizeof_char)) # Output signature - self.input = blocks.add_const_cc(0) symbol_length = fft_length + cp_length @@ -80,19 +79,18 @@ class ofdm_sync_pnac(gr.hier_block2): # Create a moving sum filter for the input self.mag = blocks.complex_to_mag_squared() - movingsum_taps = (fft_length//1)*[1.0,] - self.power = filter.fir_filter_fff(1,movingsum_taps) - + self.power = filter.fir_filter_fff(1, [1.0] * int(fft_length)) + # Get magnitude (peaks) and angle (phase/freq error) self.c2mag = blocks.complex_to_mag_squared() self.angle = blocks.complex_to_arg() self.compare = blocks.sub_ff() - + self.sample_and_hold = blocks.sample_and_hold_ff() #ML measurements input to sampler block and detect self.threshold = blocks.threshold_ff(0,0,0) # threshold detection might need to be tweaked - self.peaks = blocksx.float_to_char() + self.peaks = blocks.float_to_char() self.connect(self, self.input) diff --git a/gr-digital/python/digital/qa_constellation.py b/gr-digital/python/digital/qa_constellation.py index 00248f4f09..42e49bb059 100644 --- a/gr-digital/python/digital/qa_constellation.py +++ b/gr-digital/python/digital/qa_constellation.py @@ -1,26 +1,26 @@ #!/usr/bin/env python # # Copyright 2011,2013 Free Software Foundation, Inc. -# +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# -import random +import random, math from cmath import exp, pi, log, sqrt from gnuradio import gr, gr_unittest, digital, blocks @@ -40,7 +40,7 @@ tested_mod_codes = (mod_codes.NO_CODE, mod_codes.GRAY_CODE) def twod_constell(): """ - + """ points = ((1+0j), (0+1j), (-1+0j), (0-1j)) @@ -76,12 +76,12 @@ easy_constellation_info = ( False, None), (qam.qam_constellation, {'constellation_points': (4,), - 'mod_code': tested_mod_codes, + 'mod_code': tested_mod_codes, 'large_ampls_to_corners': [False],}, True, None), (qam.qam_constellation, {'constellation_points': (4, 16, 64), - 'mod_code': tested_mod_codes, + 'mod_code': tested_mod_codes, 'differential': (False,)}, False, None), (digital.constellation_bpsk, {}, True, None), @@ -101,7 +101,7 @@ medium_constellation_info = ( True, None), (qam.qam_constellation, {'constellation_points': (16 ,), - 'mod_code': tested_mod_codes, + 'mod_code': tested_mod_codes, 'large_ampls_to_corners': [False, True],}, True, None), (qamlike.qam32_holeinside_constellation, @@ -113,11 +113,20 @@ medium_constellation_info = ( difficult_constellation_info = ( (qam.qam_constellation, {'constellation_points': (64,), - 'mod_code': tested_mod_codes, + 'mod_code': tested_mod_codes, 'large_ampls_to_corners': [False, True],}, - True, None), + True, None), ) +def slicer(x): + ret = [] + for xi in x: + if(xi < 0): + ret.append(0.0) + else: + ret.append(1.0) + return ret + def tested_constellations(easy=True, medium=True, difficult=True): """ Generator to produce (constellation, differential) tuples for testing purposes. @@ -153,7 +162,7 @@ def tested_constellations(easy=True, medium=True, difficult=True): this_poss_arg[2] = 0 if sum([argindex for argname, argvalues, argindex in poss_args]) == 0: break - + class test_constellation(gr_unittest.TestCase): @@ -170,7 +179,7 @@ class test_constellation(gr_unittest.TestCase): for constellation, differential in tested_constellations(): if differential: rs = constellation.rotational_symmetry() - rotations = [exp(i*2*pi*(0+1j)/rs) for i in range(0, rs)] + rotations = [exp(i*2*pi*(0+1j)/rs) for i in range(0, rs)] else: rotations = [None] for rotation in rotations: @@ -216,17 +225,17 @@ class test_constellation(gr_unittest.TestCase): y_cpp_raw_calc = [] y_cpp_table = [] for sample in samples: - y_python_raw_calc += digital.calc_soft_dec(sample, constel, code) - y_python_gen_calc += digital.sd_psk_4_0(sample, Es) - y_python_table += digital.calc_soft_dec_from_table(sample, table, prec, Es) + y_python_raw_calc += slicer(digital.calc_soft_dec(sample, constel, code)) + y_python_gen_calc += slicer(digital.sd_psk_4_0(sample, Es)) + y_python_table += slicer(digital.calc_soft_dec_from_table(sample, table, prec, Es)) y_cpp_raw_calc += c.calc_soft_dec(sample) y_cpp_table += c.soft_decision_maker(sample) - self.assertFloatTuplesAlmostEqual(y_python_raw_calc, y_python_gen_calc, 4) - self.assertFloatTuplesAlmostEqual(y_python_raw_calc, y_python_table, 2) - self.assertFloatTuplesAlmostEqual(y_cpp_raw_calc, y_cpp_table, 4) - + self.assertFloatTuplesAlmostEqual(y_python_raw_calc, y_python_gen_calc, 0) + self.assertFloatTuplesAlmostEqual(y_python_gen_calc, y_python_table, 0) + self.assertFloatTuplesAlmostEqual(y_cpp_raw_calc, y_cpp_table, 0) + def test_soft_qpsk_calc(self): prec = 8 constel, code = digital.psk_4_0() @@ -257,14 +266,54 @@ class test_constellation(gr_unittest.TestCase): y_cpp_raw_calc = [] y_cpp_table = [] for sample in samples: - y_python_raw_calc += digital.calc_soft_dec(sample, constel, code) - y_python_table += digital.calc_soft_dec_from_table(sample, table, prec, Es) + y_python_raw_calc += slicer(digital.calc_soft_dec(sample, constel, code)) + y_python_table += slicer(digital.calc_soft_dec_from_table(sample, table, prec, Es)) - y_cpp_raw_calc += c.calc_soft_dec(sample) - y_cpp_table += c.soft_decision_maker(sample) + y_cpp_raw_calc += slicer(c.calc_soft_dec(sample)) + y_cpp_table += slicer(c.soft_decision_maker(sample)) + + self.assertEqual(y_python_raw_calc, y_python_table) + self.assertEqual(y_cpp_raw_calc, y_cpp_table) + + + def test_soft_qam16_calc(self): + prec = 8 + constel, code = digital.qam_16_0() - self.assertFloatTuplesAlmostEqual(y_python_raw_calc, y_python_table, 4) - self.assertFloatTuplesAlmostEqual(y_cpp_raw_calc, y_cpp_table, 4) + rot_sym = 1 + side = 2 + width = 2 + c = digital.constellation_rect(constel, code, rot_sym, + side, side, width, width) + + # Get max energy/symbol in constellation + constel = c.points() + Es = max([abs(constel_i) for constel_i in constel]) + + table = digital.soft_dec_table(constel, code, prec) + c.gen_soft_dec_lut(prec) + + x = sqrt(2.0)/2.0 + step = (x.real+x.real) / (2**prec - 1) + samples = [ -x-x*1j, -x+x*1j, + x+x*1j, x-x*1j, + (-x+128*step)+(-x+128*step)*1j, + (-x+64*step) +(-x+64*step)*1j, (-x+64*step) +(-x+192*step)*1j, + (-x+192*step)+(-x+192*step)*1j, (-x+192*step)+(-x+64*step)*1j,] + + y_python_raw_calc = [] + y_python_table = [] + y_cpp_raw_calc = [] + y_cpp_table = [] + for sample in samples: + y_python_raw_calc += slicer(digital.calc_soft_dec(sample, constel, code)) + y_python_table += slicer(digital.calc_soft_dec_from_table(sample, table, prec, Es)) + + y_cpp_raw_calc += slicer(c.calc_soft_dec(sample)) + y_cpp_table += slicer(c.soft_decision_maker(sample)) + + self.assertFloatTuplesAlmostEqual(y_python_raw_calc, y_python_table, 0) + self.assertFloatTuplesAlmostEqual(y_cpp_raw_calc, y_cpp_table, 0) class mod_demod(gr.hier_block2): def __init__(self, constellation, differential, rotation): @@ -317,7 +366,7 @@ class mod_demod(gr.hier_block2): if self.constellation.apply_pre_diff_code(): self.blocks.append(digital.map_bb( mod_codes.invert_code(self.constellation.pre_diff_code()))) - # unpack the k bit vector into a stream of bits + # unpack the k bit vector into a stream of bits self.blocks.append(blocks.unpack_k_bits_bb( self.constellation.bits_per_symbol())) # connect to block output @@ -326,6 +375,6 @@ class mod_demod(gr.hier_block2): self.blocks.append(weakref.proxy(self)) self.connect(*self.blocks) - + if __name__ == '__main__': gr_unittest.run(test_constellation, "test_constellation.xml") diff --git a/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py b/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py index 6cd757537a..872aed0157 100644 --- a/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py +++ b/gr-digital/python/digital/qa_constellation_soft_decoder_cf.py @@ -1,27 +1,28 @@ #!/usr/bin/env python # -# Copyright 2013 Free Software Foundation, Inc. -# +# Copyright 2013-2014 Free Software Foundation, Inc. +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# from gnuradio import gr, gr_unittest, digital, blocks from math import sqrt +from numpy import random, vectorize class test_constellation_soft_decoder(gr_unittest.TestCase): @@ -31,16 +32,15 @@ class test_constellation_soft_decoder(gr_unittest.TestCase): def tearDown(self): self.tb = None - def test_constellation_soft_decoder_cf_bpsk(self): - prec = 8 - src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j, - 0.8 + 1.0j, -0.5 + 0.1j, 0.1 - 1.2j, 1+1j) - lut = digital.soft_dec_table_generator(digital.sd_psk_2_0x0, prec) + def helper_with_lut(self, prec, src_data, const_gen, const_sd_gen): + cnst_pts, code = const_gen() + Es = max([abs(c) for c in cnst_pts]) + lut = digital.soft_dec_table_generator(const_sd_gen, prec, Es) expected_result = list() for s in src_data: - expected_result += digital.calc_soft_dec_from_table(s, lut, prec, Es=2/sqrt(2)) + res = digital.calc_soft_dec_from_table(s, lut, prec, sqrt(2.0)) + expected_result += res - cnst_pts, code = digital.psk_2_0x0() cnst = digital.constellation_calcdist(cnst_pts, code, 2, 1) cnst.set_soft_dec_lut(lut, int(prec)) src = blocks.vector_source_c(src_data) @@ -49,64 +49,123 @@ class test_constellation_soft_decoder(gr_unittest.TestCase): self.tb.connect(src, op) self.tb.connect(op, dst) - self.tb.run() # run the graph and wait for it to finish + self.tb.run() actual_result = dst.data() # fetch the contents of the sink #print "actual result", actual_result #print "expected result", expected_result - self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 4) + self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 5) - def test_constellation_soft_decoder_cf_qpsk(self): - prec = 8 - src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j, - 0.8 + 1.0j, -0.5 + 0.1j, 0.1 - 1.2j, 1+1j) - lut = digital.soft_dec_table_generator(digital.sd_psk_4_0x0_0_1, prec) + def helper_no_lut(self, prec, src_data, const_gen, const_sd_gen): + cnst_pts, code = const_gen() + cnst = digital.constellation_calcdist(cnst_pts, code, 2, 1) expected_result = list() for s in src_data: - expected_result += digital.calc_soft_dec_from_table(s, lut, prec) + res = digital.calc_soft_dec(s, cnst.points(), code) + expected_result += res - cnst_pts,code = digital.psk_4_0x0_0_1() - cnst = digital.constellation_calcdist(cnst_pts, code, 2, 1) - cnst.set_soft_dec_lut(lut, int(prec)) src = blocks.vector_source_c(src_data) op = digital.constellation_soft_decoder_cf(cnst.base()) dst = blocks.vector_sink_f() self.tb.connect(src, op) self.tb.connect(op, dst) - self.tb.run() # run the graph and wait for it to finish + self.tb.run() actual_result = dst.data() # fetch the contents of the sink #print "actual result", actual_result #print "expected result", expected_result - self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 5) - def test_constellation_soft_decoder_cf_qam16(self): + # Double vs. float precision issues between Python and C++, so + # use only 4 decimals in comparisons. + self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 4) + + def test_constellation_soft_decoder_cf_bpsk_3(self): + prec = 3 + src_data = (-1.0 - 1.0j, 1.0 - 1.0j, -1.0 + 1.0j, 1.0 + 1.0j, + -2.0 - 2.0j, 2.0 - 2.0j, -2.0 + 2.0j, 2.0 + 2.0j, + -0.2 - 0.2j, 0.2 - 0.2j, -0.2 + 0.2j, 0.2 + 0.2j, + 0.3 + 0.4j, 0.1 - 1.2j, -0.8 - 0.1j, -0.4 + 0.8j, + 0.8 + 1.0j, -0.5 + 0.1j, 0.1 + 1.2j, -1.7 - 0.9j) + self.helper_with_lut(prec, src_data, digital.psk_2_0x0, digital.sd_psk_2_0x0) + + def test_constellation_soft_decoder_cf_bpsk_8(self): prec = 8 - src_data = (0.5 + 0.5j, 0.1 - 1.2j, -0.8 - 0.1j, -0.45 + 0.8j, - 0.8 + 1.0j, -0.5 + 0.1j, 0.1 - 1.2j, 1+1j) - lut = digital.soft_dec_table_generator(digital.sd_qam_16_0x0_0_1_2_3, prec) - expected_result = list() - for s in src_data: - expected_result += digital.calc_soft_dec_from_table(s, lut, prec) + src_data = (-1.0 - 1.0j, 1.0 - 1.0j, -1.0 + 1.0j, 1.0 + 1.0j, + -2.0 - 2.0j, 2.0 - 2.0j, -2.0 + 2.0j, 2.0 + 2.0j, + -0.2 - 0.2j, 0.2 - 0.2j, -0.2 + 0.2j, 0.2 + 0.2j, + 0.3 + 0.4j, 0.1 - 1.2j, -0.8 - 0.1j, -0.4 + 0.8j, + 0.8 + 1.0j, -0.5 + 0.1j, 0.1 + 1.2j, -1.7 - 0.9j) + self.helper_with_lut(prec, src_data, digital.psk_2_0x0, digital.sd_psk_2_0x0) + + def test_constellation_soft_decoder_cf_bpsk_8_rand(self): + prec = 8 + src_data = vectorize(complex)(2*random.randn(100), 2*random.randn(100)) + self.helper_with_lut(prec, src_data, digital.psk_2_0x0, digital.sd_psk_2_0x0) - cnst_pts = digital.qam_16_0x0_0_1_2_3() - cnst = digital.constellation_calcdist(cnst_pts[0], cnst_pts[1], 2, 1) - cnst.set_soft_dec_lut(lut, int(prec)) - src = blocks.vector_source_c(src_data) - op = digital.constellation_soft_decoder_cf(cnst.base()) - dst = blocks.vector_sink_f() + def test_constellation_soft_decoder_cf_bpsk_8_rand2(self): + prec = 8 + src_data = vectorize(complex)(2*random.randn(100), 2*random.randn(100)) + self.helper_no_lut(prec, src_data, digital.psk_2_0x0, digital.sd_psk_2_0x0) + + def test_constellation_soft_decoder_cf_qpsk_3(self): + prec = 3 + src_data = (-1.0 - 1.0j, 1.0 - 1.0j, -1.0 + 1.0j, 1.0 + 1.0j, + -2.0 - 2.0j, 2.0 - 2.0j, -2.0 + 2.0j, 2.0 + 2.0j, + -0.2 - 0.2j, 0.2 - 0.2j, -0.2 + 0.2j, 0.2 + 0.2j, + 0.3 + 0.4j, 0.1 - 1.2j, -0.8 - 0.1j, -0.4 + 0.8j, + 0.8 + 1.0j, -0.5 + 0.1j, 0.1 + 1.2j, -1.7 - 0.9j) + self.helper_with_lut(prec, src_data, digital.psk_4_0x0_0_1, digital.sd_psk_4_0x0_0_1) + + def test_constellation_soft_decoder_cf_qpsk_8(self): + prec = 8 + src_data = (-1.0 - 1.0j, 1.0 - 1.0j, -1.0 + 1.0j, 1.0 + 1.0j, + -2.0 - 2.0j, 2.0 - 2.0j, -2.0 + 2.0j, 2.0 + 2.0j, + -0.2 - 0.2j, 0.2 - 0.2j, -0.2 + 0.2j, 0.2 + 0.2j, + 0.3 + 0.4j, 0.1 - 1.2j, -0.8 - 0.1j, -0.4 + 0.8j, + 0.8 + 1.0j, -0.5 + 0.1j, 0.1 + 1.2j, -1.7 - 0.9j) + self.helper_with_lut(prec, src_data, digital.psk_4_0x0_0_1, digital.sd_psk_4_0x0_0_1) + + def test_constellation_soft_decoder_cf_qpsk_8_rand(self): + prec = 8 + src_data = vectorize(complex)(2*random.randn(100), 2*random.randn(100)) + self.helper_with_lut(prec, src_data, digital.psk_4_0x0_0_1, digital.sd_psk_4_0x0_0_1) - self.tb.connect(src, op) - self.tb.connect(op, dst) - self.tb.run() # run the graph and wait for it to finish + def test_constellation_soft_decoder_cf_qpsk_8_rand2(self): + prec = 8 + src_data = vectorize(complex)(2*random.randn(100), 2*random.randn(100)) + self.helper_no_lut(prec, src_data, digital.psk_4_0x0_0_1, digital.sd_psk_4_0x0_0_1) + + def test_constellation_soft_decoder_cf_qam16_3(self): + prec = 3 + src_data = (-1.0 - 1.0j, 1.0 - 1.0j, -1.0 + 1.0j, 1.0 + 1.0j, + -2.0 - 2.0j, 2.0 - 2.0j, -2.0 + 2.0j, 2.0 + 2.0j, + -0.2 - 0.2j, 0.2 - 0.2j, -0.2 + 0.2j, 0.2 + 0.2j, + 0.3 + 0.4j, 0.1 - 1.2j, -0.8 - 0.1j, -0.4 + 0.8j, + 0.8 + 1.0j, -0.5 + 0.1j, 0.1 + 1.2j, -1.7 - 0.9j) + self.helper_with_lut(prec, src_data, digital.qam_16_0x0_0_1_2_3, digital.sd_qam_16_0x0_0_1_2_3) + + def test_constellation_soft_decoder_cf_qam16_8(self): + prec = 8 + src_data = (-1.0 - 1.0j, 1.0 - 1.0j, -1.0 + 1.0j, 1.0 + 1.0j, + -2.0 - 2.0j, 2.0 - 2.0j, -2.0 + 2.0j, 2.0 + 2.0j, + -0.2 - 0.2j, 0.2 - 0.2j, -0.2 + 0.2j, 0.2 + 0.2j, + 0.3 + 0.4j, 0.1 - 1.2j, -0.8 - 0.1j, -0.4 + 0.8j, + 0.8 + 1.0j, -0.5 + 0.1j, 0.1 + 1.2j, -1.7 - 0.9j) + self.helper_with_lut(prec, src_data, digital.qam_16_0x0_0_1_2_3, digital.sd_qam_16_0x0_0_1_2_3) + + def test_constellation_soft_decoder_cf_qam16_8_rand(self): + prec = 8 + src_data = vectorize(complex)(2*random.randn(100), 2*random.randn(100)) + self.helper_with_lut(prec, src_data, digital.qam_16_0x0_0_1_2_3, digital.sd_qam_16_0x0_0_1_2_3) - actual_result = dst.data() # fetch the contents of the sink - #print "actual result", actual_result - #print "expected result", expected_result - self.assertFloatTuplesAlmostEqual(expected_result, actual_result, 5) + def test_constellation_soft_decoder_cf_qam16_8_rand2(self): + prec = 8 + #src_data = vectorize(complex)(2*random.randn(100), 2*random.randn(100)) + src_data = vectorize(complex)(2*random.randn(2), 2*random.randn(2)) + self.helper_no_lut(prec, src_data, digital.qam_16_0x0_0_1_2_3, digital.sd_qam_16_0x0_0_1_2_3) if __name__ == '__main__': - gr_unittest.run(test_constellation_soft_decoder, "test_constellation_soft_decoder.xml") - + #gr_unittest.run(test_constellation_soft_decoder, "test_constellation_soft_decoder.xml") + gr_unittest.run(test_constellation_soft_decoder) diff --git a/gr-digital/python/digital/qam_constellations.py b/gr-digital/python/digital/qam_constellations.py index 6f9f6bfab5..ed86d7e1e3 100755 --- a/gr-digital/python/digital/qam_constellations.py +++ b/gr-digital/python/digital/qam_constellations.py @@ -270,7 +270,7 @@ def sd_qam_16_0x0_0_1_2_3(x, Es=1): b2 = -abs(x_re) + boundary b0 = -abs(x_im) + boundary - return [(Es/2)*b3, (Es/2)*b2, (Es/2)*b1, (Es/2)*b0] + return [(Es/2.0)*b3, (Es/2.0)*b2, (Es/2.0)*b1, (Es/2.0)*b0] sd_qam_16 = sd_qam_16_0x0_0_1_2_3 sd_qam_16_0 = sd_qam_16 diff --git a/gr-digital/python/digital/soft_dec_lut_gen.py b/gr-digital/python/digital/soft_dec_lut_gen.py index 24d8bbdc2e..5bea27f843 100644 --- a/gr-digital/python/digital/soft_dec_lut_gen.py +++ b/gr-digital/python/digital/soft_dec_lut_gen.py @@ -1,30 +1,29 @@ #!/usr/bin/env python # -# Copyright 2013 Free Software Foundation, Inc. -# +# Copyright 2013-2014 Free Software Foundation, Inc. +# # This file is part of GNU Radio -# +# # GNU Radio is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3, or (at your option) # any later version. -# +# # GNU Radio is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with GNU Radio; see the file COPYING. If not, write to # the Free Software Foundation, Inc., 51 Franklin Street, # Boston, MA 02110-1301, USA. -# +# import numpy def soft_dec_table_generator(soft_dec_gen, prec, Es=1): - ''' - Builds a LUT that is a list of tuples. The tuple represents the + '''Builds a LUT that is a list of tuples. The tuple represents the soft decisions for the constellation/bit mapping at any given point in the complex space, (x,y). @@ -70,18 +69,19 @@ def soft_dec_table_generator(soft_dec_gen, prec, Es=1): (1,1) into an index value in the table and returns the tuple of soft decisions at that index. - Es is the energy per symbol. This is passed to the function to - provide the bounds when calling the generator function since they - don't know how the constellation was normalized. Using the - (maximum) energy per symbol for constellation allows us to provide - any scaling of the constellation (normalized to sum to 1, + Es is the maximum energy per symbol. This is passed to the + function to provide the bounds when calling the generator function + since they don't know how the constellation was normalized. Using + the (maximum) energy per symbol for constellation allows us to + provide any scaling of the constellation (normalized to sum to 1, normalized so the outside points sit on +/-1, etc.) but still calculate the soft decisions as we would given the full constellation. + ''' npts = 2.0**prec - maxd = Es*numpy.sqrt(2)/2 + maxd = Es*numpy.sqrt(2.0)/2.0 yrng = numpy.linspace(-maxd, maxd, npts) xrng = numpy.linspace(-maxd, maxd, npts) @@ -129,7 +129,7 @@ def soft_dec_table(constel, symbols, prec, npwr=1): table.append(decs) return table -def calc_soft_dec_from_table(sample, table, prec, Es=1): +def calc_soft_dec_from_table(sample, table, prec, Es=1.0): ''' Takes in a complex sample and converts it from the coordinates (-1,-1) to (1,1) into an index value. The index value points to a @@ -152,25 +152,25 @@ def calc_soft_dec_from_table(sample, table, prec, Es=1): calculate the soft decisions as we would given the full constellation. ''' - lut_scale = 2**prec - maxd = Es*numpy.sqrt(2)/2 - step = 2*maxd / lut_scale - scale = (lut_scale) / (2*maxd) - step - + lut_scale = 2.0**prec + maxd = Es*numpy.sqrt(2.0)/2.0 + scale = (lut_scale) / (2.0*maxd) + + alpha = 0.99 # to keep index within bounds xre = sample.real xim = sample.imag - xre = int((maxd + min(maxd, max(-maxd, xre))) * scale) - xim = int((maxd + min(maxd, max(-maxd, xim))) * scale) - index = int(xre + lut_scale*xim) + xre = ((maxd + min(alpha*maxd, max(-alpha*maxd, xre))) * scale) + xim = ((maxd + min(alpha*maxd, max(-alpha*maxd, xim))) * scale) + index = int(xre) + lut_scale*int(xim) max_index = lut_scale**2 - if(index > max_index): - return table[0]; - if(index < 0): - raise RuntimeError("calc_from_table: input sample out of range.") + while(index >= max_index): + index -= lut_scale; + while(index < 0): + index += lut_scale; - return table[index] + return table[int(index)] def calc_soft_dec(sample, constel, symbols, npwr=1): ''' @@ -192,25 +192,21 @@ def calc_soft_dec(sample, constel, symbols, npwr=1): than 0 are more likely to indicate a '0' bit and decisions greater than 0 are more likely to indicate a '1' bit. ''' - + M = len(constel) k = int(numpy.log2(M)) tmp = 2*k*[0,] s = k*[0,] - # Find a scaling factor for the constellation, however it was normalized. - constel = numpy.array(constel) - scale = min(min(abs(constel.real)), min(abs(constel.imag))) - for i in range(M): # Calculate the distance between the sample and the current # constellation point. - dist = abs(sample - constel[i])**2 + dist = abs(sample - constel[i]) # Calculate the probability factor from the distance and the # scaled noise power. - d = numpy.exp(-dist/(2*npwr*scale**2)) - + d = numpy.exp(-dist/npwr) + for j in range(k): # Get the bit at the jth index mask = 1<<j @@ -222,11 +218,37 @@ def calc_soft_dec(sample, constel, symbols, npwr=1): # else, add to the probability of a one else: tmp[2*j+1] += d - + # Calculate the log-likelihood ratio for all bits based on the # probability of ones (tmp[2*i+1]) over the probability of a zero # (tmp[2*i+0]). for i in range(k): - s[k-1-i] = (numpy.log(tmp[2*i+1]) - numpy.log(tmp[2*i+0])) * scale**2 + s[k-1-i] = (numpy.log(tmp[2*i+1]) - numpy.log(tmp[2*i+0])) return s + + +def show_table(table): + prec = int(numpy.sqrt(len(table))) + nbits = len(table[0]) + pp = "" + subi = 1 + subj = 0 + for i in reversed(xrange(prec+1)): + if(i == prec//2): + pp += "-----" + prec*((nbits*8)+3)*"-" + "\n" + subi = 0 + continue + for j in xrange(prec+1): + if(j == prec//2): + pp += "| " + subj = 1 + else: + item = table[prec*(i-subi) + (j-subj)] + pp += "( " + for t in xrange(nbits-1, -1, -1): + pp += "{0: .4f} ".format(item[t]) + pp += ") " + pp += "\n" + subj = 0 + print pp diff --git a/gr-filter/include/gnuradio/filter/rational_resampler_base_XXX.h.t b/gr-filter/include/gnuradio/filter/rational_resampler_base_XXX.h.t index d4ea2043f6..d5f8379804 100644 --- a/gr-filter/include/gnuradio/filter/rational_resampler_base_XXX.h.t +++ b/gr-filter/include/gnuradio/filter/rational_resampler_base_XXX.h.t @@ -36,6 +36,37 @@ namespace gr { * \brief Rational Resampling Polyphase FIR filter with @I_TYPE@ * input, @O_TYPE@ output and @TAP_TYPE@ taps. * \ingroup resamplers_blk + * + * Make a rational resampling FIR filter. If the input signal is + * at rate fs, then the output signal will be at a rate of \p + * interpolation * fs / \p decimation. + * + * The interpolation and decimation rates should be kept as + * small as possible, and generally should be relatively prime + * to help reduce complexity in memory and computation. + * + * The set of \p taps supplied to this filterbank should be + * designed around the resampling amount and must avoid aliasing + * (when interpolation/decimation < 1) and images (when + * interpolation/decimation > 1). + * + * As with any filter, the behavior of the filter taps (or + * coefficients) is determined by the highest sampling rate that + * the filter will ever see. In the case of a resampler that + * increases the sampling rate, the highest sampling rate observed + * is \p interpolation since in the filterbank, the number of + * filter arms is equal to \p interpolation. When the resampler + * decreases the sampling rate (decimation > interpolation), then + * the highest rate is the input sample rate of the original + * signal. We must create a filter based around this value to + * reduce any aliasing that may occur from out-of-band signals. + * + * Another way to think about how to create the filter taps is + * that the filter is effectively applied after interpolation and + * before decimation. And yet another way to think of it is that + * the taps should be a LPF that is at least as narrow as the + * narrower of the required anti-image postfilter or anti-alias + * prefilter. */ class FILTER_API @NAME@ : virtual public block { @@ -43,6 +74,13 @@ namespace gr { // gr::filter::@BASE_NAME@::sptr typedef boost::shared_ptr<@BASE_NAME@> sptr; + /*! + * Make a rational resampling FIR filter. + * + * \param interpolation The integer interpolation rate of the filter + * \param decimation The integer decimation rate of the filter + * \param taps The filter taps to control images and aliases + */ static sptr make(unsigned interpolation, unsigned decimation, const std::vector<@TAP_TYPE@> &taps); diff --git a/gr-filter/python/filter/rational_resampler.py b/gr-filter/python/filter/rational_resampler.py index 8f1dc36e0d..961ffc6880 100644 --- a/gr-filter/python/filter/rational_resampler.py +++ b/gr-filter/python/filter/rational_resampler.py @@ -40,16 +40,23 @@ def design_filter(interpolation, decimation, fractional_bw): if fractional_bw >= 0.5 or fractional_bw <= 0: raise ValueError, "Invalid fractional_bandwidth, must be in (0, 0.5)" - beta = 5.0 - trans_width = 0.5 - fractional_bw - mid_transition_band = 0.5 - trans_width/2 + beta = 7.0 + halfband = 0.5 + rate = float(interpolation)/float(decimation) + if(rate >= 1.0): + trans_width = halfband - fractional_bw + mid_transition_band = halfband - trans_width/2.0 + else: + trans_width = rate*(halfband - fractional_bw) + mid_transition_band = rate*halfband - trans_width/2.0 taps = filter.firdes.low_pass(interpolation, # gain - 1, # Fs - mid_transition_band/interpolation, # trans mid point - trans_width/interpolation, # transition width + interpolation, # Fs + mid_transition_band, # trans mid point + trans_width, # transition width filter.firdes.WIN_KAISER, beta) # beta + return taps @@ -84,19 +91,31 @@ class _rational_resampler_base(gr.hier_block2): fractional_bw = 0.4 d = gru.gcd(interpolation, decimation) - interpolation = interpolation // d - decimation = decimation // d + # If we have user-provided taps and the interp and decim + # values have a common divisor, we don't reduce these values + # by the GCD but issue a warning to the user that this might + # increase the complexity of the filter. + if taps and (d > 1): + gr.log.info("Rational resampler has user-provided taps but interpolation ({0}) and decimation ({1}) have a GCD of {2}, which increases the complexity of the filterbank. Consider reducing these values by the GCD.".format(interpolation, decimation, d)) + + # If we don't have user-provided taps, reduce the interp and + # decim values by the GCD (if there is one) and then define + # the taps from these new values. if taps is None: + interpolation = interpolation // d + decimation = decimation // d taps = design_filter(interpolation, decimation, fractional_bw) - resampler = resampler_base(interpolation, decimation, taps) + self.resampler = resampler_base(interpolation, decimation, taps) gr.hier_block2.__init__(self, "rational_resampler", - gr.io_signature(1, 1, resampler.input_signature().sizeof_stream_item(0)), - gr.io_signature(1, 1, resampler.output_signature().sizeof_stream_item(0))) + gr.io_signature(1, 1, self.resampler.input_signature().sizeof_stream_item(0)), + gr.io_signature(1, 1, self.resampler.output_signature().sizeof_stream_item(0))) - self.connect(self, resampler, self) + self.connect(self, self.resampler, self) + def taps(self): + return self.resampler.taps() class rational_resampler_fff(_rational_resampler_base): def __init__(self, interpolation, decimation, taps=None, fractional_bw=None): diff --git a/gr-qtgui/apps/gr_constellation_plot b/gr-qtgui/apps/gr_constellation_plot index 85caed6d05..528bb97e5a 100755 --- a/gr-qtgui/apps/gr_constellation_plot +++ b/gr-qtgui/apps/gr_constellation_plot @@ -69,9 +69,7 @@ class my_top_block(gr.top_block): self.qapp = QtGui.QApplication(sys.argv) self.skip = blocks.skiphead(gr.sizeof_gr_complex, self._start) - self.gui_snk = qtgui.const_sink_c(self._nsamps, - "GNU Radio Constellation Plot", - self._nsigs) + self.gui_snk = qtgui.const_sink_c(self._nsamps, "", self._nsigs) n = 0 self.srcs = list() self._data_min = sys.maxint @@ -185,4 +183,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_psd_plot_b b/gr-qtgui/apps/gr_psd_plot_b index 44ea997e6e..606311af48 100755 --- a/gr-qtgui/apps/gr_psd_plot_b +++ b/gr-qtgui/apps/gr_psd_plot_b @@ -49,7 +49,7 @@ class psd_plot_b(plot_base.plot_base): self.src_type = plot_base.source_chars_to_float self.gui_snk = qtgui.freq_sink_f(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio PSD Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): diff --git a/gr-qtgui/apps/gr_psd_plot_c b/gr-qtgui/apps/gr_psd_plot_c index 6cb065796a..6df9fae190 100755 --- a/gr-qtgui/apps/gr_psd_plot_c +++ b/gr-qtgui/apps/gr_psd_plot_c @@ -50,7 +50,7 @@ class psd_plot_c(plot_base.plot_base): self.src_type = blocks.vector_source_c self.gui_snk = qtgui.freq_sink_c(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio PSD Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): @@ -77,4 +77,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_psd_plot_f b/gr-qtgui/apps/gr_psd_plot_f index 903a237e64..f07e3e8b50 100755 --- a/gr-qtgui/apps/gr_psd_plot_f +++ b/gr-qtgui/apps/gr_psd_plot_f @@ -50,7 +50,7 @@ class psd_plot_f(plot_base.plot_base): self.src_type = blocks.vector_source_f self.gui_snk = qtgui.freq_sink_f(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio PSD Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): @@ -77,4 +77,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_psd_plot_i b/gr-qtgui/apps/gr_psd_plot_i index 3413469b7c..1852345823 100755 --- a/gr-qtgui/apps/gr_psd_plot_i +++ b/gr-qtgui/apps/gr_psd_plot_i @@ -49,7 +49,7 @@ class psd_plot_i(plot_base.plot_base): self.src_type = plot_base.source_ints_to_float self.gui_snk = qtgui.freq_sink_f(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio PSD Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): @@ -76,4 +76,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_psd_plot_s b/gr-qtgui/apps/gr_psd_plot_s index 07a573b56a..c06076f1f9 100755 --- a/gr-qtgui/apps/gr_psd_plot_s +++ b/gr-qtgui/apps/gr_psd_plot_s @@ -49,7 +49,7 @@ class psd_plot_s(plot_base.plot_base): self.src_type = plot_base.source_shorts_to_float self.gui_snk = qtgui.freq_sink_f(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio PSD Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): diff --git a/gr-qtgui/apps/gr_spectrogram_plot_b b/gr-qtgui/apps/gr_spectrogram_plot_b index b20567cd2d..0d7a16ea6e 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_b +++ b/gr-qtgui/apps/gr_spectrogram_plot_b @@ -49,7 +49,7 @@ class spectrogram_plot_b(plot_base.plot_base): self.src_type = plot_base.source_chars_to_float self.gui_snk = qtgui.waterfall_sink_f(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio Spectrogram Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): @@ -76,4 +76,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_spectrogram_plot_c b/gr-qtgui/apps/gr_spectrogram_plot_c index 122f4ec5d6..52b0d4dff7 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_c +++ b/gr-qtgui/apps/gr_spectrogram_plot_c @@ -50,7 +50,7 @@ class spectrogram_plot_c(plot_base.plot_base): self.src_type = blocks.vector_source_c self.gui_snk = qtgui.waterfall_sink_c(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio Spectrogram Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): @@ -77,4 +77,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_spectrogram_plot_f b/gr-qtgui/apps/gr_spectrogram_plot_f index 41212eaaf7..6ea5afc4ef 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_f +++ b/gr-qtgui/apps/gr_spectrogram_plot_f @@ -50,7 +50,7 @@ class spectrogram_plot_f(plot_base.plot_base): self.src_type = blocks.vector_source_f self.gui_snk = qtgui.waterfall_sink_f(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio Spectrogram Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): @@ -77,4 +77,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_spectrogram_plot_i b/gr-qtgui/apps/gr_spectrogram_plot_i index 6a076c9546..893df2a234 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_i +++ b/gr-qtgui/apps/gr_spectrogram_plot_i @@ -49,7 +49,7 @@ class spectrogram_plot_i(plot_base.plot_base): self.src_type = plot_base.source_ints_to_float self.gui_snk = qtgui.waterfall_sink_f(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio Spectrogram Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): @@ -76,4 +76,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_spectrogram_plot_s b/gr-qtgui/apps/gr_spectrogram_plot_s index 61fa826e90..82a22f740d 100755 --- a/gr-qtgui/apps/gr_spectrogram_plot_s +++ b/gr-qtgui/apps/gr_spectrogram_plot_s @@ -49,7 +49,7 @@ class spectrogram_plot_s(plot_base.plot_base): self.src_type = plot_base.source_shorts_to_float self.gui_snk = qtgui.waterfall_sink_f(self._psd_size, filter.firdes.WIN_BLACKMAN_hARRIS, self._center_freq, self._samp_rate, - "GNU Radio Spectrogram Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): @@ -76,4 +76,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_time_plot_b b/gr-qtgui/apps/gr_time_plot_b index 20522095de..d822557f1b 100755 --- a/gr-qtgui/apps/gr_time_plot_b +++ b/gr-qtgui/apps/gr_time_plot_b @@ -47,7 +47,7 @@ class plot_time_b(plot_base.plot_base): self.dsize = gr.sizeof_float # already converted self.src_type = plot_base.source_chars_to_float self.gui_snk = qtgui.time_sink_f(self._nsamps, self._samp_rate, - "GNU Radio Time Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): diff --git a/gr-qtgui/apps/gr_time_plot_c b/gr-qtgui/apps/gr_time_plot_c index d3d00b5cf1..202e0f88f4 100755 --- a/gr-qtgui/apps/gr_time_plot_c +++ b/gr-qtgui/apps/gr_time_plot_c @@ -48,7 +48,7 @@ class plot_time_c(plot_base.plot_base): self.dsize = gr.sizeof_gr_complex self.src_type = blocks.vector_source_c self.gui_snk = qtgui.time_sink_c(self._nsamps, self._samp_rate, - "GNU Radio Time Plot", self._nsigs) + "", self._nsigs) self._nsigs *= 2 # complex plots have real/imag self.setup() @@ -74,4 +74,3 @@ if __name__ == "__main__": main() except KeyboardInterrupt: pass - diff --git a/gr-qtgui/apps/gr_time_plot_f b/gr-qtgui/apps/gr_time_plot_f index 9140b61220..8f5ad9f60d 100755 --- a/gr-qtgui/apps/gr_time_plot_f +++ b/gr-qtgui/apps/gr_time_plot_f @@ -48,7 +48,7 @@ class plot_time_f(plot_base.plot_base): self.dsize = gr.sizeof_float self.src_type = blocks.vector_source_f self.gui_snk = qtgui.time_sink_f(self._nsamps, self._samp_rate, - "GNU Radio Time Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): diff --git a/gr-qtgui/apps/gr_time_plot_i b/gr-qtgui/apps/gr_time_plot_i index 04229de0cd..8a7888b451 100755 --- a/gr-qtgui/apps/gr_time_plot_i +++ b/gr-qtgui/apps/gr_time_plot_i @@ -47,7 +47,7 @@ class plot_time_i(plot_base.plot_base): self.dsize = gr.sizeof_float # already converted self.src_type = plot_base.source_ints_to_float self.gui_snk = qtgui.time_sink_f(self._nsamps, self._samp_rate, - "GNU Radio Time Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): diff --git a/gr-qtgui/apps/gr_time_plot_s b/gr-qtgui/apps/gr_time_plot_s index cc4a8a7812..7cee262379 100755 --- a/gr-qtgui/apps/gr_time_plot_s +++ b/gr-qtgui/apps/gr_time_plot_s @@ -47,7 +47,7 @@ class plot_time_s(plot_base.plot_base): self.dsize = gr.sizeof_float # already converted self.src_type = plot_base.source_shorts_to_float self.gui_snk = qtgui.time_sink_f(self._nsamps, self._samp_rate, - "GNU Radio Time Plot", self._nsigs) + "", self._nsigs) self.setup() def main(): diff --git a/gr-qtgui/apps/gr_time_raster_b b/gr-qtgui/apps/gr_time_raster_b index 3e81c317d6..ad8691489c 100755 --- a/gr-qtgui/apps/gr_time_raster_b +++ b/gr-qtgui/apps/gr_time_raster_b @@ -51,7 +51,7 @@ class plot_time_raster_b(plot_base.plot_base): self.dsize = gr.sizeof_char self.src_type = blocks.vector_source_b self.gui_snk = qtgui.time_raster_sink_b(self._samp_rate, self._nrows, self._ncols, - [], [], "GNU Radio Time Plot", self._nsigs) + [], [], "", self._nsigs) self.setup() def main(): diff --git a/gr-qtgui/apps/gr_time_raster_f b/gr-qtgui/apps/gr_time_raster_f index 6b5e5c20e9..5d6a8389cf 100755 --- a/gr-qtgui/apps/gr_time_raster_f +++ b/gr-qtgui/apps/gr_time_raster_f @@ -51,7 +51,7 @@ class plot_time_raster_f(plot_base.plot_base): self.dsize = gr.sizeof_float self.src_type = blocks.vector_source_f self.gui_snk = qtgui.time_raster_sink_f(self._samp_rate, self._nrows, self._ncols, - [], [], "GNU Radio Time Plot", self._nsigs) + [], [], "", self._nsigs) self.setup() def main(): diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc index 3fc592481f..7b81c86d2e 100644 --- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc +++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc @@ -85,6 +85,11 @@ public: d_unitType = type; } + std::string unitType() + { + return d_unitType; + } + void setYUnitType(const std::string &type) { d_yUnitType = type; @@ -474,7 +479,8 @@ TimeDomainDisplayPlot::setSampleRate(double sr, double units, const std::string &strunits) { double newsr = sr/units; - if(newsr != d_sample_rate) { + if((newsr != d_sample_rate) || + (((TimeDomainDisplayZoomer*)d_zoomer)->unitType() != strunits)) { d_sample_rate = sr/units; _resetXAxisPoints(); diff --git a/gr-qtgui/lib/sink_c_impl.cc b/gr-qtgui/lib/sink_c_impl.cc index ed2512b00c..c1ee694213 100644 --- a/gr-qtgui/lib/sink_c_impl.cc +++ b/gr-qtgui/lib/sink_c_impl.cc @@ -265,7 +265,7 @@ namespace gr { sink_c_impl::fft(float *data_out, const gr_complex *data_in, int size) { if (d_window.size()) { - volk_32fc_32f_multiply_32fc_a(d_fft->get_inbuf(), data_in, + volk_32fc_32f_multiply_32fc(d_fft->get_inbuf(), data_in, &d_window.front(), size); } else { @@ -273,8 +273,8 @@ namespace gr { } d_fft->execute (); // compute the fft - volk_32fc_s32f_x2_power_spectral_density_32f_a(data_out, d_fft->get_outbuf(), - size, 1.0, size); + volk_32fc_s32f_x2_power_spectral_density_32f(data_out, d_fft->get_outbuf(), + size, 1.0, size); } void diff --git a/gr-qtgui/lib/sink_f_impl.cc b/gr-qtgui/lib/sink_f_impl.cc index e2263f7150..d9bc526dbf 100644 --- a/gr-qtgui/lib/sink_f_impl.cc +++ b/gr-qtgui/lib/sink_f_impl.cc @@ -268,8 +268,8 @@ namespace gr { } d_fft->execute (); // compute the fft - volk_32fc_s32f_x2_power_spectral_density_32f_a(data_out, d_fft->get_outbuf(), - size, 1.0, size); + volk_32fc_s32f_x2_power_spectral_density_32f(data_out, d_fft->get_outbuf(), + size, 1.0, size); } void diff --git a/gr-uhd/doc/uhd.dox b/gr-uhd/doc/uhd.dox index 7a71b240b4..2b7f308984 100644 --- a/gr-uhd/doc/uhd.dox +++ b/gr-uhd/doc/uhd.dox @@ -25,11 +25,11 @@ by using: Ettus Research maintains the comprehensive documentation to the underlying UHD driver, which can be found at: -http://files.ettus.com/uhd_docs/manual/html/ +http://files.ettus.com/manual/ -The UHD Doxygen page is located at: +The list of classes in the UHD Doxygen is located at: -http://files.ettus.com/uhd_docs/doxygen/html/index.html +http://files.ettus.com/manual/annotated.html \section uhd_command_syntax Command Syntax |