{"id":185,"date":"2012-11-22T19:37:20","date_gmt":"2012-11-22T19:37:20","guid":{"rendered":"http:\/\/mitat.tuu.fi\/?p=185"},"modified":"2012-11-22T19:48:08","modified_gmt":"2012-11-22T19:48:08","slug":"arduino-due-performance-on-sin","status":"publish","type":"post","link":"http:\/\/mitat.tuu.fi\/?p=185","title":{"rendered":"Arduino Due performance on sin()"},"content":{"rendered":"<p>Tested running 100.000 sin() calls and it took 2594 milliseconds. That means you make call sin() at 38.55kHz. If you want to make 44.1kHz sound in real-time there&#8217;s no way you can use the sin() method.<\/p>\n<p>Here&#8217;s the code I used<br \/>\n<code><\/p>\n<p>void SpeedTest()<br \/>\n{<br \/>\n  float f = 1.23;<\/p>\n<p>  Serial.println(millis());<\/p>\n<p>  for (uint32_t i=0; i<10000; i++)\n  {\n    f=sin(f);\n    f=sin(f);\n    f=sin(f);\n    f=sin(f);\n    f=sin(f);\n\n    f=sin(f);\n    f=sin(f);\n    f=sin(f);\n    f=sin(f);\n    f=sin(f);\n    \n  }\n  \n  \n  \n    Serial.println(millis());\n    \n    Serial.println(f);\n\n}<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Tested running 100.000 sin() calls and it took 2594 milliseconds. That means you make call sin() at 38.55kHz. If you want to make 44.1kHz sound in real-time there&#8217;s no way you can use the sin() method. Here&#8217;s the code I used void SpeedTest() { float f = 1.23; Serial.println(millis()); for (uint32_t i=0; i<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,8,11],"tags":[],"class_list":["post-185","post","type-post","status-publish","format-standard","hentry","category-code","category-measured","category-snippet"],"_links":{"self":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/185","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=185"}],"version-history":[{"count":3,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/185\/revisions"}],"predecessor-version":[{"id":187,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=\/wp\/v2\/posts\/185\/revisions\/187"}],"wp:attachment":[{"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=185"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=185"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/mitat.tuu.fi\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=185"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}