Skip to content

Commit

Permalink
tests/blocks/signal/frequencytranslator: add conditional epsilon on l…
Browse files Browse the repository at this point in the history
…iquid
  • Loading branch information
vsergeev committed Dec 13, 2019
1 parent 59bfb72 commit ef47b90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/blocks/signal/frequencytranslator_spec.gen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jigs.TestBlock(radio.FrequencyTranslatorBlock, {
inputs = {radio.types.ComplexFloat32.vector_from_array({{-0.73127151, 0.69486749}, {0.52754927, -0.48986191}, {-0.00912983, -0.10101787}, {0.30318594, 0.57744670}, {-0.81228077, -0.94330502}, {0.67153019, -0.13446586}, {0.52456015, -0.99578792}, {-0.10922561, 0.44308007}, {-0.54247558, 0.89054137}, {0.80285490, -0.93882000}, {-0.94910830, 0.08282494}, {0.87829834, -0.23759152}, {-0.56680119, -0.15576684}, {-0.94191837, -0.55661666}, {-0.12422481, -0.00837552}, {-0.53383112, -0.53826690}, {-0.56243795, -0.08079307}, {-0.42043677, -0.95702058}, {0.67515594, 0.11290865}, {0.28458872, -0.62818748}, {0.98508680, 0.71989304}, {-0.75822008, -0.33460963}, {0.44296879, 0.42238355}, {0.87288117, -0.15578599}, {0.66007137, 0.34061113}, {-0.39326301, 0.17516121}, {0.76495802, 0.69239485}, {0.01056764, 0.17800452}, {-0.93094832, -0.51452005}, {0.59480852, -0.17137200}, {-0.65398520, 0.09759752}, {0.40608153, 0.34897169}, {-0.25059396, -0.12207674}, {0.01685298, 0.55688524}, {0.04187684, -0.21348982}, {-0.02061296, -0.94085008}, {-0.91302544, 0.40676415}, {0.96637541, 0.18636747}, {-0.21280062, -0.65930158}, {0.00447712, 0.96415329}, {0.54104626, 0.07923490}, {0.72057962, -0.53564775}, {0.02754333, 0.90493482}, {0.15558961, -0.08173654}, {-0.46144104, 0.09599262}, {0.91423255, -0.98858166}, {0.56731045, 0.64097184}, {0.77235913, 0.48100683}, {0.61827981, 0.03735657}, {0.12271573, -0.14781864}, {-0.88775343, 0.74002033}, {0.13999867, -0.60032117}, {0.00944094, -0.03014978}, {-0.28642008, -0.30784416}, {0.07695759, 0.24697889}, {0.22490492, -0.08370640}, {-0.94405001, -0.54078996}, {-0.64557749, 0.16892174}, {0.72201771, 0.59687787}, {0.59419513, 0.63287473}, {-0.48941192, 0.68348968}, {0.34622705, -0.83353174}, {-0.96661872, -0.97087997}, {0.51117355, -0.50088155}, {-0.78102273, 0.24960417}, {-0.31115428, -0.86096931}, {-0.68074894, 0.05476080}, {-0.66371012, -0.45417112}, {0.42317989, -0.09059674}, {-0.35599643, -0.05245798}, {-0.95273077, -0.22688580}, {-0.15816264, -0.62392139}, {-0.78247666, 0.79963702}, {0.02023196, -0.58181804}, {0.21129727, 0.63407934}, {-0.95836377, -0.96427095}, {-0.70707649, 0.43767095}, {-0.67954481, 0.40921125}, {0.35635161, 0.08940433}, {-0.55880052, 0.95118904}, {0.59562171, 0.03319904}, {-0.55360842, 0.29701284}, {-0.21020398, 0.15169193}, {-0.35750839, 0.26189572}, {-0.88242978, -0.40278813}, {0.93580663, 0.75106847}, {-0.38722676, 0.71702880}, {-0.37927276, 0.87857687}, {0.48768425, -0.16765547}, {-0.49528381, -0.98303950}, {0.75743574, -0.92416686}, {0.63882822, 0.92440224}, {0.14056113, -0.65696579}, {0.73556215, 0.94755048}, {0.40804628, 0.01774749}, {-0.24406233, -0.30613822}, {-0.58847648, 0.34830603}, {-0.13409975, -0.61176270}, {-0.79115158, 0.33191505}, {-0.40785465, -0.00040016}, {-0.34930867, 0.74324304}, {0.79935658, -0.96381402}, {-0.59829396, -0.34451860}, {0.97409946, 0.56540078}, {-0.32180870, -0.57394040}, {0.34891015, 0.67540216}, {0.86437494, -0.31230038}, {0.76478642, 0.37422037}, {-0.03100256, 0.97101647}, {-0.53071910, 0.45093039}, {-0.83063954, -0.66061169}, {0.82197559, -0.57406360}, {0.51823235, 0.20041765}, {0.68226439, -0.26378399}, {-0.31942952, -0.41756943}, {0.73483962, 0.20796506}, {0.90861493, 0.77453023}, {-0.72930807, 0.10234095}, {-0.79145002, -0.92172438}, {-0.85361314, 0.73233670}, {0.57623291, 0.65701193}, {-0.31820506, 0.23037209}, {0.56380719, -0.24392074}, {0.14156306, -0.55257183}, {-0.83651346, -0.46655273}, {0.78153634, 0.12889367}, {0.85013437, -0.08446148}, {-0.44563445, 0.57402933}, {0.65553629, -0.97523654}, {0.34082329, -0.81663376}, {-0.76979506, 0.77012014}, {-0.91995299, -0.52073330}, {0.97631699, -0.15797283}, {-0.76888371, -0.66523314}, {-0.51715940, 0.48801285}, {-0.79433179, 0.82152885}, {-0.24344546, 0.94052809}, {0.81844544, -0.41195285}, {-0.49317971, -0.04597981}, {-0.79974169, 0.30410039}, {-0.92075950, -0.97898769}, {0.96516722, -0.40890029}, {0.19314128, -0.10031093}, {-0.37343827, -0.87407041}, {0.82678401, 0.93962657}, {0.93959302, -0.77727538}, {-0.56961346, 0.23561376}, {0.95990574, 0.08582640}, {0.37637961, 0.32366887}, {-0.48182800, 0.08320452}, {-0.38535777, -0.50723761}, {-0.83726245, -0.43842655}, {0.96675342, -0.10419552}, {0.30402106, 0.28693217}, {0.88146901, -0.21904290}, {-0.38643140, -0.34551716}, {-0.36652973, 0.69426954}, {0.78700048, -0.39438137}, {-0.33133319, 0.08845083}, {0.15797088, 0.19192508}, {-0.50980401, -0.95925194}, {-0.51248139, -0.85534495}, {0.10240951, -0.85816729}, {-0.84974039, 0.27076420}, {-0.41835687, 0.58436954}, {-0.01347791, 0.72529793}, {-0.69164079, 0.00285917}, {0.58996701, -0.84578598}, {0.89845592, -0.65351576}, {0.55241799, 0.96979177}, {0.64310026, -0.36043200}, {-0.78624445, 0.02871650}, {0.83871394, -0.41302100}, {0.78751761, -0.71663874}, {0.82096338, -0.93648010}, {-0.36786264, 0.80617654}, {0.60771257, 0.81430751}, {0.68143702, 0.49236977}, {0.37919036, -0.64369029}, {-0.13472399, -0.68420619}, {0.42964891, 0.33555749}, {-0.49482721, -0.87117159}, {0.92677176, 0.61650527}, {0.09853987, 0.08275530}, {0.70258534, -0.09338064}, {-0.20857909, -0.32266170}, {-0.48406181, -0.95118302}, {0.29287767, -0.16663224}, {0.14120726, -0.87535673}, {-0.29011312, -0.72343177}, {-0.74974197, -0.48177409}, {0.65786874, -0.20440537}, {-0.19783570, 0.22488984}, {-0.53294069, -0.98504567}, {0.05740348, 0.00179924}, {0.29767919, -0.12336609}, {0.37302625, 0.46284387}, {-0.52325064, -0.00985550}, {-0.04234622, -0.54987586}, {-0.17550774, 0.12081487}, {0.81387901, 0.83541310}, {-0.44954929, 0.29283035}, {-0.90360534, -0.85689718}, {0.02338342, 0.75484818}, {-0.68106455, 0.53205574}, {0.76601923, -0.37639597}, {0.38511392, 0.69798225}, {-0.25677133, 0.40256533}, {0.47283623, 0.18915559}, {0.71255422, 0.79320872}, {0.92015761, 0.14246538}, {-0.64744818, -0.49880919}, {-0.56476265, 0.13903470}, {0.51550025, -0.89573354}, {0.36327291, 0.43430653}, {-0.30403697, 0.03011161}, {-0.67040372, 0.45979229}, {-0.91858262, 0.96244210}, {0.61588746, 0.25689700}, {-0.46494752, 0.82572573}, {0.91887766, -0.72174770}, {0.55151451, 0.68386173}, {0.31943470, 0.40081555}, {-0.10988253, 0.84861559}, {0.94241506, -0.23529337}, {0.60542303, -0.13415682}, {-0.67049158, -0.34906545}, {-0.74733984, 0.81776953}, {0.91884816, -0.76162654}, {0.20135815, -0.18355180}, {-0.76381993, -0.40904897}, {-0.50356728, 0.49915361}, {-0.99198210, -0.62032259}, {-0.12245386, -0.95793062}, {0.25505316, 0.21125507}, {0.67066473, -0.58678836}, {-0.43043676, 0.08467886}, {-0.45354861, 0.17147619}, {-0.49823555, 0.36705431}, {0.58218145, 0.61730921}, {0.94723225, 0.09075401}, {-0.01838144, 0.71139538}, {0.53813475, 0.14108926}, {-0.23348723, -0.43190512}, {-0.78372163, 0.61509818}, {-0.76385695, 0.49453047}, {0.09057418, 0.92989063}, {0.52213132, 0.94703954}, {-0.72681195, 0.00074295}, {0.14515658, -0.37749708}, {0.00606498, -0.28636247}, {0.05678794, -0.99831057}, {-0.11537134, -0.10089571}, {-0.39040163, -0.20119449}, {0.56617463, 0.36682576}, {-0.01540173, 0.29533648}})},
outputs = {radio.types.ComplexFloat32.vector_from_array({{-0.73127151, 0.69486749}, {0.08622092, 0.71472991}, {-0.09325244, 0.03989922}, {0.10990612, 0.64287406}, {1.21160972, 0.28570315}, {-0.13446586, -0.67153019}, {1.00968754, -0.49728063}, {-0.03303955, -0.45514676}, {0.67932099, 0.79111737}, {1.23142767, 0.09769869}, {0.94910830, -0.08282494}, {0.32403523, -0.85021108}, {-0.02700812, -0.58719462}, {0.72381365, 0.82044274}, {-0.10542300, 0.06624157}, {0.53826690, -0.53383112}, {0.40753287, 0.39595568}, {-0.69559479, -0.78025860}, {-0.31601715, 0.60722077}, {-0.67549139, 0.13900222}, {0.98508680, 0.71989304}, {0.71637547, -0.41673431}, {0.26482576, -0.55181205}, {0.87829989, 0.12157384}, {-0.73421514, 0.11242002}, {0.17516121, 0.39326301}, {0.21188459, 1.00979018}, {-0.06505685, -0.16602679}, {-0.77701652, 0.72638905}, {0.48826253, 0.38048029}, {0.65398520, -0.09759752}, {0.52101278, -0.12340644}, {0.03866409, -0.27605280}, {0.15605888, -0.53483719}, {-0.09160709, -0.19733147}, {0.94085008, -0.02061296}, {0.97774309, 0.20758376}, {0.97666836, -0.12138042}, {0.69279206, 0.00134997}, {0.77738482, -0.57033712}, {0.54104626, 0.07923490}, {0.00980207, 0.89780700}, {0.85213280, -0.30583552}, {0.17323250, -0.02965624}, {0.31689060, -0.34888789}, {-0.98858166, -0.91423255}, {0.08221003, 0.85201383}, {-0.88319647, -0.21879259}, {0.22658719, -0.57647526}, {0.19171828, 0.01239349}, {0.88775343, -0.74002033}, {-0.40338087, -0.46612123}, {0.03159156, -0.00033793}, {0.17727262, 0.38128588}, {0.20743056, 0.15457559}, {0.08370640, 0.22490492}, {0.44588417, 0.99240696}, {-0.56178105, 0.36014855}, {-0.79078037, 0.50223422}, {0.16274726, -0.85270840}, {-0.48941192, 0.68348968}, {0.47083417, 0.77004123}, {-0.62466013, 1.21932745}, {0.64093584, -0.31840533}, {0.48514703, -0.66100764}, {-0.86096931, 0.31115428}, {-0.58292502, -0.35583174}, {0.77157241, 0.22684470}, {0.04460716, -0.43046394}, {-0.16681005, -0.31884119}, {0.95273077, 0.22688580}, {-0.59772867, -0.23877552}, {-1.00229859, -0.49707812}, {-0.19903341, 0.54708987}, {0.54364556, 0.38878351}, {0.96427095, -0.95836377}, {0.82929349, 0.06152588}, {-0.51983231, 0.59917396}, {-0.19514728, 0.31128305}, {1.09798276, -0.10701579}, {0.59562171, 0.03319904}, {0.08511442, -0.62245840}, {0.20922421, 0.15304048}, {-0.42094094, 0.13860145}, {0.95065361, -0.19281676}, {0.75106847, -0.93580663}, {-0.73473203, 0.35248232}, {0.08921465, -0.95277804}, {-0.00874710, -0.51562369}, {0.50417513, -0.97850919}, {-0.75743574, 0.92416686}, {1.12335098, 0.02652711}, {0.66824734, -0.06933202}, {-0.40675196, -1.12847531}, {0.34054807, -0.22548556}, {0.30613822, -0.24406233}, {0.68081665, 0.06411231}, {-0.31658152, -0.54038179}, {-0.07119070, -0.85499728}, {0.23940720, 0.33019653}, {-0.34930867, 0.74324304}, {0.30989194, 1.21320868}, {-0.14277364, 0.67547351}, {0.75170523, 0.83874142}, {0.59770238, 0.27517313}, {0.67540216, -0.34891015}, {0.88285959, 0.25541052}, {-0.84299558, -0.11957271}, {0.91391122, 0.32954580}, {-0.67675924, -0.16431054}, {0.83063954, 0.66061169}, {0.01871791, -1.00241828}, {-0.03046592, 0.55480075}, {-0.73038578, 0.04004218}, {-0.50386506, -0.15006481}, {-0.20796506, 0.73483962}, {-0.27982751, -1.16067863}, {-0.66198814, 0.32270062}, {1.12118351, -0.46788523}, {1.09421408, 0.26013082}, {0.57623291, 0.65701193}, {0.00066130, -0.39284259}, {-0.40620843, -0.46083686}, {0.30538857, -0.48178166}, {0.95098644, -0.11424118}, {0.12889367, -0.78153634}, {0.73741835, 0.43136567}, {0.24643874, -0.68364292}, {-0.72493321, -0.92481673}, {0.86100149, -0.20427343}, {0.76979506, -0.77012014}, {-0.96201682, 0.43817827}, {0.45193964, 0.87971640}, {0.52568352, 0.87027246}, {-0.13154399, 0.69878936}, {-0.82152885, -0.79433179}, {0.74978006, -0.61780959}, {0.65108746, -0.64470398}, {0.19613031, -0.45483324}, {0.71609873, 0.46825886}, {-0.92075950, -0.97898769}, {-0.23650375, 1.02118230}, {-0.15508530, -0.15269050}, {-0.08505830, -0.94668913}, {-1.22118092, -0.27420241}, {-0.77727538, -0.93959302}, {-0.59931725, -0.14419484}, {-0.93944645, 0.21500143}, {0.42413509, -0.25793910}, {-0.35052526, -0.34090066}, {0.38535777, 0.50723761}, {-0.84682506, 0.41965893}, {0.39783907, 0.88723898}, {-0.20047429, -0.36683640}, {0.58437324, -0.69532394}, {0.34551716, -0.38643140}, {0.70461017, -0.34623510}, {0.62661135, -0.61827552}, {0.01826586, -0.34244940}, {0.06241770, -0.24061185}, {-0.50980401, -0.95925194}, {0.99321759, 0.08815300}, {-0.84781194, 0.16779104}, {-0.89182186, -0.00507218}, {-0.00502598, -0.71866888}, {0.72529793, 0.01347791}, {-0.56122971, -0.40422314}, {-0.29972970, 0.98670018}, {-0.34389225, -1.05642986}, {-0.45987487, 1.01694489}, {-0.64310026, 0.36043200}, {-0.43891075, 0.65296429}, {0.65198320, 0.67003387}, {-0.97042733, 0.43820763}, {0.11372417, -1.24017847}, {-0.80617654, -0.36786264}, {-0.01301187, -1.01599312}, {0.80023575, 0.25769585}, {0.49500957, 0.55954272}, {-0.47434568, 0.51116031}, {0.42964891, 0.33555749}, {0.99564475, 0.11173820}, {0.29994315, -1.07192290}, {0.06814419, 0.10915546}, {-0.51351571, 0.48851582}, {-0.32266170, 0.20857909}, {0.16747710, -1.05404758}, {-0.22705103, 0.24898086}, {-0.78887832, -0.40479621}, {0.41474441, -0.65992898}, {0.74974197, 0.48177409}, {0.22131813, -0.65237343}, {-0.27501756, -0.11865816}, {0.20246089, 1.10152185}, {0.04749795, -0.03228530}, {0.12336609, 0.29767919}, {-0.02973178, -0.59370792}, {-0.50068647, 0.15232021}, {0.53604877, 0.12964734}, {0.20090213, 0.07097554}, {0.81387901, 0.83541310}, {0.02733372, -0.53581440}, {-0.53572828, 1.12417555}, {-0.21102197, 0.72512919}, {0.23825827, -0.83076179}, {-0.37639597, -0.76601923}, {-0.09869996, 0.79104376}, {0.11980451, -0.46220911}, {0.32601210, -0.39124167}, {-0.22289050, 1.04270482}, {-0.92015761, -0.14246538}, {-0.78410560, 0.23060387}, {-0.30675113, -0.49415714}, {-0.76706672, 0.69259489}, {0.54917294, 0.13783491}, {-0.03011161, -0.30403697}, {0.81262708, 0.02207363}, {-0.57621306, 1.19919443}, {-0.43464327, 0.50635827}, {0.94131541, -0.10919896}, {0.91887766, -0.72174770}, {-0.87742788, 0.04422078}, {0.28248751, -0.42765927}, {-0.36674115, 0.77312583}, {-0.62412786, 0.74429405}, {-0.13415682, -0.60542303}, {-0.33726358, -0.67650497}, {0.45805776, -1.00868583}, {-0.44041023, -1.10923219}, {0.26685187, 0.05501314}, {0.76381993, 0.40904897}, {0.10783434, 0.70078963}, {0.28342250, -1.13512135}, {-0.17955630, 0.94888651}, {0.33051497, 0.02099246}, {0.58678836, 0.67066473}, {0.39800364, 0.18449774}, {-0.37836131, 0.30323780}, {-0.19512616, -0.58727622}, {0.15721598, -0.83383989}, {0.94723225, 0.09075401}, {-0.56472659, -0.43301862}, {-0.03210892, -0.55539560}, {-0.08859354, -0.48291773}, {0.27249849, -0.95828485}, {0.49453047, 0.76385695}, {-0.47329992, 0.80553550}, {-0.78922772, -0.73934072}, {-0.22389066, 0.69146883}, {0.39072245, -0.10445308}, {-0.00606498, 0.28636247}, {-0.77427107, -0.63273466}, {0.06030582, -0.14090315}, {0.30912149, 0.31198809}, {0.67365968, -0.03602082}, {-0.29533648, -0.01540173}})}
},
}, {epsilon = 2.0e-05})
}, {epsilon = (radio.platform.features.liquid and not radio.platform.features.volk) and 5e-3 or 1e-5})
5 changes: 3 additions & 2 deletions tests/blocks/signal/frequencytranslator_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ def process(offset, x):
vectors.append(TestVector([0.5], [x], process(0.5, x), "0.5 offset, 256 ComplexFloat32 input, 256 ComplexFloat32 output"))
vectors.append(TestVector([0.7], [x], process(0.7, x), "0.7 offset, 256 ComplexFloat32 input, 256 ComplexFloat32 output"))

# FIXME why does this need 2e-5 epsilon?
return BlockSpec("FrequencyTranslatorBlock", vectors, 2e-5)
# FIXME liquid-dsp implementation has less precision (5e-3)
# FIXME why does this need 1e-5 epsilon?
return BlockSpec("FrequencyTranslatorBlock", vectors, "(radio.platform.features.liquid and not radio.platform.features.volk) and 5e-3 or 1e-5")

0 comments on commit ef47b90

Please sign in to comment.