{"action":"created","issue":{"url":"https://api.github.com/repos/awesomebytes/parametric_modeling/issues/1","labels_url":"https://api.github.com/repos/awesomebytes/parametric_modeling/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/awesomebytes/parametric_modeling/issues/1/comments","events_url":"https://api.github.com/repos/awesomebytes/parametric_modeling/issues/1/events","html_url":"https://github.com/awesomebytes/parametric_modeling/issues/1","id":97443241,"number":1,"title":"Noise simulation with Yuler & Burg ?","user":{"login":"minotaur-0","id":13518553,"avatar_url":"https://avatars.githubusercontent.com/u/13518553?v=3","gravatar_id":"","url":"https://api.github.com/users/minotaur-0","html_url":"https://github.com/minotaur-0","followers_url":"https://api.github.com/users/minotaur-0/followers","following_url":"https://api.github.com/users/minotaur-0/following{/other_user}","gists_url":"https://api.github.com/users/minotaur-0/gists{/gist_id}","starred_url":"https://api.github.com/users/minotaur-0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/minotaur-0/subscriptions","organizations_url":"https://api.github.com/users/minotaur-0/orgs","repos_url":"https://api.github.com/users/minotaur-0/repos","events_url":"https://api.github.com/users/minotaur-0/events{/privacy}","received_events_url":"https://api.github.com/users/minotaur-0/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-07-27T11:34:24Z","updated_at":"2015-07-27T11:36:45Z","closed_at":null,"body":"Hi \r\nI want to simulate a sensor's noise after eliminating high frequency noise using wavelt.\r\nI used for this purpose Yuler and Burg. But the problem is that the series diverge. Now, I don't know if the problem is function, in my code, or it's normal when the series diverge.  \r\nMy code :\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport pywt\r\nfrom scipy import signal\r\nfrom spectrum import *\r\nfrom pylab import *\r\n\r\ndef simulat_noise_yuler (self,x,ordre):#x = data series\r\n    var=np.var(x)\r\n    noise = np.random.normal(0, var**0.5, len(x))\r\n    ar, variance, coeff_reflection = aryule(x, ordre)\r\n\r\n    last_elements=np.array(ar)\r\n    i=0\r\n    while i<len(ar)/2:\r\n        tmp=ar[i]\r\n        ar[i]=ar[len(ar)-1-i]\r\n        ar[len(ar)-1-i]=tmp\r\n        i+=1\r\n    tmp_coef=[]\r\n    i=0\r\n    while i<len(coeff_reflection):\r\n        tmp_coef.append([coeff_reflection[i]])\r\n        i+=1\r\n    coef=np.array(tmp_coef)\r\n\r\n    result=[]\r\n    i=0\r\n    new_element=0\r\n    while i<len(x): \r\n        new_element= last_elements.dot(coef)+ noise[i]\r\n        result.append(float(new_element))\r\n        j=1\r\n        while j<len(last_elements):\r\n            last_elements[j]=last_elements[j-1]\r\n            j+=1\r\n        last_elements[0]=new_element\r\n        i+=1\r\n    return result\r\n```\r\n```python\r\nimport numpy as np\r\nimport matplotlib.pyplot as plt\r\nimport pywt\r\nfrom scipy import signal\r\nfrom spectrum import *\r\nfrom pylab import *\r\n\r\n    def simulation_bruit_burg(self,x,ordre):\r\n        var=numpy.var(x)\r\n        noise = np.random.normal(0, var**0.5, len(x))\r\n        ar, variance, coeff_reflection = arburg(x, ordre)\r\n        i=0\r\n        tmp_ar=[]\r\n        tmp_coef=[]\r\n        while i<len(ar):\r\n            tmp_ar.append(ar[len(ar)-1-i].real)\r\n            tmp_coef.append(coeff_reflection[i].real)\r\n            i+=1\r\n\r\n        last_elements=np.array(tmp_ar)\r\n        coeff_reflection=np.array(tmp_coef)\r\n\r\n        result=[]\r\n        i=0\r\n        new_element=0\r\n        while i<len(x): \r\n            new_element= last_elements.dot(coeff_reflection)+ noise[i]\r\n            result.append(float(new_element))\r\n            j=1\r\n            while j<len(last_elements):\r\n                last_elements[j-1]=last_elements[j]\r\n                j+=1\r\n            last_elements[len(last_elements)-1]=new_element\r\n            i+=1\r\n        return result\r\n```"},"comment":{"url":"https://api.github.com/repos/awesomebytes/parametric_modeling/issues/comments/125174303","html_url":"https://github.com/awesomebytes/parametric_modeling/issues/1#issuecomment-125174303","issue_url":"https://api.github.com/repos/awesomebytes/parametric_modeling/issues/1","id":125174303,"user":{"login":"awesomebytes","id":1721716,"avatar_url":"https://avatars.githubusercontent.com/u/1721716?v=3","gravatar_id":"","url":"https://api.github.com/users/awesomebytes","html_url":"https://github.com/awesomebytes","followers_url":"https://api.github.com/users/awesomebytes/followers","following_url":"https://api.github.com/users/awesomebytes/following{/other_user}","gists_url":"https://api.github.com/users/awesomebytes/gists{/gist_id}","starred_url":"https://api.github.com/users/awesomebytes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awesomebytes/subscriptions","organizations_url":"https://api.github.com/users/awesomebytes/orgs","repos_url":"https://api.github.com/users/awesomebytes/repos","events_url":"https://api.github.com/users/awesomebytes/events{/privacy}","received_events_url":"https://api.github.com/users/awesomebytes/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T11:36:45Z","updated_at":"2015-07-27T11:36:45Z","body":"I'm sorry but my math skills are rather poor, I cannot really add more\nknowledge than you already have most probably.\n On Jul 27, 2015 1:34 PM, \"minotaur-0\" <notifications@github.com> wrote:\n\n> Hi\n> I want to simulate a sensor's noise after eliminating high frequency noise\n> using wavelt.\n> I used for this purpose Yuler and Burg. But the problem is that the series\n> diverge. Now, I don't know if the problem is function, in my code, or it's\n> normal when the series diverge.\n>\n> My code :\n>\n> import numpy as npimport matplotlib.pyplot as pltimport pywtfrom scipy import signalfrom spectrum import *from pylab import *\n> def simulat_noise_yuler (self,x,ordre):#x = data series\n>     var=np.var(x)\n>     noise = np.random.normal(0, var**0.5, len(x))\n>     ar, variance, coeff_reflection = aryule(x, ordre)\n>\n>     last_elements=np.array(ar)\n>     i=0\n>     while i<len(ar)/2:\n>         tmp=ar[i]\n>         ar[i]=ar[len(ar)-1-i]\n>         ar[len(ar)-1-i]=tmp\n>         i+=1\n>     tmp_coef=[]\n>     i=0\n>     while i<len(coeff_reflection):\n>         tmp_coef.append([coeff_reflection[i]])\n>         i+=1\n>     coef=np.array(tmp_coef)\n>\n>     result=[]\n>     i=0\n>     new_element=0\n>     while i<len(x):\n>         new_element= last_elements.dot(coef)+ noise[i]\n>         result.append(float(new_element))\n>         j=1\n>         while j<len(last_elements):\n>             last_elements[j]=last_elements[j-1]\n>             j+=1\n>         last_elements[0]=new_element\n>         i+=1\n>     return result\n>\n> import numpy as npimport matplotlib.pyplot as pltimport pywtfrom scipy import signalfrom spectrum import *from pylab import *\n>\n>     def simulation_bruit_burg(self,x,ordre):\n>         var=numpy.var(x)\n>         noise = np.random.normal(0, var**0.5, len(x))\n>         ar, variance, coeff_reflection = arburg(x, ordre)\n>         i=0\n>         tmp_ar=[]\n>         tmp_coef=[]\n>         while i<len(ar):\n>             tmp_ar.append(ar[len(ar)-1-i].real)\n>             tmp_coef.append(coeff_reflection[i].real)\n>             i+=1\n>\n>         last_elements=np.array(tmp_ar)\n>         coeff_reflection=np.array(tmp_coef)\n>\n>         result=[]\n>         i=0\n>         new_element=0\n>         while i<len(x):\n>             new_element= last_elements.dot(coeff_reflection)+ noise[i]\n>             result.append(float(new_element))\n>             j=1\n>             while j<len(last_elements):\n>                 last_elements[j-1]=last_elements[j]\n>                 j+=1\n>             last_elements[len(last_elements)-1]=new_element\n>             i+=1\n>         return result\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/awesomebytes/parametric_modeling/issues/1>.\n>\n"}}