Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3607854
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:25:42+00:00 2026-05-18T21:25:42+00:00

I have some periodic data, but the amount of data is not a multiple

  • 0

I have some periodic data, but the amount of data is not a multiple of
the period. How can I Fourier analyze this data? Example:

% Let’s create some data for testing:

data = Table[N[753+919*Sin[x/623-125]], {x,1,25000}] 

% I now receive this data, but have no idea that it came from the
formula above. I’m trying to reconstruct the formula just from ‘data’.

% Looking at the first few non-constant terms of the Fourier series:

ListPlot[Table[Abs[Fourier[data]][[x]], {x,2,20}], PlotJoined->True, 
 PlotRange->All] 

Mathematica graphics

shows an expected spike at 6 (since the number of periods is really
25000/(623*2*Pi) or about 6.38663, though we don’t know this).

% Now, how do I get back 6.38663? One way is to “convolve” the data with
arbitrary multiples of Cos[x].

convolve[n_] := Sum[data[[x]]*Cos[n*x], {x,1,25000}] 

% And graph the “convolution” near n=6:

Plot[convolve[n],{n,5,7}, PlotRange->All] 

Mathematica graphics

we see a spike roughly where expected.

% We try FindMaximum:

FindMaximum[convolve[n],{n,5,7}] 

but the result is useless and inaccurate:

FindMaximum::fmmp:  
   Machine precision is insufficient to achieve the requested accuracy or 
    precision. 

Out[119]= {98.9285, {n -> 5.17881}} 

because the function is very wiggly.

% By refining our interval (using visual analysis on the plots), we
finally find an interval where convolve[] doesn’t wiggle too much:

Plot[convolve[n],{n,6.2831,6.2833}, PlotRange->All] 

Mathematica graphics

and FindMaximum works:

FindMaximum[convolve[n],{n,6.2831,6.2833}] // FortranForm 
List(1.984759605826571e7,List(Rule(n,6.2831853071787975))) 

% However, this process is ugly, requires human intervention, and
computing convolve[] is REALLY slow. Is there a better way to do this?

% Looking at the Fourier series of the data, can I somehow divine the
“true” number of periods is 6.38663? Of course, the actual result
would be 6.283185, since my data fits that better (because I’m only
sampling at a finite number of points).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:25:43+00:00Added an answer on May 18, 2026 at 9:25 pm

    Based on Mathematica help for the Fourier function / Applications / Frequency Identification:
    Checked on version 7

    n = 25000;
    data = Table[N[753 + 919*Sin[x/623 - 125]], {x, 1, n}];
    pdata = data - Total[data]/Length[data];
    f = Abs[Fourier[pdata]];
    pos = Ordering[-f, 1][[1]]; (*the position of the first Maximal value*)  
    fr = Abs[Fourier[pdata Exp[2 Pi I (pos - 2) N[Range[0, n - 1]]/n], 
       FourierParameters -> {0, 2/n}]];
    frpos = Ordering[-fr, 1][[1]];
    
    N[(pos - 2 + 2 (frpos - 1)/n)]
    

    returns 6.37072

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some UI in VB 2005 that looks great in XP Style, but
We have some input data that sometimes appears with &nbsp characters on the end.
I have some classes layed out like this class A { public virtual void
I have some code like this in a winforms app I was writing to
I have some kind of test data and want to create a unit test
We have some files on our website that users of our software can download.
I have some ASP.NET web services which all share a common helper class they
I have some code for starting a thread on the .NET CF 2.0: ThreadStart
I have some C# / asp.net code I inherited which has a textbox which
I have some strings of xxh:yym format where xx is hours and yy is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.