FW: Resend: power spectrum/freqs.

• To: mathgroup at smc.vnet.net
• Subject: [mg15357] FW: Resend: power spectrum/freqs.
• From: jim leddon <jleddon at cyberramp.net>
• Date: Sat, 9 Jan 1999 23:58:19 -0500
• Sender: owner-wri-mathgroup at wolfram.com

```Hi,

I have a question regarding calculating the power spectrum and
frequencies of a set of intensities values. The data set is a small
one.

In the program below , I have calculated and plotted not only a power
spectrum but also a power spectrum versus frequencies of a data set of
intensity values.I am trying to determine if the intensities contain
any  dominant frequencies or if the power spectrum has a chaotic type
behavior shape. From what I understand, the Fourier Transform (FT)
takes  a time domain set of values and converts these to a frequency
domain set  of values. It seemed reasonable that once I calculated the
FT, I could  account for the aliasing by removing the second part of
the spectrum and  then use the remaining FT values to get the power
spectrum which is by  definition the absolute value of the the
FT(remaining values) multiplied  by it's conjugate (remaining values)FT
- divided by the square root of  the the length of the data list. I
then calculated the frequencies based  on the FT, although I've noticed
that  alot of people who have used  Mathematica will use the
"InverseFourier" function to calculate the  power spectrum and
frequencies. My question is; in looking at the  attached program, am I
correct about how to calculate the power spectrum  and frequencies? Is
it also correct to use the entire FT spectrum times  its' conjugate FT
(or just the square of the FTs- since the absolute  value of the
conjugate is the same as the absolute value of the FT)  to  calculate
the power spectrum?
ClearAll;
<<Calculus`FourierTransform`
(* Program to determine power spectrum of a set of solar flux data;
Intensities in SFUs*)

data = {643,783,642,742,683,765,683,789,676,623,456,743,
783,646,666,673,873,675,673,646,676,666,763,785,783,783,
657,643,781,789,786,678,673,673,654,642,675,782,652,783,
782,767,673,672,673,675,672,673,674,675,784,783,783,666};

n = Length[data]

ft = Fourier[data];

m = Length[ft]

ListPlot[Abs[ft], PlotJoined->True]

ListPlot[data, PlotJoined->True, PlotRange->All]

(*In order to account for aliasing of fourier(FT) of data, calculate the
Power Spectrum using only the first half of the FT data*) nft =
Take[ft,27];

cft = Conjugate[nft];

pwrspec = Abs[nft cft]/ Sqrt[27];

p = Length[pwrspec]

freq = Abs[Sqrt[27] nft];

l = Length[freq]

Transpose[{freq, pwrspec}];

ListPlot[%, PlotJoined->True, PlotRange->All]

ListPlot[pwrspec, PlotJoined ->True, PlotRange->All]

I also would like to ask if there is a way to use the "Frequencies"
function under the "Statistics`DataManipulation`" package in order to
calculate the frequencies. I have used this function before, however,
there must be some way of ordering the output to correspond with a
power  spectrum if one wanted to plot both the power spectrum vs.
frequencies.

Thank you for your time and consideration in reading this email message.
I'd look forward to hearing from you if you can help.

Regards,
Debbie Leddon

```

• Prev by Date: Re: How to make m_file ?
• Next by Date: Re: Saving only input cells
• Previous by thread: Re: listplot and notebook directory
• Next by thread: Performance Problem