general/misc/
pwrspc.pro
Routines
top source pwrspc
pwrspc, time, quantity, freq, power, noline=noline, nohanning=nohanning, bin=bin, notperhz=notperhz, err_msg=err_msg, _extra=_extra
NAME: pwrspc PURPOSE: Called with times time and data quantity, PWRSPC returns a power spectrum power at frequencies freq. A Hanning window is applied to the input data, and its power is divided out of the returned spectrum. A straight line is subtracted from the data to reduce spurius power due to sawtooth behavior of a background. UNITS ARE (UNITS)^2 WHERE UNITS ARE THE UNITS OF quantity. freq is in 1/timeunits. THUS THE OUTPUT REPRESENTS THE MEAN SQUARED AMPLITUDE OF THE SIGNAL AT EACH SPECIFIC FREQUENCY. THE TOTAL (SUM) POWER UNDER THE CURVE IS EQUAL TO THE MEAN (OVER TIME) POWER OF THE OSCILLATION IN TIME DOMAIN. NOTE: IF KEYWORD notperhz IS SET, THEN POWER IS IN UNITS^2. If notset power is (as normal) in UNITS^2/Hz. CALLING SEQUENCE: pwrspc, time, quantity, freq, power, noline = noline, $ nohanning = nohanning, bin = bin, notperhz = notperhz INPUT: time = the time array quantity = the function for which you want to obtain a power spectrum OUTPUT: freq = the frequency array (units =1/time units) power = the power spectrum, (units of quantity)^2/frequency_units KEYWORDS: noline = if set, no straight line is subtracted nohanning = if set, then no hanning window is applied to the input bin = a binsize for binning of the data, the default is 3 notperhz = if set, the output units are simply the square of the input units err_msg = named variable that contains any error message that might occur $LastChangedBy$ $LastChangedDate$ $LastChangedRevision$ $URL$
Parameters
- time
- quantity
- freq
- power
Keywords
- noline
- nohanning
- bin
- notperhz
- err_msg
- _extra
File attributes
Modification date: | Thu Feb 13 16:43:46 2014 |
Lines: | 57 |