Re: Wanting to take a FFT transform of a irregularly spaced sample

"ashwin .D" <[email protected]> Tue, 12 Apr 2022 13:01:41 +0530
Newsgroups gmane.comp.python.scientific.user
Message-ID <CAH0LXy5Jy_5YzBxJg=jt47oGQa8HUVKpO6GMOg7U=6Q1M+=jmA@mail.gmail.com>
--===============1862999784853504962==
Content-Type: multipart/alternative; boundary="000000000000fd10ae05dc700db8"

--000000000000fd10ae05dc700db8
Content-Type: text/plain; charset="UTF-8"

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 ?



On Tue, Apr 12, 2022 at 9:48 AM Robert Kern <[email protected]> wrote:

> On Mon, Apr 11, 2022 at 11:38 PM ashwin .D <[email protected]> wrote:
>
>> Hello,
>>             I have looked at both these answers from SO -
>> https://stackoverflow.com/questions/34428886/discrete-fourier-transformation-from-a-list-of-x-y-points/34432195#34432195
>> and
>> https://stackoverflow.com/questions/25735153/plotting-a-fast-fourier-transform-in-python/25735436#25735436
>>
>> My question is somewhat similar. I have data from a CSV file that has
>> measurements of a mean sea level pressure. The data is available every 5
>> minutes. That means 8928 sample points over a month. But during a
>> hurricane event there was a power failure and only 8867 data points are
>> available. I am short by 61 points to get a uniformly spaced sample.  I am
>> wanting to take an FFT of the data in order to check for periodicity, waves
>> and frequencies there of. What are my best options ?
>>
>
> The first SO answer is reliable (the second is mostly useless for the kind
> of gap you are talking about); the Lomb-Scargle periodogram is a very
> reasonable way to do the task. To answer those questions, you will likely
> want a periodogram, not the more fundamental Fourier transform. But if you
> do want a full complex-valued Fourier transform for whatever reason, `nfft`
> should do the job:
>
>   https://github.com/jakevdp/nfft/
>
> --
> 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]
>

--000000000000fd10ae05dc700db8
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<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 bot=
h. Regarding this answer that you recommended -=C2=A0<a href=3D"https://sta=
ckoverflow.com/questions/34428886/discrete-fourier-transformation-from-a-li=
st-of-x-y-points/34432195#34432195">https://stackoverflow.com/questions/344=
28886/discrete-fourier-transformation-from-a-list-of-x-y-points/34432195#34=
432195</a></div><div><br></div><div>what would be my angular frequencies fr=
om this API -=C2=A0<a href=3D"https://docs.scipy.org/doc/scipy/reference/ge=
nerated/scipy.signal.lombscargle.html">https://docs.scipy.org/doc/scipy/ref=
erence/generated/scipy.signal.lombscargle.html</a> ?=C2=A0</div><div><br></=
div><div>The x and y arguments are straightforward and are available to me =
from the CSV file. What about the third one ?=C2=A0</div><div><br></div><di=
v><br></div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"=
gmail_attr">On Tue, Apr 12, 2022 at 9:48 AM Robert Kern &lt;<a href=3D"mail=
to:[email protected]">[email protected]</a>&gt; wrote:<br></div><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-lef=
t:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div dir=3D=
"ltr">On Mon, Apr 11, 2022 at 11:38 PM ashwin .D &lt;<a href=3D"mailto:wina=
[email protected]" target=3D"_blank">[email protected]</a>&gt; wrote:<br></di=
v><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1=
ex"><div dir=3D"ltr">Hello,<div>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 I=
 have looked at both these answers from SO -=C2=A0<a href=3D"https://stacko=
verflow.com/questions/34428886/discrete-fourier-transformation-from-a-list-=
of-x-y-points/34432195#34432195" target=3D"_blank">https://stackoverflow.co=
m/questions/34428886/discrete-fourier-transformation-from-a-list-of-x-y-poi=
nts/34432195#34432195</a> and=C2=A0<a href=3D"https://stackoverflow.com/que=
stions/25735153/plotting-a-fast-fourier-transform-in-python/25735436#257354=
36" target=3D"_blank">https://stackoverflow.com/questions/25735153/plotting=
-a-fast-fourier-transform-in-python/25735436#25735436</a></div><div><br></d=
iv><div>My question is somewhat similar. I have data from a CSV file that h=
as measurements of a mean sea level pressure. The data is available every 5=
 minutes. That means 8928 sample points over a month. But during a hurrican=
e=C2=A0event there was a power failure and only 8867 data points are availa=
ble. I am short by 61 points to get a uniformly spaced sample.=C2=A0 I am w=
anting to take an FFT of the data in order to check for periodicity, waves =
and frequencies there of. What are my best options ?=C2=A0</div></div></blo=
ckquote><div>=C2=A0<br></div></div><div>The first SO answer is reliable (th=
e second is mostly useless for the kind of gap you=C2=A0are talking=C2=A0ab=
out); the Lomb-Scargle periodogram is a very reasonable way to do the task.=
 To answer those questions, you will likely want a periodogram, not the mor=
e fundamental Fourier transform. But if you do want a full complex-valued F=
ourier transform for whatever reason, `nfft` should do the job:</div><div><=
br></div><div>=C2=A0 <a href=3D"https://github.com/jakevdp/nfft/" target=3D=
"_blank">https://github.com/jakevdp/nfft/</a><br></div><div><br></div>-- <b=
r><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>

--000000000000fd10ae05dc700db8--

--===============1862999784853504962==
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]

--===============1862999784853504962==--