{"action":"created","issue":{"url":"https://api.github.com/repos/AD-Vega/rtl-power-fftw/issues/4","labels_url":"https://api.github.com/repos/AD-Vega/rtl-power-fftw/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/AD-Vega/rtl-power-fftw/issues/4/comments","events_url":"https://api.github.com/repos/AD-Vega/rtl-power-fftw/issues/4/events","html_url":"https://github.com/AD-Vega/rtl-power-fftw/issues/4","id":119833277,"number":4,"title":"Measurement when doing frequency hops","user":{"login":"xmikos","id":3603985,"avatar_url":"https://avatars.githubusercontent.com/u/3603985?v=3","gravatar_id":"","url":"https://api.github.com/users/xmikos","html_url":"https://github.com/xmikos","followers_url":"https://api.github.com/users/xmikos/followers","following_url":"https://api.github.com/users/xmikos/following{/other_user}","gists_url":"https://api.github.com/users/xmikos/gists{/gist_id}","starred_url":"https://api.github.com/users/xmikos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xmikos/subscriptions","organizations_url":"https://api.github.com/users/xmikos/orgs","repos_url":"https://api.github.com/users/xmikos/repos","events_url":"https://api.github.com/users/xmikos/events{/privacy}","received_events_url":"https://api.github.com/users/xmikos/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-12-01T23:33:20Z","updated_at":"2015-12-02T09:20:40Z","closed_at":null,"body":"For long sweeps with multiple frequency hops, `rtl_power_fftw` is now waiting (collecting samples) on each hop for time `--time` before going to next hop. Would it be possible to add mode in which it would sweep over whole range (over and over again) and do averaging only after collecting needed amount of samples from whole range?\r\n\r\nSimply instead of doing (pseudocode):\r\n\r\n    for hop in hops:\r\n        for repeat in repeats:\r\n            collect_samples()\r\n        average_collected_samples()\r\n\r\nDo this (pseudocode):\r\n\r\n    for repeat in repeats:\r\n        for hop in hops:\r\n            collect_samples()\r\n    average_collected_samples()\r\n\r\nI know this mode would be slower (because of much more hops), but it would be better for spectrum analyzer usecase.\r\n\r\nEDIT: Well, for some spectrum analyzer usecases, not all ;-)"},"comment":{"url":"https://api.github.com/repos/AD-Vega/rtl-power-fftw/issues/comments/161231961","html_url":"https://github.com/AD-Vega/rtl-power-fftw/issues/4#issuecomment-161231961","issue_url":"https://api.github.com/repos/AD-Vega/rtl-power-fftw/issues/4","id":161231961,"user":{"login":"KlemenBlokar","id":11587813,"avatar_url":"https://avatars.githubusercontent.com/u/11587813?v=3","gravatar_id":"","url":"https://api.github.com/users/KlemenBlokar","html_url":"https://github.com/KlemenBlokar","followers_url":"https://api.github.com/users/KlemenBlokar/followers","following_url":"https://api.github.com/users/KlemenBlokar/following{/other_user}","gists_url":"https://api.github.com/users/KlemenBlokar/gists{/gist_id}","starred_url":"https://api.github.com/users/KlemenBlokar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KlemenBlokar/subscriptions","organizations_url":"https://api.github.com/users/KlemenBlokar/orgs","repos_url":"https://api.github.com/users/KlemenBlokar/repos","events_url":"https://api.github.com/users/KlemenBlokar/events{/privacy}","received_events_url":"https://api.github.com/users/KlemenBlokar/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T09:20:40Z","updated_at":"2015-12-02T09:20:40Z","body":"Frequency hopping is quite inefficient, and the same goes for measuring only one repeat at once. The latter is apparently due to the specifics of the USB protocol. This is why it would be better than measuring a single repeat to measure as many as needed to cover 16384 samples (one full transfer buffer) - or a small multiple of this, of course.\r\nI think that considering the time you have to spare while waiting for another sweep to finish, you can easily average data within your app.\r\nIf you would require raw output for this (not logarithmic ), it would be easy to implement.\r\n\r\nRedoing the loop in the more inefficient way would however require quite a rewrite of the logic, as I only need one buffer for averaging the power spectrum now - to implement the other idea I would need as many buffers as there are frequency hops and I would also need to remember all the tuned frequencies, etc... And on the downside, you would have to wait even longer to get data from each sweep, as now you get each hop immediately after its done, but then you would need to wait for the whole set to finish. So doing shorter sweeps and averaging them later yourself seems a much better option to me. But if you find there are problems with this way of doing things, we can think again. :-)"}}