打印

数字电桥软件算法分析

[复制链接]
14729|53
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
弄了个迷你电桥,硬件调通。数据采集上来了。软件方面可以先用pc机先写,然后移植到stm32中去。算法目标:避免浮点数计算,stm32f103c8t6没有fpu,用软件浮点速度慢。如果算法快,可以多测几次求平均值,降低方差。

试着算了一下。
v1=[2714, 2698, 2690, 2661, 2635, 2603, 2578, 2527, 2486, 2437, 2385, 2333, 2277, 2214, 2144, 2062, 1984, 1942, 1870, 1794, 1743, 1745, 1569, 1494, 1411, 1340, 1247, 1180, 1110, 1039, 978, 911, 835, 759, 710, 648, 586, 550, 494, 458, 415, 384, 351, 333, 312, 290, 276, 270, 267, 268, 275, 278, 302, 320, 356, 364, 423, 453, 495, 541, 590, 651, 703, 777, 823, 899, 964, 1042, 1121, 1184, 1264, 1356, 1301, 1499, 1577, 1655, 1719, 1756, 1882, 1953, 2027, 2152, 2166, 2230, 2295, 2348, 2387, 2450, 2500, 2543, 2582, 2610, 2647, 2670, 2694, 2709, 2720, 2722, 2724, 2722,2712, 2698, 2679, 2653, 2634, 2600, 2560, 2518, 2487, 2432, 2373, 2323, 2264, 2198, 2140, 2070, 2005, 1937, 1861, 1785, 1709, 1626, 1559, 1471, 1404, 1328, 1258, 1172, 1099, 1027, 954, 890, 831, 676, 691, 637, 586, 550, 475, 449, 409, 374, 353, 335, 301, 284, 272, 267, 268, 264, 278, 285, 301, 328, 358, 381, 411, 450, 494, 544, 608, 670, 713, 778, 839, 909, 978, 1051, 1123, 1198, 1280, 1355, 1433, 1511, 1590, 1668, 1744, 1815, 1892, 1968, 2047, 2105, 2171, 2237, 2306, 2354, 2410, 2460, 2514, 2521, 2586, 2622, 2646, 2712, 2682, 2707, 2720, 2725, 2769, 2744]

v2=[1578, 1594, 1642, 1677, 1715, 1750, 1779, 1809, 1850, 1881, 1905, 1935, 1957, 1986, 2001, 2007, 2004, 2048, 2068, 2078, 2107, 2149, 2100, 2086, 2093, 2092, 2088, 2072, 2067, 2039, 2034, 2020, 1997, 1976, 1958, 1931, 1900, 1878, 1845, 1805, 1782, 1747, 1710, 1690, 1657, 1607, 1573, 1533, 1505, 1466, 1426, 1390, 1354, 1302, 1281, 1230, 1207, 1166, 1147, 1113, 1068, 1048, 1031, 1002, 977, 963, 935, 932, 919, 894, 887, 885, 778, 887, 894, 890, 889, 878, 916, 917, 945, 984, 984, 1008, 1028, 1052, 1080, 1096, 1144, 1169, 1204, 1242, 1279, 1304, 1350, 1389, 1436, 1463, 1505, 1540,1578, 1615, 1649, 1686, 1723, 1759, 1784, 1816, 1845, 1885, 1907, 1930, 1962, 1972, 2009, 2020, 2036, 2053, 2075, 2082, 2092, 2093, 2097, 2087, 2096, 2083, 2092, 2072, 2066, 2047, 2035, 2023, 2002, 1935, 1951, 1925, 1908, 1890, 1826, 1814, 1770, 1746, 1696, 1685, 1644, 1600, 1563, 1529, 1497, 1443, 1422, 1382, 1338, 1311, 1277, 1240, 1199, 1168, 1134, 1105, 1082, 1051, 1029, 1002, 977, 962, 946, 912, 913, 902, 890, 884, 887, 883, 893, 893, 895, 901, 918, 933, 941, 961, 987, 1019, 1029, 1062, 1085, 1119, 1148, 1168, 1212, 1250, 1283, 1338, 1372, 1400, 1436, 1476, 1520, 1562]

matlab
clear all;
clc;
format long
v1=[2714, 2698, 2690, 2661, 2635, 2603, 2578, 2527, 2486, 2437, 2385, 2333, 2277, 2214, 2144, 2062, 1984, 1942, 1870, 1794, 1743, 1745, 1569, 1494, 1411, 1340, 1247, 1180, 1110, 1039, 978, 911, 835, 759, 710, 648, 586, 550, 494, 458, 415, 384, 351, 333, 312, 290, 276, 270, 267, 268, 275, 278, 302, 320, 356, 364, 423, 453, 495, 541, 590, 651, 703, 777, 823, 899, 964, 1042, 1121, 1184, 1264, 1356, 1301, 1499, 1577, 1655, 1719, 1756, 1882, 1953, 2027, 2152, 2166, 2230, 2295, 2348, 2387, 2450, 2500, 2543, 2582, 2610, 2647, 2670, 2694, 2709, 2720, 2722, 2724, 2722,2712, 2698, 2679, 2653, 2634, 2600, 2560, 2518, 2487, 2432, 2373, 2323, 2264, 2198, 2140, 2070, 2005, 1937, 1861, 1785, 1709, 1626, 1559, 1471, 1404, 1328, 1258, 1172, 1099, 1027, 954, 890, 831, 676, 691, 637, 586, 550, 475, 449, 409, 374, 353, 335, 301, 284, 272, 267, 268, 264, 278, 285, 301, 328, 358, 381, 411, 450, 494, 544, 608, 670, 713, 778, 839, 909, 978, 1051, 1123, 1198, 1280, 1355, 1433, 1511, 1590, 1668, 1744, 1815, 1892, 1968, 2047, 2105, 2171, 2237, 2306, 2354, 2410, 2460, 2514, 2521, 2586, 2622, 2646, 2712, 2682, 2707, 2720, 2725, 2769, 2744]

v2=[1578, 1594, 1642, 1677, 1715, 1750, 1779, 1809, 1850, 1881, 1905, 1935, 1957, 1986, 2001, 2007, 2004, 2048, 2068, 2078, 2107, 2149, 2100, 2086, 2093, 2092, 2088, 2072, 2067, 2039, 2034, 2020, 1997, 1976, 1958, 1931, 1900, 1878, 1845, 1805, 1782, 1747, 1710, 1690, 1657, 1607, 1573, 1533, 1505, 1466, 1426, 1390, 1354, 1302, 1281, 1230, 1207, 1166, 1147, 1113, 1068, 1048, 1031, 1002, 977, 963, 935, 932, 919, 894, 887, 885, 778, 887, 894, 890, 889, 878, 916, 917, 945, 984, 984, 1008, 1028, 1052, 1080, 1096, 1144, 1169, 1204, 1242, 1279, 1304, 1350, 1389, 1436, 1463, 1505, 1540,1578, 1615, 1649, 1686, 1723, 1759, 1784, 1816, 1845, 1885, 1907, 1930, 1962, 1972, 2009, 2020, 2036, 2053, 2075, 2082, 2092, 2093, 2097, 2087, 2096, 2083, 2092, 2072, 2066, 2047, 2035, 2023, 2002, 1935, 1951, 1925, 1908, 1890, 1826, 1814, 1770, 1746, 1696, 1685, 1644, 1600, 1563, 1529, 1497, 1443, 1422, 1382, 1338, 1311, 1277, 1240, 1199, 1168, 1134, 1105, 1082, 1051, 1029, 1002, 977, 962, 946, 912, 913, 902, 890, 884, 887, 883, 893, 893, 895, 901, 918, 933, 941, 961, 987, 1019, 1029, 1062, 1085, 1119, 1148, 1168, 1212, 1250, 1283, 1338, 1372, 1400, 1436, 1476, 1520, 1562]

F1=fft(v1)
F2=fft(v2)
F1(1)=0
F2(1)=0
V=max(F1)
I=max(F2)/1800
Y=abs(I/V)
Cx=Y/(2*pi*1e3)*1e9

程序输出结果:
Cx =  43.347718537423894 nf


使用特权

评论回复

相关帖子

沙发
叶春勇|  楼主 | 2021-5-14 10:57 | 只看该作者
这个电容用测量得值如下:

比较接近相差43.1-43.3=0.2nf

使用特权

评论回复
板凳
叶春勇|  楼主 | 2021-5-14 11:55 | 只看该作者
引用文献:
https://www.doc88.com/p-2844525130582.html
基于DLIA的交流阻抗谱测量系统关键技术研究 - 道客巴巴

使用特权

评论回复
地板
叶春勇|  楼主 | 2021-5-14 12:07 | 只看该作者
继续引用:

经论文作者提出得观点,以及论文有带通采样得推导。
正好stm32f103c8t6也是两个1Msps得adc但是是12位,由于我不是搞高精尖,够用了。看来stm32有做1M电桥得潜力。

使用特权

评论回复
5
叶春勇|  楼主 | 2021-5-14 12:12 | 只看该作者
继续引用论文核心观点:

作者得出得结论,说了一堆,就是多采集。
考虑到stm32f103c8t6有20kram,最多采集10k 16bit数据,考虑一些其他开销,例如堆栈,hal库全局变量,应该可以搞4000个数据。

使用特权

评论回复
6
叶春勇|  楼主 | 2021-5-14 12:21 | 只看该作者
作者关于带通采样得论述
论点:

直接抄公式

这样对adc要求就低了。公式很复杂略过

使用特权

评论回复
7
叶春勇|  楼主 | 2021-5-14 15:17 | 只看该作者
电桥Cx换成3.6k 1%的电阻,用表测3.58k
第一 组
v1=[1610, 1671, 1732, 1794, 1851, 1914, 1958, 2012, 2061, 2110, 2153, 2192, 2230, 2261, 2292, 2318, 2342, 2362, 2375, 2387, 2394, 2402, 2397, 2388, 2376, 2363, 2348, 2324, 2300, 2270, 2239, 2201, 2163, 2112, 2075, 2025, 1974, 1919, 1865, 1810, 1749, 1690, 1629, 1565, 1505, 1438, 1379, 1304, 1241, 1177, 1114, 1055, 995, 933, 878, 821, 768, 718, 667, 621, 579, 539, 501, 470, 435, 413, 390, 371, 358, 345, 338, 330, 334, 339, 346, 359, 373, 393, 417, 446, 474, 512, 537, 593, 638, 687, 740, 788, 850, 903, 964, 1027, 1088, 1148, 1216, 1281, 1348, 1414, 1482, 1546, 1611, 1671, 1732, 1794, 1850, 1908, 1960, 2013, 2061, 2107, 2165, 2195, 2232, 2264, 2295, 2312, 2344, 2362, 2377, 2388, 2396, 2403, 2398, 2391, 2379, 2366, 2350, 2326, 2302, 2276, 2241, 2202, 2166, 2123, 2076, 2024, 1974, 1924, 1874, 1812, 1752, 1694, 1631, 1570, 1507, 1441, 1375, 1310, 1242, 1180, 1119, 1058, 997, 935, 878, 825, 774, 719, 668, 625, 581, 542, 503, 475, 440, 414, 391, 370, 358, 347, 339, 332, 334, 339, 348, 360, 373, 394, 417, 444, 475, 510, 549, 594, 641, 685, 740, 790, 847, 902, 963, 1025, 1087, 1150, 1212, 1278, 1347, 1414, 1480, 1546]
v2=[1253, 1213, 1182, 1153, 1121, 1102, 1066, 1040, 1013, 991, 970, 948, 931, 913, 901, 883, 871, 865, 858, 853, 849, 847, 849, 854, 858, 863, 874, 886, 900, 913, 930, 947, 966, 983, 1010, 1031, 1060, 1085, 1114, 1143, 1172, 1202, 1233, 1265, 1294, 1328, 1366, 1394, 1426, 1461, 1490, 1521, 1551, 1580, 1611, 1639, 1668, 1695, 1717, 1743, 1762, 1783, 1800, 1819, 1829, 1846, 1859, 1868, 1876, 1879, 1883, 1887, 1885, 1882, 1876, 1872, 1865, 1853, 1841, 1826, 1810, 1794, 1771, 1754, 1732, 1709, 1682, 1653, 1627, 1599, 1569, 1538, 1507, 1473, 1443, 1411, 1377, 1342, 1311, 1278, 1246, 1215, 1185, 1152, 1124, 1098, 1069, 1042, 1014, 991, 982, 951, 932, 914, 900, 882, 875, 866, 859, 854, 850, 847, 850, 855, 859, 866, 875, 887, 900, 915, 929, 948, 968, 988, 1009, 1032, 1059, 1086, 1115, 1141, 1172, 1205, 1233, 1265, 1296, 1329, 1361, 1394, 1425, 1460, 1491, 1521, 1552, 1579, 1611, 1639, 1669, 1694, 1718, 1742, 1763, 1786, 1802, 1822, 1833, 1846, 1859, 1868, 1874, 1879, 1884, 1886, 1885, 1880, 1878, 1873, 1864, 1855, 1843, 1828, 1811, 1795, 1774, 1756, 1736, 1708, 1686, 1654, 1629, 1598, 1567, 1537, 1504, 1474, 1443, 1410, 1377, 1344, 1308, 1279]


第二组
v1=[2142, 2100, 2054, 1999, 1956, 1896, 1842, 1780, 1720, 1661, 1600, 1540, 1473, 1408, 1338, 1273, 1209, 1147, 1078, 1026, 967, 905, 852, 793, 743, 694, 644, 601, 570, 524, 489, 460, 429, 410, 385, 374, 360, 352, 331, 341, 348, 355, 367, 372, 398, 421, 446, 478, 517, 547, 586, 631, 678, 734, 781, 836, 891, 949, 1020, 1075, 1137, 1200, 1264, 1324, 1401, 1467, 1533, 1595, 1653, 1720, 1781, 1841, 1896, 1950, 2003, 2056, 2102, 2147, 2184, 2227, 2261, 2292, 2320, 2349, 2364, 2378, 2393, 2399, 2419, 2406, 2398, 2391, 2377, 2360, 2341, 2317, 2289, 2259, 2229, 2185, 2144, 2103, 2053, 2004, 1950, 1897, 1842, 1783, 1720, 1662, 1601, 1539, 1474, 1408, 1342, 1275, 1211, 1148, 1096, 1027, 965, 906, 850, 795, 744, 694, 646, 601, 557, 523, 489, 457, 430, 415, 386, 371, 358, 351, 355, 340, 347, 355, 365, 389, 396, 418, 445, 474, 506, 544, 585, 628, 675, 717, 778, 833, 888, 948, 1011, 1071, 1133, 1197, 1261, 1322, 1397, 1463, 1529, 1594, 1659, 1716, 1778, 1837, 1894, 1950, 2001, 2052, 2098, 2143, 2179, 2224, 2259, 2288, 2320, 2343, 2364, 2378, 2391, 2399, 2398, 2405, 2396, 2390, 2377, 2362, 2341, 2317, 2290, 2260, 2233, 2188]
v2=[988, 1012, 1035, 1057, 1093, 1114, 1143, 1172, 1201, 1232, 1264, 1297, 1329, 1361, 1392, 1425, 1456, 1488, 1513, 1549, 1581, 1609, 1640, 1663, 1693, 1719, 1742, 1764, 1790, 1805, 1821, 1838, 1849, 1866, 1873, 1882, 1887, 1892, 1887, 1897, 1894, 1890, 1885, 1872, 1868, 1855, 1842, 1829, 1815, 1792, 1771, 1749, 1725, 1704, 1673, 1644, 1618, 1587, 1560, 1525, 1493, 1462, 1430, 1390, 1365, 1331, 1298, 1266, 1231, 1204, 1174, 1142, 1114, 1086, 1061, 1033, 1008, 987, 964, 947, 930, 914, 901, 892, 878, 868, 865, 858, 864, 857, 860, 866, 872, 876, 889, 902, 916, 932, 952, 968, 989, 1012, 1035, 1058, 1086, 1113, 1141, 1171, 1198, 1232, 1264, 1293, 1326, 1360, 1392, 1424, 1456, 1487, 1525, 1552, 1579, 1609, 1638, 1663, 1692, 1718, 1741, 1762, 1780, 1803, 1820, 1835, 1849, 1868, 1872, 1881, 1884, 1890, 1903, 1897, 1895, 1889, 1884, 1884, 1868, 1856, 1843, 1829, 1808, 1792, 1771, 1750, 1727, 1694, 1672, 1646, 1617, 1588, 1559, 1526, 1494, 1463, 1433, 1394, 1366, 1331, 1298, 1266, 1239, 1205, 1174, 1144, 1116, 1090, 1061, 1035, 1010, 988, 961, 948, 929, 914, 901, 888, 878, 869, 864, 859, 850, 857, 857, 864, 870, 880, 888, 901, 915, 930, 953, 966]


ans =

  3.5788e+003

使用特权

评论回复
8
coody| | 2021-5-14 18:13 | 只看该作者
这个强!论文的PDF能分享下不?

使用特权

评论回复
9
叶春勇|  楼主 | 2021-5-15 15:21 | 只看该作者
今天分析了一下硬件电路采集的一致性
当采集频率fs=100k,采集200个数据
a=[1.9844615242060868, 1.9710780495240201, 1.9870251055395389, 1.9978237261973406, 1.9354760046155406, 1.9854114250040715, 2.0017511086997026, 1.8924845270280903, 1.997098160855475, 1.9827386943680019, 2.0035808349970612, 1.9885843659529026, 1.9924061074437807, 1.9815498152742184, 1.9860026825337889, 1.9764576616932354, 2.0196402341667921, 1.9821725241918353, 2.0013662795451874, 1.9799915354389845, 1.9742712735810721, 2.000082160472719, 1.9957920125813946, 1.9947056738000952, 1.9656153241600529, 1.9921879387337909, 1.9748485589307996, 1.9877353922540195, 1.9834808013020406, 2.0050389898370091, 1.9664273006360891, 1.9866131393265489, 1.9698660966791441, 1.9856327980188899, 1.9983537168039995, 1.9723178886633987, 1.9352205815305097, 1.993088510986484, 1.9863590145954961, 1.9464035980529986, 1.9905850203513937, 2.001887338598249, 1.9832786937069076, 2.0110736473162785, 1.9875081808937669, 1.9728740508749982, 1.9941362545499188, 1.9857469886976442, 1.9725758364945645, 1.9730271598403941, 2.0131016613542561, 1.9890466888952492, 1.9872034505334231, 1.9772105227543464, 1.9938774415570892, 2.0054860923969278, 1.9557202786143417, 1.9716273848484569, 1.9746280580187987, 2.0157009221607742, 2.0113098326750523, 1.9898503389012916, 1.9683772741559538, 1.9768160432263753, 1.9972785585372688, 2.0150443715547914, 1.9954478483488158, 1.992927312471986, 1.9882868513054546, 1.9047415826214884, 1.9835551831825724, 2.0065043802622551, 1.9248864667208727, 2.0030857464946532, 1.9891591343627455, 2.0639433745752145, 1.9829184678931411, 1.9856112093508542, 2.0109230043499617, 1.9879145306295893, 1.9858563444103334, 1.9986191934754749, 1.9968099854050467, 2.0249187555099768, 1.970004404053147, 2.0002639772934376, 1.9813961329047751, 1.9861060338741512, 1.9814884640020958, 1.98842346668559, 1.9925414160528701, 1.9892675310533312, 1.9740610843518676, 1.9924857057237484, 2.0029763497584416, 2.049630835548669, 1.988876719259826, 1.9876373472621087, 1.9045937229853451, 1.9866710757570591]

b=[2.0068780395310517, 1.999779918773563, 2.0002212109919406, 2.0205378634007714, 1.983396664182429, 1.9824870680134909, 1.9740883165702547, 1.9886896307159507, 2.0025173510629495, 2.0001525562180982, 2.0075888207313901, 1.9788321342550488, 1.985438817122833, 2.001192768039644, 1.9394820892149953, 1.9834051907592241, 1.9909516289311109, 2.0085204251574162, 1.9888562269151999, 1.9975822025379131, 1.997125853214391, 1.9938568859197252, 1.9902006720452341, 1.9294397124915548, 1.9966844661041516, 1.9901200683737248, 2.0402129149997021, 1.9740244811726229, 1.9891097765885712, 2.0220220585080284, 1.9920811909760254, 1.9926529177045773, 1.9771022658536035, 1.9962144214690201, 1.9910337458247445, 2.007034128513963, 1.9972834837588074, 1.9875061655322839, 2.0263751424678471, 1.9947272845648005, 2.002547155311126, 2.0038922209531149, 1.9979092201784294, 1.9852527610754434, 1.9854910909098451, 2.0023181169014954, 1.9647066238121307, 1.996278327293779, 1.9903651703665106, 1.9684233084155978, 2.0092679476961717, 1.9950779414475843, 2.0888584356675137, 1.9959690633899467, 1.9884474315588569, 2.0310552409674325, 1.9907934886918868, 1.9868001367930248, 1.9923162326343244, 1.9874434353803485, 1.9947278395236909, 1.9779717002979831, 2.001581800357612, 1.9989881620666066, 2.0456128050055629, 1.9913064355885184, 1.9948289655007831, 1.9380224443544902, 1.9973095407246593, 1.9796273185590214, 2.055849153467753, 1.9964422052273874, 1.9996258405276335, 1.9668193498320317, 1.9870065219068602, 1.992243500041005, 1.9961087405981521, 1.9992314953854402, 2.0046445059139879, 2.0036660180170456, 1.9988604779042218, 1.9954525503351797, 2.003288596828591, 1.9955204789935894, 2.0201448647343239, 1.9900277587235864, 2.0069127027287816, 1.9934956860853856, 1.9948415115303111, 1.9946178715016627, 2.013990157684471, 2.0024319372935904, 2.0053833031023189, 1.9610874228982829, 1.9915769830872376, 1.9943780027408586, 2.0448268506828144, 1.9897199377351253, 1.9866591177247501, 1.9974962593452292]


单次测量标准差
0.0244
0.0210
均值
1.9858
1.9959

标准差除以均值
0.0123
0.0105

电路水平在1%左右

使用特权

评论回复
10
叶春勇|  楼主 | 2021-5-15 15:28 | 只看该作者
当采样率为100khz,采集400个数据时,Cx=3.6k电阻,比上楼多采集了一倍数据
a=[2.0217142966912638, 1.9828210498568319, 2.0168036457224425, 1.9650688068763096, 1.9814428775897077, 1.9836489626035168, 1.9753140948763099, 1.9962024875246525, 2.0096478630839356, 1.9889027089806512, 1.986189074185531, 1.9991631203487532, 1.9908982405386899, 1.9818403350827369, 1.9831628262613454, 1.9976133854092151, 1.9594148728735301, 1.9873580625809799, 1.9961248687573752, 1.9790389037264871, 2.0077242684110015, 1.9854420477430301, 1.9985883581851303, 1.9953661865823944, 1.9929146157655009, 1.9974077342107939, 1.9848223389440816, 1.9952028289727206, 1.9831644179726733, 1.9955365667025109, 1.9925376320620165, 1.9992524907841875, 1.9975321480071857, 2.0094888066481476, 1.9951956107751585, 1.9730119842200693, 1.9972364565863836, 1.9933133830425045, 2.0018016150592812, 1.9787253234968492, 1.9932855930580966, 1.9918729728645823, 1.9778046604774779, 1.9771716453590058, 1.9870510244347042, 2.0192013619722498, 1.9863238789845536, 2.011406682352229, 1.9708107751186104, 1.9822128617020405, 1.9966012417900867, 2.0134403138216141, 1.9705592848321187, 1.9988160301139877, 1.9872676017795068, 2.0116078017984398, 1.9910877230805, 1.9931621131443982, 1.9796246990399011, 1.9982226191512868, 1.995903785761171, 2.0362282657959678, 1.9848722885402243, 2.0007070161307801, 1.979451442351307, 2.0044230127884917, 1.9844417502610188, 2.0052754582915702, 1.9682830677283889, 1.9900163358762712, 1.9904003929619112, 1.9677187032573551, 1.9921413213983898, 1.9914858314337933, 2.0146546224033601, 1.9905061774609261, 1.9868192797853759, 2.0244007021002006, 1.9916724783442952, 1.983708393278466, 1.9763007580936034, 1.988134375790271, 1.9984183227209709, 2.0235224422023088, 1.9771791524474822, 1.9902134133544913, 1.9834304914516159, 1.9701481807157835, 1.9971864276003179, 1.9891412341039849, 1.9879954790982304, 1.9842570879161623, 1.9904773894746011, 1.9999172714220781, 1.9833316845370892, 1.9753336609205308, 2.021904926568169, 2.0118681937754226, 1.9877646560982689, 1.9652228338932469]
b=[1.9981996289718864, 2.0408187924663266, 1.9900684049885629, 1.9947863932281915, 1.9717931587803812, 2.0268370791683989, 1.9920386882431371, 2.0102322801691046, 2.001348081114728, 1.9776460114685857, 1.973918702973378, 1.9729221706043083, 1.9955341623470266, 1.9870004363371403, 2.0135223701892411, 1.9960223900427052, 1.9993007184649021, 2.0118969883980946, 1.9944089382018826, 1.9889977079192336, 1.948172486256182, 1.9896869941872692, 1.976731793447708, 2.0177361380753687, 2.0285314552188956, 1.9989368438373218, 1.9931407831962105, 1.9930347983453469, 1.9898359939614894, 1.9916055381493816, 1.9592243929559086, 1.9973617787667093, 1.9814213657602866, 2.0036106687921125, 1.9803776043419419, 1.9880908392634509, 2.0388022285485832, 1.9965550971971582, 1.9741864508261124, 1.9725485205647955, 1.9906369198982432, 1.9836079763118999, 2.0020355235666765, 2.0054859584570122, 1.988705535013894, 1.9932281780042398, 2.0206330995754005, 1.9879832720942994, 1.9808472755872231, 2.0163091013889423, 1.9911402145685797, 1.9881867806112079, 1.9677987559086405, 1.9975878645869352, 1.9772048233016606, 2.0335024756854514, 1.9826399762301037, 1.9777297488248768, 1.9613486984579938, 1.9585036523556538, 1.9840593986631621, 1.9929684051672008, 1.9907111524506977, 1.9991351895387846, 1.9937579137281618, 1.9787710905924907, 2.0036141091060728, 1.9806011109066659, 1.9876209005172574, 1.9990441287120038, 1.9854541700431008, 1.9567583825283204, 1.9838799384270063, 2.0014484307874079, 1.9848762571990071, 1.9962249557498297, 1.9953795693632363, 2.0063098631252503, 1.9240775178290612, 1.9910243313620044, 1.9876198317004592, 1.9917798219773595, 2.0091615450055524, 2.0072536870900715, 1.9913057778895658, 1.9549072028532943, 2.0049013275688803, 1.9821531007285951, 1.9666936105478254, 1.9591642645256706, 1.9946136356498059, 1.9718255360304, 1.9447521243725667, 1.9834514796951335, 1.9887341235076059, 1.9569805021825191, 1.9921428509359589, 1.9877811288002658, 2.0120842153415341, 1.9881400751339278]
用matlab计算标准差和相对误差

标准差
    0.0142
    0.0192

标准差/均值
    0.0071
    0.0097

一致性较上楼有一定提高

使用特权

评论回复
11
叶春勇|  楼主 | 2021-5-15 15:35 | 只看该作者
当采集频率为100khz,一次采集800数据,Cx=3.6k,取两组样本,每个样本100个
a=[1.9922260076751304, 1.9899747377202213, 1.980161270177381, 1.9901609157028133, 1.9827241408143748, 1.9876328718558967, 2.0030388728690638, 1.9815718610730535, 1.9838862008009919, 1.9846876679736096, 1.9894716287519127, 1.9936792229662168, 1.9867652526224444, 1.972889578387411, 1.9485471181094671, 1.974507804579795, 1.9878032310098184, 1.9806403105696175, 1.9844631847036167, 1.9890951988766334, 1.9506344518190157, 1.993811967175487, 1.9934756184705089, 1.9869117760024682, 1.9941755435382007, 1.9860453290267159, 1.9875224891309831, 1.9812077174864458, 1.9882262317266421, 1.9753419744583329, 2.0143292718098489, 1.963320166750447, 1.9826139336093593, 1.9878981271161427, 1.9908539336644233, 2.0017423877811722, 1.9893374456521797, 2.0007784787794884, 1.9905400458629183, 1.9825071431654639, 1.9905400850801147, 1.9862936179469808, 1.9964582232784893, 1.986209966512668, 1.995227964422353, 1.9869455816926849, 1.9881270489403304, 2.010996121466639, 2.0096514136929771, 1.9909296927903868, 2.0107335372787891, 1.9704023618691522, 1.9847978865496954, 2.0061427109072936, 2.0151946687338156, 1.983767735350463, 1.9818551467375796, 1.9933646025946103, 1.9963494769453871, 1.9887904276188695, 2.0022577607524603, 2.0087635702984605, 1.9960790615548492, 1.9756541674211052, 2.0058045700253051, 1.9771010112581673, 1.9846059057086241, 1.9938053255138406, 1.9949902847822039, 1.9838712992126095, 1.9956180436074753, 1.9817668058504847, 1.9947404574436685, 2.0257187925335312, 2.0036752558732496, 1.9958810413409021, 2.0061822072049535, 1.9979484474229321, 2.0011149058542994, 1.9984195241354434, 1.9995435799258252, 1.9642169073342122, 1.9934274447500615, 1.9928660330304406, 1.995419347314203, 2.0090196781484151, 1.9986944173890173, 1.9960835687952141, 2.0061193420686738, 1.9814869024121478, 1.987290562807432, 2.0119348377245054, 1.9738550225135525, 1.986409608708666, 1.9586036552965915, 2.0073426217102757, 2.0084400774385451, 1.9738036343485814, 1.9903739613182225, 2.0044846940419991]
b=[1.9971695118521442, 1.9806749270051531, 1.9794329571246174, 1.9903332099385769, 1.9900970030964955, 2.0050607205684066, 1.9988317680040224, 1.9993042913721526, 1.9865884586785985, 1.987721331561457, 2.0015433748838687, 1.9853520054058167, 1.9577409006574344, 2.0057441003527297, 1.9791432223540457, 1.9902953730423432, 2.00045114570983, 1.9981547290319313, 1.9857250635943977, 1.9914422659737698, 1.9848388529526102, 1.9652998404357742, 1.9946510803652289, 2.011659195576271, 1.9843767707591315, 1.9870126941022186, 1.9926972617479519, 1.9765519847547137, 1.9822233000128773, 1.9958248165073926, 1.9922978447046509, 1.9717219265616308, 1.987693336608104, 1.9919400828320444, 2.0005356604872748, 1.9882835409208655, 1.9983409904528311, 1.9901104512871393, 1.9950269624592831, 1.9740586545908989, 1.9744178367451275, 1.9985188092269432, 1.9892650884746461, 1.9887764058135047, 2.0009313847939003, 2.0010096052419999, 1.9747922117959376, 1.9788802340507228, 1.9960756478526493, 1.9922854608812217, 2.0102789897263005, 1.9899582821973805, 1.9942739658334745, 1.9835589451117022, 1.9815365844871491, 2.0094717396276884, 1.9843479012681757, 1.9948284593154202, 2.0033186906259153, 1.9858955623471479, 1.9871068809890458, 2.0016581149788939, 1.9766365286291661, 1.9763429976083602, 2.0140690910261139, 1.9929531294852971, 1.9820910408324359, 1.9920377291638136, 1.9810501631831503, 2.0025000206997041, 1.9975212488394278, 1.9860348478164012, 2.008668843111082, 2.0118037549146597, 1.989979963620417, 2.0060765608561311, 1.991695455301274, 1.9935109065693497, 1.9871910945428255, 1.9819432851959287, 1.9838341419818954, 1.9972702028928675, 1.9979975392452691, 1.9974998720518722, 1.9853417659246739, 2.0103636738477682, 1.9941207532776446, 2.00605526843853, 1.9813941439727223, 1.9897410415007535, 1.9906230122449053, 1.9980786380712945, 1.9863377104757267, 1.9991713506028645, 1.9996350593024055, 1.9726536600202664, 1.986438132662502, 1.9909260515519061, 2.0055955882508987, 1.9965493767350126]

用matlab计算计算标准差std
    0.0132
    0.0106
相对误差标准差除以平均值
    0.0066
    0.0053

与上楼400个数据又有提高一致性达到千分之五



使用特权

评论回复
12
叶春勇|  楼主 | 2021-5-15 15:45 | 只看该作者
当fs=100khz,一次采集1600个数据
a=[1.9859794544621749, 1.9859608802021422, 1.9863176703203267, 1.992477432462292, 1.9896994521053653, 1.9691743035746296, 1.9878459834719513, 1.9861740202276592, 1.988562274078673, 1.982415320555259, 1.9919279680545909, 2.0057507182455185, 1.9832164036633493, 2.0010396312378811, 1.9875034449007909, 1.9768168236032824, 1.991318763851712, 1.9941301776261695, 1.9856549191841959, 1.9893173446631334, 1.9846100702073066, 1.9834328493898177, 1.9850383516107899, 1.9948791060625612, 2.0094229132288475, 1.9907632975634582, 1.9898503942876078, 2.003270870072972, 1.9721560595104641, 1.9953985149996187, 1.9814260174740292, 1.9929409904183597, 1.9865698940652827, 2.0058701536547217, 1.9858849202528071, 1.9986962976324316, 2.0052612375042269, 1.9911977875555451, 2.0071044290400533, 2.0074514691681595, 1.9974500832848201, 1.9997002340263537, 1.9837906694793948, 1.9850901168061053, 1.9793208534150806, 1.9891464454112051, 1.9989843706021497, 2.0042528179106656, 1.9915426253764175, 1.9953476742419662, 1.9910584496540242, 1.9873353607863036, 1.9855476979920024, 1.9949942048465952, 1.9917832996873586, 1.9905207821935227, 1.993050902670702, 1.9803844066024459, 1.9918816251656368, 1.9867436234218827, 2.0013601269225902, 2.0097758225827178, 1.9834828555227977, 1.9880138575294992, 1.9767719474045249, 1.9866545441916696, 1.9944534748314979, 1.9818159451579038, 1.9795121263243227, 1.9832152691297642, 1.9976150872255498, 2.0110577363902493, 1.9754962076575184, 1.9878029412097225, 1.99162194184595, 1.9885698972982231, 1.9772128933188498, 1.987798522460734, 1.9881383236161314, 1.9852555337285054, 1.9963407301888856, 1.9961197527979515, 1.9949919148093538, 1.976686895714572, 1.9943018233842831, 2.0041739875719138, 1.9976286483410188, 1.9890664744358755, 1.9970184815616274, 1.9786809619682122, 1.9672660881515651, 1.994330405176971, 1.9783858215666452, 2.0014645598647833, 1.9943690408323911, 1.9904462974584294, 1.9927339066413214, 2.0056823067790153, 1.9967192538917158, 2.0017994098863809]
b=[1.9993841980982459, 1.9960023883411802, 1.976784119860268, 1.9893552296328183, 1.9792877560639281, 1.9828397974721186, 1.9794316790118398, 1.9748121871817133, 2.0015600280177641, 2.0140937009815714, 1.9574356119158953, 1.9756170799546768, 1.9714891372490719, 1.9729612191162047, 1.9856507042049547, 2.0069546146263626, 2.0066440274644433, 2.0052754103465897, 1.9844762462237089, 2.0012872818328198, 1.9835281504604325, 1.9948093619283451, 1.9737323052873461, 1.9785443108642158, 1.9904326112206212, 2.0018146863265098, 2.0081026199262157, 1.980051749489129, 1.9521323294965971, 2.0182539494446829, 1.9823477575098802, 2.0051917674958069, 1.9897284043351451, 2.01385374692665, 1.9964161331655119, 1.9867923102685423, 2.0020331329501699, 1.9803291075050018, 1.9725212890144102, 1.9879177684947567, 1.9837100201954332, 1.9769465967977917, 2.0070970403523454, 1.9943165776074963, 1.9929523927366952, 1.9897908466972036, 1.9850766630263519, 2.0194323292988252, 1.9843344592302454, 1.9792659307736316, 1.9989462645219522, 1.9837432577278558, 1.9839481945309385, 1.9916834467955951, 1.9975797348693947, 1.9689610352429228, 1.9761400789700214, 1.9569626049271711, 1.9875254648732699, 1.9908900889351595, 1.986779611786524, 1.9991848507547365, 1.992222310845545, 1.9983972447281586, 1.9779377622470893, 1.9751964420081518, 1.9781750091541095, 1.9918573129449337, 1.9929441771469874, 2.003664114065979, 1.9844494086010975, 1.9809945137172269, 1.984195769010757, 1.9834873909519635, 1.986582184606982, 2.0003027061040983, 1.9970414047431653, 1.9938663923556204, 1.9899443192872117, 1.9831226625973501, 1.9895787628846904, 1.9863083303140299, 1.9893819150819732, 1.9869825285544551, 1.9763015418721093, 1.9803321011859354, 1.9816845728085024, 1.9818097351141739, 1.9868399919017576, 2.0012580297536848, 1.9888049593080406, 1.9878638291109603, 1.9873993142632305, 1.9899225697847236, 1.9902657306417932, 1.9759691875021757, 1.9451772715667472, 1.9747582054623301, 1.9908957737607464, 1.9747187283837397]

样本标准差
    0.0091
    0.0129

相对误差
    0.0046
    0.0065

比楼上有略微改进
但是测量速度明显变慢,已经能察觉

使用特权

评论回复
13
xukun977| | 2021-5-15 15:59 | 只看该作者
你要是用3458,一秒测10万个数据,把一天的数据都复制粘贴一遍,21网站要瘫痪了。

使用特权

评论回复
评论
叶春勇 2021-5-15 16:08 回复TA
我是每次采集若干个数据,然后得出结果。每批测量采集的数据不同的。比较下算法 测量结果是2x100个,21ic扛得住的 
14
叶春勇|  楼主 | 2021-5-15 15:59 | 只看该作者
当fs=100khz采集3200个数据时,取两个样本,每个100次
a=[1.9953848252789745, 1.9926122999583309, 2.001097569250053, 1.9861049348870521, 2.0007566679394575, 1.996013351137899, 1.9819189985449166, 1.9896224579798274, 1.9892599998295377, 1.9964450198144748, 1.9973745048247717, 2.0043726948270666, 1.9958083879311792, 1.9838202606003561, 1.9811692831465133, 1.9969356393427864, 1.9941261739545941, 1.9944240244860709, 1.9918644651718054, 1.9992970573453968, 1.9846343635026735, 1.9864092664205257, 1.9846711143339377, 1.9920218732973165, 1.9978309723570005, 1.989285261847251, 1.9911404717519214, 1.9923406340765484, 1.9825269135626926, 1.9847584954913462, 1.9911142346532646, 1.997579609428521, 1.9917043123008977, 1.9881635178043022, 1.9819145054914216, 2.003097807802007, 1.9753690313485923, 1.9813672460509304, 2.0032741129347431, 1.9867213331381153, 1.995120016431146, 1.9889168971835898, 1.9965321352018912, 1.9825212338880494, 1.9940361511495981, 1.9951354201680096, 1.9808604712774003, 1.9896980581671573, 1.9887808325488578, 2.0078837685552342, 1.9716923622636333, 1.980426223945198, 1.9914470078009052, 1.9997098502274659, 1.9914348875896708, 1.9865144425493364, 1.9860686402452385, 1.9832873992635838, 1.9914242127492479, 1.9982392488227056, 1.9838631727817941, 1.9899213696533464, 1.9958103138640206, 2.0011439496353547, 1.9899423585817291, 1.996973262672247, 1.9816110607107571, 1.9900315746112203, 1.991087461098402, 1.9971901164879304, 1.9896448354668905, 2.0061305422050446, 1.9958423859719376, 1.9797846602720599, 1.9914550609626209, 2.0003551861522477, 1.9787239632909355, 1.9966740695034304, 1.9897648280482041, 1.9965650732421159, 1.9899166989346229, 1.9956991129508588, 1.9929785066940313, 1.9932319498610276, 2.0066220969011188, 1.9949917536312978, 1.9912418310131603, 1.9827132911399461, 1.9994157186657975, 1.9880631634262, 1.9775462337232776, 1.9991098013558311, 1.9883190606873622, 1.9855106509898228, 1.9881580786122206, 1.983257688908338, 1.9942364044867182, 1.9874191617938977, 1.9975044662241108, 1.9881305975075403]
b=[2.0021191654718455, 1.9855891237765317, 1.9791297653243543, 1.9836594518154527, 2.0044522957611139, 1.9867508819974962, 1.9897764016596049, 1.9954556357565574, 1.9886493526006184, 1.9877971167709487, 1.9965524841686813, 2.0013794213835099, 1.9769929647330702, 1.9966855259290555, 1.9981806903816679, 1.9871611091616996, 1.9886814659308238, 1.9989666300732751, 2.0008546904707516, 1.9948937448019675, 1.9881415749718936, 1.9889549993492004, 1.9960252018374065, 1.9897490852730078, 1.9830047933952262, 1.9909861414171091, 1.9872269113001453, 1.9903034302474114, 1.9971380534726653, 1.9959194873454187, 1.9993323718989549, 1.9912517258549696, 1.9859724278352111, 1.9980911857221262, 1.9850725084896597, 2.0013936587489423, 1.986520451148448, 1.9960379399139556, 1.9832038224341646, 2.0006450918445911, 1.9863321594915651, 1.992179668562873, 1.9990098273495833, 1.9993126113189357, 1.988197583739244, 1.9933413495487984, 1.9948983748314084, 2.003969762412976, 1.99020745565193, 1.9919835286074665, 2.0023406597957605, 1.9913620969172241, 1.9891441875586424, 1.993660433652769, 2.0021950066988254, 1.9921047612505305, 1.9853846112275115, 1.9761934764617952, 1.9879810869018399, 1.9959933640185641, 1.9840598488753352, 1.985222802881683, 1.9860114998813818, 1.9993900440814987, 1.9936058229500122, 1.9810218733369309, 1.9891197464682897, 1.9972904203796853, 1.9835651549054525, 2.0013860508060972, 1.9961018651429883, 1.9851408827738335, 1.9912262728831454, 1.9930501915972936, 1.987425428804056, 2.0007475276746756, 1.9802016427765172, 1.9835281428655664, 1.9889650934785987, 2.0002693667529381, 1.9836917762080426, 1.9856664268465054, 1.9935797247220712, 1.9937414183261992, 1.9891292270586285, 1.9955943381313146, 1.995691494353943, 1.9929017605885053, 1.9764513472579894, 1.9856707316550974, 1.9955786822986419, 1.9876622805699906, 1.9929694102456166, 1.9836415737674042, 1.9924327336499794, 2.0002997840884182, 1.9848563591392292, 1.9919833556955466, 1.9946402391648343, 1.9808987643862124]
样本标准差
    0.0072
    0.0067

相对误差
    0.0036
    0.0033

较楼上数据稳定性进一步提高达到千分之三
受stm32f103c8t6的硬件限制,只有20kb内存,6400个数据=6400*2*2=24kb超出内存。
网上传的某国产,疑用stm32的手持数字电桥,网友猜测时dsp直接处理的,有数据支撑,0.3%的精度,我的电路时最精简,最垃圾的。如果采用stm32的100脚系列,ram大幅提升,还可以加数据量。

使用特权

评论回复
15
叶春勇|  楼主 | 2021-5-15 16:01 | 只看该作者
xukun977 发表于 2021-5-15 15:59
你要是用3458,一秒测10万个数据,把一天的数据都复制粘贴一遍,21网站要瘫痪了。 ...

我在分析硬件的一致性,今年学了概率论与数理统计,实际应用一下。
你有更好的方法吗?

使用特权

评论回复
16
xukun977| | 2021-5-15 16:08 | 只看该作者


关于香农采样定理,这个破玩意需要看博士论文吗???世界上哪本信号理论教课书上没有这个????

使用特权

评论回复
17
叶春勇|  楼主 | 2021-5-15 16:12 | 只看该作者
xukun977 发表于 2021-5-15 16:08
关于香农采样定理,这个破玩意需要看博士论文吗???世界上哪本信号理论教课书上没有这个???? ...

采样频率没变呀。信号频率没变,只是单次测量采集数据量有变化。跟香农采样定律有什么关系?这个博士论文,百度搜的,白瞟的。

使用特权

评论回复
18
叶春勇|  楼主 | 2021-5-15 16:27 | 只看该作者
本帖最后由 叶春勇 于 2021-5-15 16:29 编辑

@Jack315 看一下,分析硬件的测量一致性,是这种方法吗?
用标准差除以均值,真值大概为2

使用特权

评论回复
19
Jack315| | 2021-5-15 17:55 | 只看该作者
叶春勇 发表于 2021-5-15 16:27
@Jack315 看一下,分析硬件的测量一致性,是这种方法吗?
用标准差除以均值,真值大概为2  ...

先给个明确答案:分析硬件测量的一致性不是这个方法。

解释一下进行的这个测量在统计上的含义:
连续采样 k 次,代表了 k 个观察值。
假设读数服从 N(m, s^2) 分布,
其中:
m 为均值,k 个观察值的的平均值是 m 的估计值;
s 为标准差,由 k 个观察值求得的标准差乘以 sqrt(k) 是 s 的估计值。
虽然随着 k 的增大,由 k 个观察值求得的标准差变小,但 s 实际上基本不变。
知识点:k 个服从相同 N(m, s^2) 分布的值叠加后的标准差。

使用特权

评论回复
20
Jack315| | 2021-5-15 18:14 | 只看该作者

假设读数服从 N(m, s^2) 分布、被测量值的真值为 x,
则 m - x 代表的是准确度,s 代表的是精确度。
k 次测量观察值求得的标准差,并不代表测量精度的提高。

测量系统的分析一般用 GRR:
Gauge Repeatability and Reproducibility
量具的重复性和再现性。

这里先打住了,有兴趣的小伙伴问度娘吧。

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

151

主题

4810

帖子

50

粉丝