{"action":"created","issue":{"url":"https://api.github.com/repos/TJC/arduino/issues/1","repository_url":"https://api.github.com/repos/TJC/arduino","labels_url":"https://api.github.com/repos/TJC/arduino/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/TJC/arduino/issues/1/comments","events_url":"https://api.github.com/repos/TJC/arduino/issues/1/events","html_url":"https://github.com/TJC/arduino/issues/1","id":137221613,"number":1,"title":"Fix_fft","user":{"login":"funfrancis","id":8066513,"avatar_url":"https://avatars.githubusercontent.com/u/8066513?v=3","gravatar_id":"","url":"https://api.github.com/users/funfrancis","html_url":"https://github.com/funfrancis","followers_url":"https://api.github.com/users/funfrancis/followers","following_url":"https://api.github.com/users/funfrancis/following{/other_user}","gists_url":"https://api.github.com/users/funfrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/funfrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funfrancis/subscriptions","organizations_url":"https://api.github.com/users/funfrancis/orgs","repos_url":"https://api.github.com/users/funfrancis/repos","events_url":"https://api.github.com/users/funfrancis/events{/privacy}","received_events_url":"https://api.github.com/users/funfrancis/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-29T11:06:23Z","updated_at":"2016-02-29T12:34:38Z","closed_at":null,"body":"Hi\r\n\r\nI copied the fix_fft.h and fix_fft.cpp file onto the library folder in arduino\r\n\r\nI uploaded the example sketch\r\n`#include <fix_fft.h>\r\n\r\n\r\nchar im[128];\r\nchar data[128];\r\n\r\nvoid setup(){\r\n Serial.begin(9600);\r\n}\r\n\r\nvoid loop(){\r\n  int static i = 0;\r\n  static long tt;\r\n  int val;\r\n  \r\n   if (millis() > tt){\r\n    if (i < 128){\r\n      val = analogRead(0);\r\n      data[i] = val / 4 - 128;\r\n      im[i] = 0;\r\n      i++;  \r\n      \r\n    }\r\n    else{\r\n      //this could be done with the fix_fftr function without the im array.\r\n      fix_fft(data,im,7,0);\r\n      // I am only interessted in the absolute value of the transformation\r\n      for (i=0; i< 64;i++){\r\n         data[i] = sqrt(data[i] * data[i] + im[i] * im[i]);\r\n      }\r\n      \r\n      //do something with the data values 1..64 and ignore im\r\n      show_big_bars(data,0);\r\n    }\r\n    \r\n    tt = millis();\r\n   }\r\n} \r\n\r\n/*\r\n\r\nthis should give an fft with \r\n- sampling rate:           1ms\r\n- frequency range: - 7.8 to 500 Hz in 64 7.8hz bands\r\n\r\nthere is a lot that can be improved:\r\n- fix bugs\r\n- replace FIX_MPY by inline assembler\r\n- do sampling with timer and interrupts\r\n- use fix_fftr instead of fix_fft to save ram (i did not get the math right)\r\n\r\n*/`\r\n\r\nBut get error\r\n`'show_big_bars' was not declared in this scope`\r\n\r\nHow do I debug it??\r\n\r\nPls help!!!"},"comment":{"url":"https://api.github.com/repos/TJC/arduino/issues/comments/190193282","html_url":"https://github.com/TJC/arduino/issues/1#issuecomment-190193282","issue_url":"https://api.github.com/repos/TJC/arduino/issues/1","id":190193282,"user":{"login":"funfrancis","id":8066513,"avatar_url":"https://avatars.githubusercontent.com/u/8066513?v=3","gravatar_id":"","url":"https://api.github.com/users/funfrancis","html_url":"https://github.com/funfrancis","followers_url":"https://api.github.com/users/funfrancis/followers","following_url":"https://api.github.com/users/funfrancis/following{/other_user}","gists_url":"https://api.github.com/users/funfrancis/gists{/gist_id}","starred_url":"https://api.github.com/users/funfrancis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/funfrancis/subscriptions","organizations_url":"https://api.github.com/users/funfrancis/orgs","repos_url":"https://api.github.com/users/funfrancis/repos","events_url":"https://api.github.com/users/funfrancis/events{/privacy}","received_events_url":"https://api.github.com/users/funfrancis/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T12:34:38Z","updated_at":"2016-02-29T12:34:38Z","body":"Is it possible for you tpo draft a simple FFT code for arduino that does not make use of any libraries but works the way it is to work \r\n\r\nI need it for integrating the LoRa telemetry with Arduino to send the FFT data to the base station and the issue is that the LoRa system is incompatible with most of Arduino's Libraries\r\n\r\nPls help me!!!"}}