analog&RFmodels
10-08-2019, 10:18 PM
hi all,
is this the right place to put this ?
this code compiles/runs fine teensy3.6 180 mhz debug (debug only)
but crashes during compile for teensy4.0 600 mhz debug
am running win7pro 64 bit, Arduino 1.8.5, Teensyduino 1.48 released
the code does not use any hardware other than led
enclosed are code and verbose error list
Arduino: 1.8.5 (Windows 7), TD: 1.48, Board: "Teensy 4.0, Serial, 600 MHz, Debug, US English"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Dell\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt= ogstd,keys=en-us -ide-version=10805 -build-path C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047 -warnings=none -build-cache C:\Users\Dell\AppData\Local\Temp\arduino_cache_780 063 -verbose C:\Users\Dell\Documents\Arduino\libraries\arf1\arf 1.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\Dell\Documents\Arduino\libraries -fqbn=teensy:avr:teensy40:usb=serial,speed=600,opt= ogstd,keys=en-us -ide-version=10805 -build-path C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047 -warnings=none -build-cache C:\Users\Dell\AppData\Local\Temp\arduino_cache_780 063 -verbose C:\Users\Dell\Documents\Arduino\libraries\arf1\arf 1.ino
Using board 'teensy40' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
Using core 'teensy4' from platform in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr
Detecting libraries used...
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=148 -DARDUINO=10805 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047\sketch\arf1.ino.cpp" -o "nul"
Generating function prototypes...
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -E -CC -x c++ -w -g -Wall -ffunction-sections -fdata-sections -nostdlib -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=148 -DARDUINO=10805 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047\sketch\arf1.ino.cpp" -o "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047\preproc\ctags_target_for_gcc_minus_e.cpp"
"C:\Program Files (x86)\Arduino\tools-builder\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047\preproc\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/precompile_helper" "C:\Program Files (x86)\Arduino\hardware\teensy\avr/cores/teensy4" "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047" "C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -x c++-header -Og -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=148 -DARDUINO=10805 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr/cores/teensy4" "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047/pch/Arduino.h" -o "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047/pch/Arduino.h.gch"
Using previously compiled file: C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047\pch\Arduino.h.gch
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-g++" -c -Og -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -std=gnu++14 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=148 -DARDUINO=10805 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\Users\Dell\AppData\Local\Temp\arduino_build_91 7047/pch" "-IC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4" "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047\sketch\arf1.ino.cpp" -o "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047\sketch\arf1.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"C:\Program Files (x86)\Arduino\hardware\teensy/../tools/arm/bin/arm-none-eabi-gcc" -Og -Wl,--gc-sections,--relax "-TC:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/imxrt1062.ld" -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -o "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047/arf1.ino.elf" "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047\sketch\arf1.ino.cpp.o" "C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047/..\arduino_cache_780063\core\core_teensy_avr_teens y40_usb_serial,speed_600,opt_ogstd,keys_en-us_4939f5412a75a8560acb0f9e98268f02.a" "-LC:\Users\Dell\AppData\Local\Temp\arduino_build_91 7047" -larm_cortexM7lfsp_math -lm -lstdc++
C:\Users\Dell\AppData\Local\Temp\arduino_build_917 047/..\arduino_cache_780063\core\core_teensy_avr_teens y40_usb_serial,speed_600,opt_ogstd,keys_en-us_4939f5412a75a8560acb0f9e98268f02.a(startup.c.o) : In function `ResetHandler':
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/startup.c:135: undefined reference to `setup'
C:\Program Files (x86)\Arduino\hardware\teensy\avr\cores\teensy4/startup.c:139: undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
Error compiling for board Teensy 4.0.
// FFT W PRINT AND CONST TABLE FOR WINDOW
// has input gen and 12 bit ad sim
// t36 180mhz debug w lto
// single 8.1 ms double 54.9 ms
// define some constants
#define unit 1.0
#define half 0.5
#define two 2.0
#define rad 57.2957795
// define for atan, asin, acos
#define pi 3.14159265
#define pio2 1.57079633
// define for sqrt
#define sqrt2 1.41421356
// define for log, exp
#define ln2 0.6931471806
#define ln10 2.30258509
union u {
signed short int adin[1100];
float d2[256];
};
union u ary;
float d1[256];
// all poly terms stored in one array to allow
// ref by pointer in subroutines that are
// called by poly solvers
int led = 13;
float q,x,xa,y,nng,xp;
float t1,t2,s,c,a,m,fi,nnf,nnfr,jlf,jrf;
unsigned short int n1,n2,n3,n4,n5,n6,n7,n8,n9,nn,il,jl;
signed short int yi;
unsigned short int flag;
unsigned short int i,j,n;
unsigned short int flg1,flg2,flg3,flg4,flg5,flg6,flg7,flg8,flg9;
char fchar;
signed short int r0;
float const win [256] = {
0.000000E+00, 4.470349E-08, 7.301569E-07, 3.591180E-06,
1.162291E-05, 2.828241E-05, 5.851686E-05, 1.083165E-04,
1.845211E-04, 2.951622E-04, 4.489422E-04, 6.560385E-04,
9.270459E-04, 1.273662E-03, 1.708508E-03, 2.244964E-03,
2.897143E-03, 3.679946E-03, 4.609019E-03, 5.700469E-03,
6.971255E-03, 8.438721E-03, 1.012060E-02, 1.203514E-02,
1.420127E-02, 1.663765E-02, 1.936364E-02, 2.239862E-02,
2.576207E-02, 2.947374E-02, 3.355316E-02, 3.801981E-02,
4.289316E-02, 4.819256E-02, 5.393678E-02, 6.014456E-02,
6.683409E-02, 7.402332E-02, 8.172951E-02, 8.996935E-02,
9.875893E-02, 1.081136E-01, 1.180480E-01, 1.285761E-01,
1.397107E-01, 1.514639E-01, 1.638466E-01, 1.768690E-01,
1.905398E-01, 2.048672E-01, 2.198576E-01, 2.355164E-01,
2.518480E-01, 2.688551E-01, 2.865396E-01, 3.049015E-01,
3.239399E-01, 3.436521E-01, 3.640344E-01, 3.850816E-01,
4.067865E-01, 4.291414E-01, 4.521362E-01, 4.757600E-01,
5.000001E-01, 5.248423E-01, 5.502715E-01, 5.762705E-01,
6.028209E-01, 6.299029E-01, 6.574955E-01, 6.855760E-01,
7.141204E-01, 7.431040E-01, 7.724999E-01, 8.022808E-01,
8.324174E-01, 8.628799E-01, 8.936374E-01, 9.246574E-01,
9.559069E-01, 9.873516E-01, 1.018957E+00, 1.050687E+00,
1.082504E+00, 1.114373E+00, 1.146254E+00, 1.178109E+00,
1.209899E+00, 1.241586E+00, 1.273128E+00, 1.304487E+00,
1.335621E+00, 1.366490E+00, 1.397055E+00, 1.427274E+00,
1.457107E+00, 1.486514E+00, 1.515456E+00, 1.543891E+00,
1.571783E+00, 1.599092E+00, 1.625779E+00, 1.651807E+00,
1.677141E+00, 1.701743E+00, 1.725578E+00, 1.748613E+00,
1.770814E+00, 1.792149E+00, 1.812588E+00, 1.832100E+00,
1.850656E+00, 1.868231E+00, 1.884797E+00, 1.900330E+00,
1.914808E+00, 1.928208E+00, 1.940512E+00, 1.951700E+00,
1.961755E+00, 1.970664E+00, 1.978412E+00, 1.984987E+00,
1.990381E+00, 1.994585E+00, 1.997592E+00, 1.999398E+00,
2.000000E+00, 1.999398E+00, 1.997592E+00, 1.994585E+00,
1.990381E+00, 1.984987E+00, 1.978412E+00, 1.970664E+00,
1.961755E+00, 1.951700E+00, 1.940512E+00, 1.928208E+00,
1.914808E+00, 1.900330E+00, 1.884797E+00, 1.868231E+00,
1.850656E+00, 1.832100E+00, 1.812588E+00, 1.792149E+00,
1.770814E+00, 1.748613E+00, 1.725578E+00, 1.701742E+00,
1.677140E+00, 1.651807E+00, 1.625779E+00, 1.599091E+00,
1.571783E+00, 1.543891E+00, 1.515455E+00, 1.486514E+00,
1.457107E+00, 1.427274E+00, 1.397055E+00, 1.366490E+00,
1.335621E+00, 1.304487E+00, 1.273128E+00, 1.241586E+00,
1.209899E+00, 1.178109E+00, 1.146254E+00, 1.114373E+00,
1.082504E+00, 1.050686E+00, 1.018957E+00, 9.873512E-01,
9.559069E-01, 9.246574E-01, 8.936372E-01, 8.628797E-01,
8.324171E-01, 8.022803E-01, 7.724995E-01, 7.431036E-01,
7.141205E-01, 6.855759E-01, 6.574953E-01, 6.299028E-01,
6.028206E-01, 5.762701E-01, 5.502716E-01, 5.248424E-01,
5.000000E-01, 4.757598E-01, 4.521360E-01, 4.291411E-01,
4.067863E-01, 3.850812E-01, 3.640345E-01, 3.436521E-01,
3.239397E-01, 3.049013E-01, 2.865393E-01, 2.688549E-01,
2.518480E-01, 2.355164E-01, 2.198575E-01, 2.048671E-01,
1.905398E-01, 1.768688E-01, 1.638464E-01, 1.514637E-01,
1.397107E-01, 1.285761E-01, 1.180480E-01, 1.081136E-01,
9.875878E-02, 8.996922E-02, 8.172954E-02, 7.402332E-02,
6.683411E-02, 6.014448E-02, 5.393672E-02, 4.819247E-02,
4.289310E-02, 3.801984E-02, 3.355316E-02, 2.947377E-02,
2.576209E-02, 2.239856E-02, 1.936355E-02, 1.663765E-02,
1.420123E-02, 1.203514E-02, 1.012062E-02, 8.438602E-03,
6.971300E-03, 5.700529E-03, 4.609034E-03, 3.679931E-03,
2.897143E-03, 2.244890E-03, 1.708493E-03, 1.273632E-03,
9.270012E-04, 6.559640E-04, 4.489422E-04, 2.951920E-04,
1.846105E-04, 1.084060E-04, 5.850196E-05, 2.829731E-05,
1.163781E-05, 3.606081E-06, 7.450581E-07, 0.000000E+00,
};
float const h[33]={
3.306290E-04, 8.395911E-04, 1.004346E-03,-1.057719E-03,
-6.058753E-03,-8.971486E-03,-1.786884E-08, 2.332381E-02,
4.172762E-02, 2.006667E-02,-5.539681E-02,-1.355107E-01,
-1.151403E-01, 9.022949E-02, 4.507063E-01, 8.036606E-01,
9.509602E-01, 8.036606E-01, 4.507062E-01, 9.022947E-02,
-1.151403E-01,-1.355106E-01,-5.539678E-02, 2.006667E-02,
4.172761E-02, 2.332380E-02,-1.786883E-08,-8.971481E-03,
-6.058748E-03,-1.057718E-03, 1.004345E-03, 8.395896E-04,
3.306290E-04, };
signed short int const ad[1100]={
+0, +76, +154, +230, +304, +378, +450, +522, +594, +662,
+730, +794, +856, +914, +970, +1024, +1074, +1124, +1168, +1210,
+1248, +1282, +1312, +1340, +1364, +1386, +1404, +1420, +1432, +1438,
+1442, +1444, +1442, +1438, +1434, +1426, +1416, +1402, +1386, +1368,
+1348, +1328, +1308, +1286, +1264, +1240, +1216, +1190, +1164, +1138,
+1114, +1090, +1068, +1046, +1022, +1000, +978, +958, +940, +924,
+908, +896, +882, +870, +858, +848, +840, +834, +830, +826,
+824, +822, +818, +818, +816, +816, +818, +820, +822, +824,
+824, +822, +820, +820, +818, +814, +810, +806, +798, +788,
+776, +762, +746, +728, +710, +688, +664, +636, +604, +572,
+536, +498, +458, +416, +370, +322, +270, +216, +160, +102,
+44, -16, -78, -142, -210, -278, -346, -416, -486, -554,
-624, -692, -762, -832, -900, -968, -1034, -1098, -1160, -1220,
-1278, -1334, -1390, -1442, -1490, -1534, -1576, -1614, -1648, -1680,
-1708, -1734, -1754, -1772, -1784, -1792, -1796, -1796, -1794, -1788,
-1780, -1766, -1750, -1728, -1704, -1676, -1646, -1614, -1580, -1544,
-1504, -1462, -1418, -1370, -1324, -1276, -1228, -1178, -1130, -1078,
-1026, -974, -924, -874, -824, -776, -728, -682, -636, -592,
-548, -506, -466, -428, -394, -360, -328, -296, -266, -238,
-212, -190, -168, -150, -132, -114, -98, -82, -70, -58,
-46, -38, -28, -18, -10, +2, +10, +20, +30, +38,
+48, +60, +72, +86, +102, +120, +136, +156, +174, +196,
+220, +246, +276, +306, +338, +370, +406, +442, +480, +520,
+562, +608, +652, +698, +746, +792, +842, +892, +942, +994,
+1046, +1096, +1148, +1196, +1244, +1292, +1340, +1388, +1434, +1476,
+1518, +1556, +1592, +1626, +1656, +1686, +1712, +1736, +1754, +1770,
+1782, +1788, +1794, +1794, +1792, +1786, +1778, +1764, +1744, +1722,
+1694, +1666, +1632, +1598, +1558, +1516, +1468, +1418, +1366, +1310,
+1254, +1194, +1134, +1072, +1006, +940, +870, +802, +732, +662,
+594, +524, +456, +386, +316, +248, +180, +114, +52, -10,
-70, -128, -186, -240, -294, -344, -392, -434, -476, -516,
-552, -588, -620, -650, -676, -700, -720, -738, -754, -770,
-782, -794, -804, -810, -814, -818, -820, -822, -824, -824,
-826, -824, -824, -822, -820, -818, -818, -820, -822, -824,
-826, -830, -832, -838, -846, -854, -864, -876, -890, -902,
-916, -932, -950, -968, -990, -1012, -1034, -1056, -1080, -1102,
-1126, -1150, -1176, -1202, -1228, -1252, -1276, -1296, -1318, -1338,
-1358, -1378, -1394, -1410, -1422, -1432, -1438, -1442, -1446, -1446,
-1444, -1438, -1430, -1416, -1400, -1380, -1356, -1332, -1302, -1272,
-1236, -1196, -1152, -1106, -1056, -1004, -950, -894, -834, -772,
-706, -638, -568, -496, -424, -350, -276, -202, -126, -48,
+30, +108, +184, +260, +334, +406, +480, +550, +622, +690,
+756, +820, +880, +936, +992, +1044, +1094, +1142, +1186, +1226,
+1262, +1294, +1324, +1350, +1374, +1394, +1412, +1424, +1434, +1440,
+1444, +1444, +1442, +1438, +1430, +1422, +1410, +1396, +1378, +1360,
+1340, +1320, +1300, +1278, +1254, +1230, +1206, +1180, +1154, +1128,
+1104, +1082, +1058, +1036, +1014, +992, +970, +952, +934, +918,
+904, +890, +878, +866, +854, +844, +838, +832, +828, +824,
+822, +820, +818, +816, +816, +818, +818, +820, +822, +824,
+824, +822, +820, +818, +816, +814, +808, +802, +794, +784,
+770, +756, +740, +722, +702, +678, +652, +624, +592, +558,
+520, +482, +442, +398, +352, +302, +250, +194, +138, +80,
+20, -42, -104, -170, -236, -304, -374, -444, -512, -582,
-650, -720, -790, -860, -928, -996, -1060, -1124, -1184, -1244,
-1300, -1356, -1410, -1462, -1508, -1552, -1592, -1628, -1660, -1692,
-1718, -1742, -1762, -1776, -1788, -1794, -1796, -1796, -1792, -1786,
-1774, -1760, -1742, -1718, -1692, -1664, -1634, -1600, -1566, -1528,
-1488, -1444, -1398, -1352, -1304, -1256, -1208, -1160, -1108, -1058,
-1006, -954, -904, -854, -804, -758, -710, -664, -618, -574,
-530, -490, -450, -414, -380, -346, -314, -284, -254, -228,
-204, -182, -162, -142, -124, -108, -92, -78, -64, -52,
-42, -34, -24, -14, -6, +6, +14, +24, +34, +42,
+52, +64, +78, +94, +110, +126, +144, +162, +184, +206,
+230, +258, +288, +318, +350, +384, +420, +456, +496, +536,
+580, +626, +672, +718, +764, +812, +862, +912, +962, +1014,
+1066, +1118, +1166, +1216, +1264, +1312, +1360, +1406, +1450, +1494,
+1534, +1570, +1606, +1638, +1668, +1696, +1722, +1744, +1762, +1776,
+1784, +1792, +1794, +1794, +1790, +1784, +1772, +1756, +1736, +1712,
+1684, +1652, +1618, +1582, +1542, +1498, +1450, +1398, +1344, +1288,
+1230, +1170, +1110, +1046, +980, +912, +844, +774, +704, +636,
+566, +498, +428, +358, +288, +220, +154, +90, +26, -34,
-94, -152, -208, -262, -314, -364, -408, -452, -492, -530,
-566, -600, -632, -660, -686, -708, -728, -744, -760, -774,
-788, -798, -806, -812, -816, -818, -820, -822, -824, -826,
-826, -824, -822, -820, -818, -818, -820, -820, -822, -824,
-828, -830, -834, -840, -848, -858, -870, -882, -894, -908,
-922, -938, -956, -976, -998, -1020, -1042, -1066, -1088, -1112,
-1136, -1160, -1186, -1212, -1238, -1262, -1284, -1306, -1326, -1346,
-1366, -1384, -1400, -1414, -1426, -1434, -1440, -1444, -1446, -1446,
-1442, -1436, -1424, -1410, -1392, -1370, -1346, -1320, -1290, -1258,
-1220, -1180, -1134, -1086, -1036, -982, -928, -870, -808, -746,
-678, -610, -538, -466, -394, -322, -246, -172, -94, -16,
+62, +138, +214, +290, +364, +436, +508, +580, +650, +716,
+782, +844, +902, +958, +1012, +1064, +1114, +1160, +1202, +1242,
+1276, +1306, +1334, +1360, +1382, +1402, +1418, +1430, +1438, +1442,
+1444, +1442, +1440, +1434, +1428, +1418, +1404, +1390, +1372, +1352,
+1332, +1312, +1290, +1268, +1246, +1220, +1194, +1168, +1144, +1120,
+1096, +1072, +1050, +1028, +1004, +984, +962, +944, +926, +912,
+898, +884, +872, +860, +850, +842, +834, +830, +826, +824,
+822, +820, +818, +816, +816, +818, +820, +822, +822, +824,
+822, +822, +820, +818, +816, +812, +806, +800, +790, +778,
+764, +748, +732, +714, +692, +668, +642, +612, +578, +542,
+506, +466, +424, +380, +332, +282, +228, +172, +114, +56,
-4, -66, -130, -196, -264, -332, -402, -472, -540, -610,
-678, -748, -818, -886, -956, -1022, -1086, -1148, -1208, -1266,
-1324, -1378, -1432, -1480, -1526, -1568, -1606, -1642, -1674, -1702,
-1728, -1750, -1768, -1782, -1790, -1796, -1796, -1794, -1790, -1782,
-1770, -1754, -1732, -1708, -1682, -1652, -1620, -1588, -1550, -1512,
-1470, -1426, -1380, -1334, -1286, -1238, -1188, -1140, -1088, -1038,
-986, -934, -884, -834, -786, -738, -692, -646, -600, -556,
-514, -474, -436, -400, -366, -334, -302, -272, -244, -218,
-194, -172, -154, -136, -118, -102, -86, -72, -60, -48,
-40, -30, -20, -10, -2, +8, +18, +28, +38, +46,
+58, +70, +84, +100, +116, +134, +152, +170, +192, +216,
+242, +270, +300, +332, +364, +398, +434, +472, +512, +554,
+598, +644, +690, +736, +784, +832, +882, +932, +984, +1036,
+1086, +1138, +1186, +1236, +1284, +1332, +1378, +1424, +1468, +1510,
+1548, +1586, +1618, +1650, +1680, +1706, +1730, +1752, +1768, +1780,
+1788, +1792, +1794, +1794, +1788, +1780, +1766, +1748, +1726, +1700,
+1672, +1640, +1604, +1566, +1524, +1478, +1430, +1376, +1322, +1264,
};
void pfps() {
}
int main()
{
pinMode(led, OUTPUT);
// 256 input points
// 128 ouput points
mloop:
nn=256;
nnf=256.0;
nng=1024.0;
n5=1100;
fi=1.0;
// clear array d1
for(jl=0;jl <= (nn-1);++jl)
{
d1[jl]=0.0;
}
// clear array adin
for(jl=0;jl <= n5;++jl)
{
ary.adin[jl]=0.0;
}
// fill input array 3 terms
// and round to 12 bit ints
fchar=5;
xa=0;
for(jl=0;jl<(n5-1);++jl)
{
ary.adin[jl]=ad[jl];
// xp=ary.adin[jl];
// pfps();
}
// do sinc filter
n=32;
n4=32;
jl=n5;
loop1:
y=0;
i=0;
loop2:
q=ary.adin[jl-i];
q=q*h[i];
y=y+q;
++i;
if (i < n) goto loop2;
yi=(signed short int)y;
ary.adin[jl]=yi;
// xp=yi;
// pfps();
jl=jl-1;
if (jl >= n4) goto loop1;
// do decimate by 4
jl=0;
loop3:
il=jl+8;
il=il*4;
yi=ary.adin[il];
d1[jl]=(float)(yi/1.0);
// xp=d1[jl];
// pfps();
++jl;
if (jl < (nn-1)) goto loop3;
// do window
n9=nn-1;
for(jl=0;jl <= n9;++jl)
{
x=d1[jl];
y=win[jl];
x=x*y;
d1[jl]=x;
// xp=x;
// pfps();
}
// clear array d2 of union leftovers
n9=nn-1;
for(jl=0;jl <= n9;++jl)
{
ary.d2[jl]=0.0;
}
// do fft
n1=0;
n2=nn-1;
for(n3=1;n3<=n2;++n3)
{
n4=nn;
l1470:
n4=n4/2;
if((n1+n4) > n2) goto l1470;
n1=n1-((n1/n4)*n4)+n4;
if(n1 <= n3)goto l1520;
t1=d1[n3];
xa=d1[n1];
d1[n3]=xa;
d1[n1]=t1;
t2=ary.d2[n3];
xa=ary.d2[n1];
ary.d2[n3]=xa;
ary.d2[n1]=t2;
l1520:
n4=n4;
}
n4=1;
l1530:
n6=n4*2;
for(n3=0;n3<=(n4-1);++n3)
{
a=fi*(float)n3;
a=a*pi;
a=a/(float)n4;
x=a;
// fchar=5;
// sincos();
x=sinf(x);
// x=sinl(x);
// x=sinfl(x);
s=x;
x=a;
// fchar=6;
// sincos();
x=cosf(x);
// x=cosl(x);
// x=cosfl(x);
c=x;
for(n7=n3;n7<=(nn-1);n7=(n7+n6))
{
n8=n7+n4;
x=d1[n8];
y=ary.d2[n8];
t1=c*x;
t1=t1-(s*y);
t2=c*y;
t2=t2+s*x;
x=d1[n7];
y=ary.d2[n7];
d1[n8]=x-t1;
ary.d2[n8]=y-t2;
d1[n7]=x+t1;
ary.d2[n7]=y+t2;
}
}
n4=n6;
if(n4 < nn) goto l1530;
// do post fft proc
nnfr=1.0/nnf;
nn=nn/2;
nn=nn-1;
for(il=0;il<=nn;++il)
{
x=d1[il]*d1[il];
x=x+ary.d2[il]*ary.d2[il];
x=sqrtf(x);
d1[il]=x*nnfr;
xp=d1[il];
pfps();
}
if (flag == 0) {flag=1; digitalWrite(led, HIGH); goto mloop;}
if (flag == 1) {flag=0; digitalWrite(led, LOW); goto mloop;}
}
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.