Re: Wanting to take a FFT transform of a irregularly spaced sample
Robert Kern <[email protected]> Tue, 12 Apr 2022 09:15:48 -0400
| Newsgroups | gmane.comp.python.scientific.user |
|---|---|
| Message-ID | <CAF6FJisKW=A_QMMOQJXSRWCdcr4P0q16MOfjvBx=RUbJ4TU6zw@mail.gmail.com> |
--===============5058576459847434274== Content-Type: multipart/alternative; boundary="0000000000007f472005dc74dd5f" --0000000000007f472005dc74dd5f Content-Type: text/plain; charset="UTF-8" On Tue, Apr 12, 2022 at 3:32 AM ashwin .D <[email protected]> wrote: > Hi Robert, > Thanks for your prompt response. I am going to try both. > Regarding this answer that you recommended - > https://stackoverflow.com/questions/34428886/discrete-fourier-transformation-from-a-list-of-x-y-points/34432195#34432195 > > what would be my angular frequencies from this API - > https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lombscargle.html > ? > > The x and y arguments are straightforward and are available to me from the > CSV file. What about the third one ? > That's the angular frequencies at which you want to evaluate the periodogram at. In your case (otherwise-regular time series but with missing values), I would recommend using the angular frequencies that you would have had if you had computed a normal periodogram using the FFT on the whole time series, e.g. `np.linspace(0, np.pi/300.0, 8928//2)` (assuming your `x` is in seconds). The running time is O(len(x)*len(freqs)), though, so that may take a long time. You may want to reduce the number of points you sample at first for visualization, then you can zoom in at the full frequency resolution to an area of interest if there is lots of dead space. -- Robert Kern --0000000000007f472005dc74dd5f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"ltr">On Tue, Apr 12, 2022 at 3:32 AM ashwin .D= <<a href=3D"mailto:[email protected]">[email protected]</a>> wrote= :<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" sty= le=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);paddi= ng-left:1ex"><div dir=3D"ltr">Hi Robert,<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Thanks for your prompt response. I am go= ing to try both. Regarding this answer that you recommended -=C2=A0<a href= =3D"https://stackoverflow.com/questions/34428886/discrete-fourier-transform= ation-from-a-list-of-x-y-points/34432195#34432195" target=3D"_blank">https:= //stackoverflow.com/questions/34428886/discrete-fourier-transformation-from= -a-list-of-x-y-points/34432195#34432195</a></div><div><br></div><div>what w= ould be my angular frequencies from this API -=C2=A0<a href=3D"https://docs= .scipy.org/doc/scipy/reference/generated/scipy.signal.lombscargle.html" tar= get=3D"_blank">https://docs.scipy.org/doc/scipy/reference/generated/scipy.s= ignal.lombscargle.html</a> ?=C2=A0</div><div><br></div><div>The x and y arg= uments are straightforward and are available to me from the CSV file. What = about the third one ?=C2=A0</div></div></blockquote><div><br></div><div>Tha= t's the angular frequencies at which you want to evaluate the periodogr= am at. In your case (otherwise-regular time series but with missing values)= , I would recommend using the angular frequencies that you would have had i= f you had computed a normal periodogram using the FFT on the whole time ser= ies,=C2=A0e.g. `np.linspace(0, np.pi/300.0, 8928//2)` (assuming your `x` is= in seconds). The running time is O(len(x)*len(freqs)), though, so that may= take a long time. You may want to reduce the number of points you sample a= t first for visualization, then you can zoom in at the full frequency resol= ution to an area of interest if there is lots of dead space.</div></div><di= v><br></div>-- <br><div dir=3D"ltr" class=3D"gmail_signature">Robert Kern</= div></div> --0000000000007f472005dc74dd5f-- --===============5058576459847434274== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ SciPy-User mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/scipy-user.python.org/ Member address: [email protected] --===============5058576459847434274==--