Part Number: MSP430FR6047
Tool/software:
Problem Statement:- Suppose I have 160 ADC samples each for both UPS & DNS. These samples are at 0.25 micro seconds period. Now In excel using cosine interpolation i created 1000 samples between each sample, so my total samples will be now 160000. This means I have now samples at 0.25 nano seconds. Now if I shift the new samples by 10 samples & pick up the 160 samples at 0.25 micro seconds & put those in code then my DTOF will be 2.5 nanoseconds. But it gives zero DTOF.
My ultimate goal is that in excel I will create a known shift and then pick up the shifted 160 samples of ADC and then put those 160 samples in ADC buffer inside the code. So it should give me that exact DTOF. Code is not returning error it works fine, it gives DTOF value but not matching with my exact shift. I can share the excel sheet with you if it is required to you.
Here this is my waveform as shown below. The UPS is shifted 100 samples w.r.t DNS.
UPS array[160] = {0,33,32,28,26,26,30,27,25,25,29,26,24,25,27,24,21,26,27,23,21,0,1,1,2,3,5,4,4,6,7,7,12,9,-10,25,60,-81,-147,224,289,-285,-342,435,488,-490,-520,652,658,-707,-680,860,802,-900,-801,1046,906,-1070,-894,1207,991,-1201,-962,1265,976,-1225,-935,1272,1035,-1285,-962,1349,1054,-1334,-971,1334,990,-1360,-980,1424,1072,-1385,-984,1375,939,-1394,-997,1393,1014,-1353,-913,1433,1071,-1387,-1028,1393,1001,-1343,-953,1427,1119,-1348,-965,1413,1088,-1356,-971,1432,1147,-1397,-1082,1366,1028,-1346,-1014,1372,1041,-1411,-1091,1405,1039,-1365,-1009,1442,1145,-1379,-997,1423,1042,-1424,-1092,1437,1074,-1374,-970,1398,989,-1334,-859,1373,883,-1274,-843,1243,1549,-1933,-1105,1575,898,-1103,-578,840,443,-517,-245,324,149,-128,-38,0};
DNS array[160] = {-14,22,33,31,28,26,29,30,24,25,30,29,23,23,28,27,23,26,29,26,21,0,1,2,2,4,5,5,5,6,9,9,12,15,-5,1,66,34,-174,36,353,-8,-449,77,634,-44,-713,127,896,-105,-965,191,1131,-172,-1173,263,1322,-246,-1343,329,1478,-300,-1471,370,1479,-346,-1437,415,1500,-380,-1546,443,1555,-387,-1524,463,1655,-408,-1540,461,1631,-416,-1558,475,1628,-421,-1565,455,1494,-460,-1481,526,1656,-416,-1574,471,1615,-416,-1582,456,1634,-399,-1490,490,1689,-383,-1493,444,1561,-450,-1605,451,1631,-420,-1521,478,1613,-406,-1520,458,1568,-478,-1614,452,1597,-434,-1520,490,1593,-428,-1518,461,1544,-436,-1507,501,1536,-498,-1464,508,1442,-437,-1342,412,229,-64,-170,58,135,-37,-91,32,67,-17,-39,13,22,-4,-6,0};