Message Boards Message Boards

0
|
496 Views
|
4 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Wrong frequencies in Periodogram?

POSTED BY: Vladimir Ivanov
4 Replies

Try it using Most[] on that range; it may be that you included one point too many.

POSTED BY: Daniel Lichtblau

I guess this is because your data are not perfectly periodic - in the sense that the first value is not identical to the last one. To assure this you just have to include one more point, e.g.:

n = 100;
data = Cos[2 \[Pi] Range[0, n]*0.25] // N;

The length of the data list is now 101, and the periodogram is probably like you are expecting it.

POSTED BY: Henrik Schachner

Why? Length[Range[0,100-1]] is 100.

POSTED BY: Vladimir Ivanov

Henrik, the discrete Fourier transform works for any signal, not only for ones with the first and last elements equal.

We can check it formally, making sure that the explicit inverse Fourier transform

Table[Chop[1/Sqrt[n] (Fourier[data] . Table[Exp[-2 \[Pi] I t s / n ], {s, 0, n-1}])], {t, 0, n-1}]

brings us back to the initial data. And this expression, in the case of my signal, includes Exp[-2 [Pi] I t * 0.25 ] rather than Exp[-2 [Pi] I t * 0.255102 ], so the true frequency must be 0.25.

POSTED BY: Vladimir Ivanov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract