I am trying to get the frequency spectrum of periodic data. Since the data set is short, the outcome of the frequency peaks are not sharp enough for me to do further analysis. I know the spectrum can be improved by using the maximum entropy method, but have no clear idea how to write the code. Is there anyone can help me?

My code with normal Fourier transform to a test data is:

A1 = 0.7;
A2 = 0.3;
F1 = 60;
F2 = 155;
testdata = 
    {dt, A1*Sin[2π*F1*dt - 3π/4] + A2*Sin[2π*F2*dt - 5π/4]},
    {dt, 0.022, 0.036, 0.00001}];
mydata = 
   testdata[[All, 2]] + RandomReal[NormalDistribution[0, .02], Length[testdata]];

zeros = Table[0, {i, 1, Length[mydata]*5}];
oscillationwindow = 
    Table[mydata[[i]]*0.5*(1 - Cos[(2*π*i)/Length[mydata]]), {i, 1, Length[mydata]}],
fft = Abs[Fourier[oscillationwindow]];
ListLinePlot[fft, PlotRange -> {{0, 100}, {0, 5}}]

P.S. Now I realize that maximum entropy method is a kind of autoregressive model, which can be partly realized by the TimeSeriesModelFit function in Mathematica.

  • 2
    $\begingroup$ (1) This is a short set of values. It should be included, in input form, right in the question, not put in a link. (2) The code above does not run so it needs to be repaired. (3) It is unclear what is wanted, different from the result of Fourier. $\endgroup$ – Daniel Lichtblau Aug 16 '17 at 21:39
  • 2
    $\begingroup$ I'm not familiar with the topic, but according to this page MEM is just a deconvolution algorithm, then how about directly using ListDeconvolve? $\endgroup$ – xzczd Aug 19 '17 at 10:02
  • $\begingroup$ thanks for the comments, Daniel and xzczd $\endgroup$ – Phyman Aug 23 '17 at 15:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.