{"action":"closed","issue":{"url":"https://api.github.com/repos/BelaPlatform/Bela/issues/115","repository_url":"https://api.github.com/repos/BelaPlatform/Bela","labels_url":"https://api.github.com/repos/BelaPlatform/Bela/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/BelaPlatform/Bela/issues/115/comments","events_url":"https://api.github.com/repos/BelaPlatform/Bela/issues/115/events","html_url":"https://github.com/BelaPlatform/Bela/issues/115","id":175068698,"number":115,"title":"IDE scope CPU usage","user":{"login":"giuliomoro","id":4260604,"avatar_url":"https://avatars0.githubusercontent.com/u/4260604?v=4","gravatar_id":"","url":"https://api.github.com/users/giuliomoro","html_url":"https://github.com/giuliomoro","followers_url":"https://api.github.com/users/giuliomoro/followers","following_url":"https://api.github.com/users/giuliomoro/following{/other_user}","gists_url":"https://api.github.com/users/giuliomoro/gists{/gist_id}","starred_url":"https://api.github.com/users/giuliomoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuliomoro/subscriptions","organizations_url":"https://api.github.com/users/giuliomoro/orgs","repos_url":"https://api.github.com/users/giuliomoro/repos","events_url":"https://api.github.com/users/giuliomoro/events{/privacy}","received_events_url":"https://api.github.com/users/giuliomoro/received_events","type":"User","site_admin":false},"labels":[{"id":398212182,"url":"https://api.github.com/repos/BelaPlatform/Bela/labels/IDE","name":"IDE","color":"bfd4f2","default":false},{"id":396814225,"url":"https://api.github.com/repos/BelaPlatform/Bela/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":{"login":"giuliomoro","id":4260604,"avatar_url":"https://avatars0.githubusercontent.com/u/4260604?v=4","gravatar_id":"","url":"https://api.github.com/users/giuliomoro","html_url":"https://github.com/giuliomoro","followers_url":"https://api.github.com/users/giuliomoro/followers","following_url":"https://api.github.com/users/giuliomoro/following{/other_user}","gists_url":"https://api.github.com/users/giuliomoro/gists{/gist_id}","starred_url":"https://api.github.com/users/giuliomoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuliomoro/subscriptions","organizations_url":"https://api.github.com/users/giuliomoro/orgs","repos_url":"https://api.github.com/users/giuliomoro/repos","events_url":"https://api.github.com/users/giuliomoro/events{/privacy}","received_events_url":"https://api.github.com/users/giuliomoro/received_events","type":"User","site_admin":false},"assignees":[{"login":"giuliomoro","id":4260604,"avatar_url":"https://avatars0.githubusercontent.com/u/4260604?v=4","gravatar_id":"","url":"https://api.github.com/users/giuliomoro","html_url":"https://github.com/giuliomoro","followers_url":"https://api.github.com/users/giuliomoro/followers","following_url":"https://api.github.com/users/giuliomoro/following{/other_user}","gists_url":"https://api.github.com/users/giuliomoro/gists{/gist_id}","starred_url":"https://api.github.com/users/giuliomoro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuliomoro/subscriptions","organizations_url":"https://api.github.com/users/giuliomoro/orgs","repos_url":"https://api.github.com/users/giuliomoro/repos","events_url":"https://api.github.com/users/giuliomoro/events{/privacy}","received_events_url":"https://api.github.com/users/giuliomoro/received_events","type":"User","site_admin":false}],"milestone":null,"comments":11,"created_at":"2016-09-05T13:10:50Z","updated_at":"2018-04-05T23:47:38Z","closed_at":"2018-04-05T23:47:38Z","author_association":"CONTRIBUTOR","body":"re: CPU usage of doFFT() :\n\n```\n        // prepare the FFT input & do windowing\n        for (int i=0; i<FFTLength; i++){\n            inFFT[i].r = (ne10_float32_t)(buffer[(ptr+i)%channelWidth+c*channelWidth] * windowFFT[i]);\n            inFFT[i].i = 0;\n        }\n```\n\nthis is copying samples across, what if we were to accumulate the samples in a buffer of type `ne10_float32_t*` already?\n\ninFFT[i].i is always going to be zero, if I am not wrong, so this could be just initialized once ?\n\nSolving all the issues above would probably be possible (and probably faster) by using a real-to-complex fft instead (as the input signal is always going to be real).\n\n```\n                    float mag = (float)(outFFT[j].r * outFFT[j].r + outFFT[j].i * outFFT[j].i);\n```\n\nIf magnitudes were computed with an optimized function, then it would probably help computing them all at once.\nThere does not seem to be an appropriate \"complex magnitude\" function in NE10, but some of the vector multiplication ones should help.\n\n```\n            for (int i=0; i<frameWidth; i++){\n...\n                } else if (FFTXAxis == 1){  // logarithmic\n                    findex = expf((float)i*logConst)*ratio;\n                }\n...\n            }\n```\n\nthis is constant for a given ratio and should be cached\n\nUse of math-neon approximations for log and expf throughout is probably alright.\n"}}
{"actor":{"display_login":"giuliomoro"}}