root/applications/pmsm/simulator_zdenek/ekf_example/RArandn.h @ 1469

Revision 1469, 14.6 kB (checked in by smidl, 10 years ago)

upravy rand

Line 
1#define MAXrandn 997    //1000
2static const float RArandn[MAXrandn]={-0.2895823932,-1.6226019832,0.1683147268,0.3306588368,-1.1034889832,1.2338979168,1.2321466168,0.0053491398,0.3702747768,0.2176215568,-0.1437261632,0.7687729668,-0.5453341232,2.2261682168,-0.0934134632,0.1569137268,1.1097506168,0.1022638778,-0.0526659882,-0.7893670432,0.3373932368,-1.2931994832,0.7573069668,1.6665445168,-0.6487932832,0.9009790868,1.2969838168,-1.5507471832,-1.3979819832,0.6141300368,-0.3569031632,0.7329797968,0.8586047068,0.7548907368,1.3332322168,0.7115829268,1.2338205168,-1.1594746832,0.0231928588,-0.1137348832,-1.5611031832,0.3002866468,-1.0134904832,1.4581239168,-0.7621079832,0.5717254268,0.2623030868,-0.8789192032,-2.1276920832,-0.0162054082,-0.9676512832,0.6574454668,0.5507232068,1.7354123168,0.6342650068,-0.6006127832,0.4233196668,-0.9661330832,0.0234717468,-0.0052383722,0.0430256086,-0.2748770332,1.1379861168,-1.8310078832,0.4711656868,0.9386208868,0.7739397568,0.6208397668,0.0832964488,0.7200716068,0.6118826268,-0.2126630032,-0.3344865432,-0.2529046932,-1.4321520832,-0.1910216332,0.1614272568,0.3577914568,1.4864906168,-0.3079923232,0.6662162668,0.8420310368,0.9838723568,-0.9491093232,0.2550175668,0.2808644868,-0.9647809832,-0.6990623332,1.1252774168,-0.0885172832,0.4328629068,0.1309695238,-0.5924828132,-0.5165908832,0.4866359068,-0.9069213832,0.8241640368,0.6119430668,-0.7787318732,-0.2226244332,-1.1447945832,-2.1593382832,1.0293198068,-0.4756526532,0.3703499768,0.2770394268,0.0644485558,-0.9609620832,-0.9041636432,-0.3314467832,-1.1429037832,-1.0129204832,1.5154623168,0.0987262488,-1.1743350832,0.0017552828,-1.0853614832,-1.3062950832,-0.2181192032,0.9964478668,0.1716268468,0.6994499268,-1.1248369832,-0.4176227632,-0.2194575332,-1.1701696832,-1.2764545832,0.9741999268,0.0542273128,-0.6021634032,0.8487112068,0.2746084268,-0.9467772532,1.3825681168,0.3324844468,1.5218995168,1.1810104168,-0.6411561732,-1.2489535832,-0.0299438592,-0.2876164632,-0.8006452232,0.5407520768,1.5314729168,-0.5034934732,-0.8037757432,-0.2033541132,0.7060065668,-0.8112149532,-1.1583323832,-0.0768870132,-0.0223115982,0.5282779768,-0.5525084832,-0.1066853232,-0.3917695132,-0.0363478062,1.5781347168,-0.5635004432,-1.3043802832,0.5123655368,-0.8605845232,0.0788620558,-0.5845488032,0.5783803668,0.5958659368,-0.1607080632,-2.0113422832,0.1755431468,1.6359231168,1.0613942168,-1.5374200832,-0.0356795022,-0.6386744432,-0.9815706832,-1.1913710832,0.3317894368,-0.3863205832,0.0987836068,-0.3248911532,-0.4219909532,0.4139429968,0.7712653468,2.1551426168,-1.3143152832,-0.9796276832,1.0808166168,-0.3468171332,-1.3382831832,0.3585250468,1.5962250168,0.7508762968,2.0003672168,0.5475247668,1.9075114168,-0.2968293632,-1.0967969832,-0.1681410632,1.2332273168,-1.0732263832,0.6782565468,-0.5584297132,0.5941671268,-1.0568580832,0.1289730098,-1.9615808832,-0.4501055032,0.5050304268,-0.2780222732,1.2795381168,-0.5882972432,-2.2822286832,-1.1886540832,1.0986308168,-0.0702415732,0.4222060368,0.9871821468,-2.0774442832,-0.6016965032,-0.6613193132,-0.9751547832,-0.1390994532,1.5639956168,0.0045436528,1.2704304168,-0.6532223832,0.0505069033,-0.7399106232,0.6299209768,-0.2082249532,0.5231182368,0.7111374468,-0.0353387792,0.9321550368,2.3522699168,0.5676210968,0.0311950928,0.9561232368,0.0989230958,-1.0640874832,0.5284801268,0.0379773430,-0.2332354432,1.3194349168,1.9063830168,-0.4795768832,0.1464068668,-0.7646667132,0.7234209968,-2.3216073832,1.0330972868,0.2618815368,0.3046448768,1.2564269168,-0.2316845732,-0.0901520332,-1.2275177832,-1.6206240832,-0.6605718432,0.3238629068,-0.4982269132,-1.2905482832,1.1156687168,-0.6691030332,0.0316968558,0.0421653876,-0.2064538632,0.4395577368,-0.2210309332,-1.6210284832,-0.9859926832,0.2860771168,-1.2136076832,-0.3042007732,-0.8983897732,-1.1315778832,-0.9781592832,-0.3586843132,0.2166480868,-0.0731360732,1.1071015168,-0.2024038832,-1.4745566832,0.0527165759,0.1143552818,0.3595182268,0.5428080868,1.3210665168,-0.5048337332,0.3037908168,0.0298057448,-0.5372815832,2.1792908168,-0.2146347032,-1.3665460832,1.8130833168,0.3685283968,-1.0760571832,0.6633325568,1.3127642168,-0.8530600932,0.1781578568,-0.0960575932,-1.1204128832,1.2267019168,0.0275527548,0.5792011068,-0.6734462032,-0.6125769732,0.3573451768,0.1497964968,1.8911986168,-0.2321232632,2.2555365168,1.5515082168,-1.9020961832,-1.6375603832,-0.5305517132,-0.1428341132,0.0519165325,0.8799323068,-0.6792882532,-0.6785080632,-0.1581985832,0.0225182558,0.3218724168,1.1012772168,0.6646556968,-1.7076328832,0.7403299668,0.8544682768,0.6793273668,1.3530627168,0.3700799368,-0.6300107432,-0.1063450832,-2.4060353832,0.5162680268,0.1599280768,-0.5481214232,-0.6117252632,-1.0376794832,-0.0047484482,0.4223269568,-0.2873786332,-0.4569158332,0.0070038088,-0.1317779132,-0.9142826632,1.3355303168,0.4838920568,1.3239233168,-0.4547473932,-1.0757341832,0.8506320368,0.0841819958,-0.7132261932,-0.0461467312,-1.9658678832,1.1269004168,-0.9382081432,-0.6455062232,1.3824619168,-0.8662607432,-0.3698753132,-0.4631807732,1.6627302168,0.1238831278,-1.0380740832,-1.0815353832,1.7786587168,1.9804410168,1.6780506168,-1.2129577832,-0.1705550932,-0.1559496332,0.3504815968,-0.5293430432,-0.9346659532,-0.4038269932,1.1250743168,2.4156303168,0.2722707568,-0.2236407232,0.7446545968,-0.4446080732,1.9054621168,1.1498335168,-1.1845832832,-0.6269026932,1.3839119168,0.4310657368,0.4360413468,-1.6643511832,0.2708410568,0.7286152768,-0.5938076932,-0.9596231832,-0.1426382532,-1.0110502832,-0.0285570722,0.3221808368,1.4162577168,0.2228234468,-0.4990341432,1.6771730168,0.8681975668,0.2737435568,0.7146163668,-0.4650954632,0.8993340168,0.3114858668,0.6679575968,-1.0043554832,1.5786528168,0.4774081568,-1.8741534832,0.5129219368,1.3173335168,0.6815248668,1.4237649168,1.3628253168,-0.8664468232,-2.2626226832,1.8317126168,0.4337802268,0.0633060928,-0.3629945832,-1.4919120832,0.2643555168,-1.3314962832,-0.7963031132,-0.1656601432,0.7988954168,0.4187168668,-1.3024305832,1.5248586168,0.0757185548,1.9134352168,-1.1660080832,-0.7396494532,-0.7243161032,-0.0642176832,-0.9340742532,-0.9210057032,-2.3361899832,-0.7952054932,0.3003280468,-0.1408515832,-0.1246328832,-0.0740064932,0.2114705868,-0.4582238832,-0.6620940032,0.5511470968,-0.3779391232,0.2721157868,-0.9165146132,-0.1030601732,0.7875204468,-0.8475136132,0.1820442768,-0.1931618832,-0.0324767122,-0.3155894932,-2.0346524832,-0.1005632932,1.4363239168,0.6947865068,-0.3341511432,-0.6184606432,0.2919403968,-0.3405337432,-0.4854973832,0.0983707808,1.2967510168,-2.4770211832,0.6278385368,-0.9650819832,0.9872672368,-2.3809746832,-0.1808490132,0.1010522998,-0.3816316032,-0.1599355332,-1.4700945832,-1.0833694832,-0.7720197432,0.4095966868,-0.5431243432,1.5803914168,0.1830539468,-1.8197842832,-0.4112106832,-0.6090916932,0.1463002968,-0.1776492032,-0.2360609532,-0.6906795932,-0.0215511632,-1.4010216832,0.6553227068,-1.2805205832,-0.6185942632,-0.1031320932,0.2910673768,-0.0336501402,1.7811524168,1.6649543168,0.6694183168,0.1347960068,-0.7646246332,-0.4183546732,-1.3629867832,-0.3315472132,-0.4279288232,1.7942780168,0.7962070368,0.1079717578,-0.2497818432,0.1258052638,0.8091738968,2.2798323168,0.3698691468,0.9062863568,0.7223690168,0.5977400468,1.0446128168,1.3023475168,0.0871334818,-0.2711552532,0.2696900568,1.0396743468,1.2588941168,-0.4997200032,0.9552107568,-0.1291587132,-0.2929722232,0.5844691968,0.9750936268,-0.5272702332,-1.4556229832,-0.0073632272,0.5960071868,0.1264803038,1.6205059168,-0.2877917832,0.8381372468,-0.7418177332,-1.2201390832,0.7096374068,-1.3496497832,-1.2575800832,-0.5620397432,-1.4455820832,0.6015253768,-0.2343718732,-1.2507023832,-0.8454527632,-0.9435376632,-0.0286352272,-2.3716084832,-0.6513665932,-1.3484065832,0.3726302168,0.6415268968,0.1901578168,-0.0584565732,-2.5919983832,0.0710358308,-0.8333277132,-0.2224950332,-0.2845954932,-1.1152650832,0.6230356268,0.2827381468,-0.3079025032,0.9350808968,1.6212812168,-1.0651914832,0.0170513698,-1.0676452832,0.7938165968,0.5431494468,-0.4742784632,-0.5162270732,-0.7103882032,0.9687951068,-0.2055379032,-0.1068521032,-1.2154329832,0.3556022968,2.7332593168,0.3326787068,-1.3798205832,0.2897681368,-1.3927904832,0.1915555468,-1.6500901832,0.7621708968,1.1847552168,1.5949187168,1.4266125168,-0.7151098332,0.4856451568,0.9540803168,-1.0311031832,0.2447443268,0.8058456368,-1.2452047832,-0.9099794032,0.8211569168,0.0366513472,0.5674692268,1.4072542168,0.5250217468,-0.7440834332,0.7949816868,-0.1239054932,-0.7732456932,2.1370476168,0.1231349488,-0.8943126532,0.6787211968,1.7250104168,0.6366165868,0.8331352968,0.1482362668,-0.1155961432,0.9138898668,-0.1517765132,0.1184569018,-0.4836524232,-0.6425019632,-0.2254052332,-1.1453635832,0.2915613968,0.1454340368,0.0019755398,-2.2045998832,-0.4677940632,0.2922250568,0.4121791268,0.2221790368,0.0056990048,-1.5603274832,0.3823544568,-0.0881523932,0.5281722068,0.6417331168,-0.0430484702,0.3682744668,-0.2921608132,-0.2794667832,-0.3393917132,-0.9103885132,0.2765580168,1.2782271168,-0.5355491832,-0.4585549532,0.7658459368,0.0824809018,1.5842612168,-1.6580703832,-0.9907588832,-0.7207252232,2.2194084168,0.4745945168,-0.4007827632,0.0729782848,-0.2726884532,1.0208281168,0.0612772908,0.8609452468,0.7453235168,-0.1882881432,-0.0707071632,0.1709229368,-0.7564272832,-0.1956295432,-0.0464808212,-0.9802817832,0.9805203368,-1.0887368832,-0.6677196732,-1.1265184832,1.1084195168,-0.6374113232,-1.6827902832,0.8561820168,1.4848490168,0.7152546168,0.1816473768,-0.8165515132,-0.7092681432,1.2725975168,1.1937368168,-0.5650425932,0.8491403368,0.2601152668,-0.3304786532,-0.7890480132,0.3298487168,-1.7759091832,-1.5300689832,2.0586481168,-0.0289996072,2.6718918168,-0.2003345332,0.2162589068,0.9661894968,-0.1355705832,-0.4787224932,1.4749444168,-0.8271350332,0.8505242068,-0.4676522232,0.7864965468,0.8908807168,-0.7869183032,0.5759768468,1.0758308168,-1.0090415832,0.4050961568,0.0061957998,-1.1846531832,-0.2321164532,-0.1174528232,-1.0405923832,-1.9112302832,-0.8665048432,0.0374036891,-1.6805074832,1.3060597168,-0.5574509532,-2.0209423832,0.1538933568,1.5305967168,0.0959845588,0.2049631568,0.0161044978,0.2165586068,0.9251501668,0.2252768368,0.7982778368,0.5510169668,0.1748625568,0.3230865268,-0.9398651432,-0.9011050132,0.0299249008,0.3973276968,-0.8517264132,0.8550934368,0.1525197668,2.7746264168,0.4540615668,-1.2638795832,0.4267889068,0.5424860968,-0.4678031732,0.2779044668,-0.5548426932,0.0637532358,0.4624251768,1.2340861168,0.8141966668,-2.6012394832,0.3284123168,0.8690750368,0.0348599243,0.9014205768,0.8177706568,1.3489277168,1.2744849168,1.0015460868,-1.6115652832,-0.9474135932,0.7282184368,-0.9318875932,-0.5637432232,0.7297761568,0.0630312728,1.1067830168,-1.2980674832,0.5224928568,-1.5909915832,-1.3996825832,0.3367638368,-0.0973816632,-1.0873582832,-0.2495556332,-0.5395534532,-0.8533658632,0.2915834968,-1.4466809832,0.3564910768,-1.9821019832,0.5719721168,0.3864533168,0.8011750268,-0.6489577632,0.7231609668,-1.0295585832,0.9427545068,-2.0801099832,0.3276946868,-0.6903405132,-0.7303932132,0.1948241368,-0.2938607132,1.0137431368,-0.0642539432,1.0564743168,-0.4323643432,0.1119305618,0.4415744868,1.1593086168,0.6634335468,-0.2446920632,-1.3287908832,-0.6428860132,0.3746671568,-0.9547394032,0.3344005168,1.1500608168,0.2879410268,0.2079581968,0.4492137568,1.2589636168,1.4914067168,-0.9821550832,0.2484004268,0.6318646068,-0.2210412032,2.5383002168,0.8989300868,-0.8079712132,0.8548612568,0.7432241368,0.8029207468,-1.6699267832,1.5800036168,-1.5668643832,1.1525084168,-1.0667215832,0.4284518068,1.0082132068,0.8612796468,0.0800311958,-0.8830299832,-0.0689362432,-0.7600472732,-1.6220234832,-0.8584181832,0.6313320868,0.5971416968,-0.3721901932,0.1047772758,0.5004139868,0.2419963268,0.3005402368,2.1237122168,-2.2342540832,0.3820048468,0.3328763068,0.7052432668,-0.5378778132,0.9307343268,0.2148534568,0.8918038568,1.0067514468,1.3649004168,-0.0213624862,1.3600355168,0.2709997468,-1.3866547832,-0.1067185832,-0.4619851432,-1.6861590832,-0.3744898032,-0.5719861032,0.7637590968,0.3823462068,0.9258274968,0.3272276268,-0.1025589332,-0.0466634832,0.3321432868,1.2078132168,0.8487117668,-1.3126610832,0.1638753168,-0.1791954932,0.6147147568,-0.2571580132,1.1772592168,-0.1363739932,-1.4240842832,1.4383281168,0.4838180868,0.6083664668,-0.6506401732,0.8768516668,-2.1943959832,1.1406265168,0.0413655009,-1.5715908832,-1.1857443832,0.2503869968,0.2639244168,-0.9630906832,-0.4100846732,1.4424357168,-0.4189815632,0.0756983218,0.8417656168,0.9397982068,0.1808741468,-1.5761639832,-1.6036232832,0.4716892968,-0.6942484232,0.6079085568,-1.3411842832,0.5032504068,0.6723660668,0.4228297268,-0.9703474832,-0.3042603632,0.4848947168,-1.5472578832,-0.6584342932,-1.0346181832,1.0452021168,1.7724629168,0.7520146268,-0.7049144432,0.2718448068,-0.1805141932,-0.8102928432,0.3886092168,0.1527468968,-1.0900565832,-0.6401411232,-0.2348738132,0.6977722668,-1.2054115832,-0.5545566132,-0.4388301332,1.0263545868,1.8051031168,1.4703841168,0.9547454468,0.3698050668,0.1126009568,-1.4567802832,-0.3752407732,0.0219456188,0.2714069468,-0.9652133832,-0.6216397532,0.6011589968,-1.1455596832,-0.7324990832,0.3140244868,1.5779581168,-1.0093002832,0.6685409868,-0.7546436532,-0.2705395732,-0.5592273332,1.3020427168,0.9014666668,-2.0623094832,-0.3179547632,0.5965391368,-1.5134013832,-0.1636833032,-0.3825851332,0.5367606668,-0.8279251932,0.1228100748,-0.4786367232,-1.3708784832,-0.3413107632,-0.4149398032,-0.2484882732,-0.2582415932,-1.5456113832,1.1372691168,1.3671493168,-0.0834972132,-0.6941814032,0.2567012568,-0.3575467132,0.1079201638/*,-1.7150131832,1.7297304168,0.3703826268*/};
3
4static const float *randn_i=&RArandn[0];
5const static float *randn_last=&RArandn[MAXrandn-1];
6
7
8#define MAXrand 100
9static const float RArandu[MAXrand]={0.8147, 0.9058, 0.1270, 0.9134, 0.6324, 0.0975, 0.2785, 0.5469, 0.9575, 0.9649,
10                                      0.1576, 0.9706, 0.9572, 0.4854, 0.8003, 0.1419, 0.4218, 0.9157, 0.7922, 0.9595, 0.6557, 0.0357,
11                                      0.8491, 0.9340, 0.6787, 0.7577, 0.7431, 0.3922, 0.6555, 0.1712, 0.7060, 0.0318, 0.2769, 0.0462,
12                                      0.0971, 0.8235, 0.6948, 0.3171, 0.9502, 0.0344, 0.4387, 0.3816, 0.7655, 0.7952, 0.1869, 0.4898,
13                                      0.4456, 0.6463, 0.7094, 0.7547, 0.2760, 0.6797, 0.6551, 0.1626, 0.1190, 0.4984, 0.9597, 0.3404,
14                                      0.5853, 0.2238, 0.7513, 0.2551, 0.5060, 0.6991, 0.8909, 0.9593, 0.5472, 0.1386, 0.1493, 0.2575,
15                                      0.8407, 0.2543, 0.8143, 0.2435, 0.9293, 0.3500, 0.1966, 0.2511, 0.6160, 0.4733, 0.3517, 0.8308,
16                                      0.5853, 0.5497, 0.9172, 0.2858, 0.7572, 0.7537, 0.3804, 0.5678, 0.0759, 0.0540, 0.5308, 0.7792,
17                                      0.9340, 0.1299, 0.5688, 0.4694, 0.0119, 0.3371
18                                     };
19static const float *randu_i=&RArandu[0];
20const static float *randu_last=&RArandu[MAXrand-1];
21
22float qrandu();
23float qrandn();
24void rng_init();
Note: See TracBrowser for help on using the browser.