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

Robert Kern <[email protected]> Tue, 12 Apr 2022 00:15:30 -0400
Newsgroups gmane.comp.python.scientific.user
Message-ID <CAF6FJiv9MkAk_f0EVZVcg6eQsqmPUUaDPbXr_vzfJpKkfxn-Tg@mail.gmail.com>
--===============1790239314698585723==
Content-Type: multipart/alternative; boundary="0000000000004379ae05dc6d51b7"

--0000000000004379ae05dc6d51b7
Content-Type: text/plain; charset="UTF-8"

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

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

<div dir=3D"ltr"><div dir=3D"ltr">On Mon, Apr 11, 2022 at 11:38 PM ashwin .=
D &lt;<a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrot=
e:<br></div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padd=
ing-left:1ex"><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"ht=
tps://stackoverflow.com/questions/34428886/discrete-fourier-transformation-=
from-a-list-of-x-y-points/34432195#34432195" target=3D"_blank">https://stac=
koverflow.com/questions/34428886/discrete-fourier-transformation-from-a-lis=
t-of-x-y-points/34432195#34432195</a> and=C2=A0<a href=3D"https://stackover=
flow.com/questions/25735153/plotting-a-fast-fourier-transform-in-python/257=
35436#25735436" target=3D"_blank">https://stackoverflow.com/questions/25735=
153/plotting-a-fast-fourier-transform-in-python/25735436#25735436</a></div>=
<div><br></div><div>My question is somewhat similar. I have data from a CSV=
 file that has measurements of a mean sea level pressure. The data is avail=
able every 5 minutes. That means 8928 sample points over a month. But durin=
g a hurricane=C2=A0event there was a power failure and only 8867 data point=
s are available. I am short by 61 points to get a uniformly spaced sample.=
=C2=A0 I am wanting to take an FFT of the data in order to check for period=
icity, waves and frequencies there of. What are my best options ?=C2=A0</di=
v></div></blockquote><div>=C2=A0<br></div></div><div>The first SO answer is=
 reliable (the second is mostly useless for the kind of gap you=C2=A0are ta=
lking=C2=A0about); 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 com=
plex-valued Fourier transform for whatever reason, `nfft` should do the job=
:</div><div><br></div><div>=C2=A0 <a href=3D"https://github.com/jakevdp/nff=
t/">https://github.com/jakevdp/nfft/</a><br></div><div><br></div>-- <br><di=
v dir=3D"ltr" class=3D"gmail_signature">Robert Kern</div></div>

--0000000000004379ae05dc6d51b7--

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

--===============1790239314698585723==--