Re: Wanting to take a FFT transform of a irregularly spaced sample
"ashwin .D" <[email protected]> Mon, 16 May 2022 18:41:26 +0530
| Newsgroups | gmane.comp.python.scientific.user |
|---|---|
| Message-ID | <CAH0LXy4i4iwxj-yBoLpO0xAyTNmgrL6xJy1LGFswPwUDGSZfmg@mail.gmail.com> |
--===============5819460969098495332== Content-Type: multipart/alternative; boundary="000000000000a1ef8405df20c337" --000000000000a1ef8405df20c337 Content-Type: text/plain; charset="UTF-8" However I do not think the functionality is available right now. What I want is to segment wise frequency estimate with Lomb Scargle. That would be a PR am I right ? On Mon, May 16, 2022 at 5:24 PM ashwin .D <[email protected]> wrote: > Robert, > When you write "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." are you referring to the > https://en.wikipedia.org/wiki/Welch%27s_method and implemented by > https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.welch.html > ? This provides for an efficient noise reduction . > > On Tue, Apr 12, 2022 at 6:48 PM Robert Kern <[email protected]> wrote: > >> 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 >> _______________________________________________ >> 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] >> > --000000000000a1ef8405df20c337 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">However I do not think the functionality is available righ= t now. What I want is to segment wise frequency estimate=C2=A0 with Lomb Sc= argle. That would be a PR am I right ?=C2=A0</div><br><div class=3D"gmail_q= uote"><div dir=3D"ltr" class=3D"gmail_attr">On Mon, May 16, 2022 at 5:24 PM= ashwin .D <<a href=3D"mailto:[email protected]">[email protected]</a>= > wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0px = 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div= dir=3D"ltr">Robert,<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = =C2=A0 When you write "you may want to reduce the number of points you= sample at first for visualization, then you can zoom in at the full freque= ncy resolution to an area of interest if there is lots of dead space."= are you referring to the=C2=A0<a href=3D"https://en.wikipedia.org/wiki/Wel= ch%27s_method" target=3D"_blank">https://en.wikipedia.org/wiki/Welch%27s_me= thod</a> and implemented by=C2=A0<a href=3D"https://docs.scipy.org/doc/scip= y/reference/generated/scipy.signal.welch.html" target=3D"_blank">https://do= cs.scipy.org/doc/scipy/reference/generated/scipy.signal.welch.html</a>=C2= =A0 ? This provides for=C2=A0 an efficient noise reduction .=C2=A0</div></d= iv><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On = Tue, Apr 12, 2022 at 6:48 PM Robert Kern <<a href=3D"mailto:robert.kern@= gmail.com" target=3D"_blank">[email protected]</a>> wrote:<br></div>= <blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-= left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir= =3D"ltr">On Tue, Apr 12, 2022 at 3:32 AM ashwin .D <<a href=3D"mailto:wi= [email protected]" target=3D"_blank">[email protected]</a>> wrote:<br></= div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"m= argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-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 going to = try both. Regarding this answer that you recommended -=C2=A0<a href=3D"http= s://stackoverflow.com/questions/34428886/discrete-fourier-transformation-fr= om-a-list-of-x-y-points/34432195#34432195" target=3D"_blank">https://stacko= verflow.com/questions/34428886/discrete-fourier-transformation-from-a-list-= of-x-y-points/34432195#34432195</a></div><div><br></div><div>what would be = my angular frequencies from this API -=C2=A0<a href=3D"https://docs.scipy.o= rg/doc/scipy/reference/generated/scipy.signal.lombscargle.html" target=3D"_= blank">https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.lo= mbscargle.html</a> ?=C2=A0</div><div><br></div><div>The x and y arguments a= re straightforward and are available to me from the CSV file. What about th= e third one ?=C2=A0</div></div></blockquote><div><br></div><div>That's = the angular frequencies at which you want to evaluate the periodogram at. I= n your case (otherwise-regular time series but with missing values), I woul= d recommend using the angular frequencies that you would have had if you ha= d computed a normal periodogram using the FFT on the whole time series,=C2= =A0e.g. `np.linspace(0, np.pi/300.0, 8928//2)` (assuming your `x` is in sec= onds). 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 t= o an area of interest if there is lots of dead space.</div></div><div><br><= /div>-- <br><div dir=3D"ltr">Robert Kern</div></div> _______________________________________________<br> SciPy-User mailing list -- <a href=3D"mailto:[email protected]" target= =3D"_blank">[email protected]</a><br> To unsubscribe send an email to <a href=3D"mailto:[email protected]= rg" target=3D"_blank">[email protected]</a><br> <a href=3D"https://mail.python.org/mailman3/lists/scipy-user.python.org/" r= el=3D"noreferrer" target=3D"_blank">https://mail.python.org/mailman3/lists/= scipy-user.python.org/</a><br> Member address: <a href=3D"mailto:[email protected]" target=3D"_blank">win= [email protected]</a><br> </blockquote></div> </blockquote></div> --000000000000a1ef8405df20c337-- --===============5819460969098495332== 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] --===============5819460969098495332==--