472,333 Members | 1,092 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,333 software developers and data experts.

problem with fft periodogram

Hello,

I am ploting a fft periodogram of my data using a script (found in
internet: http://linuxgazette.net/115/andreasen.html ) that gave me
good results before. There should be a periodicity of >160 in the data
as can be seen by eye. However, this script now says that there is
periodicity of ~9. Can somebody explain me what's wrong? Thank you in
advance.
I present first the python script and second my data.
###### usage ############
python <script_name<data_file>
######### PYTHON SCRIPT ###########
from scipy import *
import scipy.io.array_import
from scipy import gplt
from scipy import fftpack
# Read file
f=open(sys.argv[1], 'r')
tempdata = scipy.io.array_import.read_array(f)
minutes=tempdata[:,0]
wolfer=tempdata[:,1]
# plot data
gplt.plot(minutes,wolfer,'title "Meas" with linespoints')
gplt.xtitle('Minutes')
gplt.ytitle('Wolfer number')
gplt.grid("off")
Y=fft(wolfer)
n=len(Y)
power = abs(Y[1:(n/2)])**2
nyquist=1./2
print nyquist
freq=array(range(n/2))/(n/2.0)*nyquist
period=1./freq
# plot period
gplt.plot(period[1:len(period)], power,'title "Simul" with
linespoints')
gplt.xaxis((50,400))
gplt.xtitle('Period [minutes]')
gplt.ytitle('|FFT|**2')
##########################
######## DATA ############
0 48
20 49
40 54
60 49
80 69
100 92
120 98
140 58
160 50
180 66
200 76
220 82
240 119
260 141
280 128
300 107
320 93
340 78
360 74
380 74
400 93
420 109
440 135
460 118
480 90
500 64
520 58
540 56
560 70
580 90
600 115
620 158
640 150
660 96
680 73
700 61
720 55
740 66
760 81
780 116
800 142
820 111
840 102
860 84
880 64
#################

Oct 25 '06 #1
1 3742
ai*************@gmail.com wrote:
Hello,

I am ploting a fft periodogram of my data using a script (found in
internet: http://linuxgazette.net/115/andreasen.html ) that gave me
good results before. There should be a periodicity of >160 in the data
as can be seen by eye. However, this script now says that there is
periodicity of ~9. Can somebody explain me what's wrong? Thank you in
advance.
The units are wrong on your period axis. Right now you have them in
units of "sample-spacing". So, the plot is telling you that you have a
periodicity of ~9 sample spacings. To get it in unites of minutes you
need to multiply period by the difference in minutes

period_in_minutes = period * (minutes[1] - minutes[0])

Then, plot period_in_minutes versus power. I see a peak around 180
minutes in your data.

-Travis

Oct 25 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition...
11
by: Kostatus | last post by:
I have a virtual function in a base class, which is then overwritten by a function of the same name in a publically derived class. When I call the...
0
by: Refky Wahib | last post by:
Hi I need Technical Support I finished a Great project using .Net and SQL Server and .Net Mobile Control My Business case is to implement...
9
by: Sudesh Sawant | last post by:
Hello, We have an application which communicates using remoting. There is a server which is a Windows Service. The server exposes an object which...
117
by: Peter Olcott | last post by:
www.halting-problem.com
28
by: Jon Davis | last post by:
If I have a class with a virtual method, and a child class that overrides the virtual method, and then I create an instance of the child class AS A...
6
by: Ammar | last post by:
Dear All, I'm facing a small problem. I have a portal web site, that contains articles, for each article, the end user can send a comment about...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was...
0
by: concettolabs | last post by:
In today's business world, businesses are increasingly turning to PowerApps to develop custom business applications. PowerApps is a powerful tool...
0
better678
by: better678 | last post by:
Question: Discuss your understanding of the Java platform. Is the statement "Java is interpreted" correct? Answer: Java is an object-oriented...
0
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: CD Tom | last post by:
This happens in runtime 2013 and 2016. When a report is run and then closed a toolbar shows up and the only way to get it to go away is to right...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.