Re: mListFFT[] simple FFT function for review

• To: mathgroup at smc.vnet.net
• Subject: [mg125338] Re: mListFFT[] simple FFT function for review
• From: Dana DeLouis <dana2010 at me.com>
• Date: Wed, 7 Mar 2012 05:38:29 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com

```Hi.  Not sure if this helps...

Symbolic data (x,y) pairs:

v=Array[x,{4,2}];

AveragePeriod=Plus@@Table[v[[i+1,1]]-v[[i,1]],{i,1,Length[v]-1}]/(Length[v]-1)
(1/3) * (x[4,1] - x[1,1])

Mean[Differences[v[[All,1]]]]
(1/3) * (x[4, 1] - x[1, 1])

%% == %
True

Which would be true with your statement --It assumes the data is evenly spaced.--

= = = = = = = = = =
HTH  :>0
Dana DeLouis
Mac & Math 8
= = = = = = = = = =

On Mar 6, 5:57 am, "McHale, Paul" <Paul.McH... at excelitas.com> wrote:
> Purpose of this function is to take a list with {TimeOfSample,Data} pairs and perform FFT to show spectral content.  It assumes the data is evenly spaced.
>
> I know it's simple.  Any input welcome or extra features you think would be useful.
>
> Input: {{TimeOfSample,Data},...} pairs
> Output: {{Frequency, Energy},...};
>
> mListFFT[InputList_]:=Module[{Xaxis,Yaxis,AveragePeriod},
> AveragePeriod=Plus@@Table[InputList[[i+1,1]]-InputList[[i,1]],{i,1,Length[I nputList]-1}]/(Length[InputList]-1);
> Xaxis=1/AveragePeriod*Range[0,Floor@(Length[InputList]/2.)-1]/Length[InputL ist];
> Yaxis=Abs[Fourier[InputList[[All,2]]]];
> Yaxis=Yaxis[[1;;Floor@(Length[Yaxis]/2.)]];
> Transpose[{Xaxis,Yaxis}]
> ]
>
> I am considering looking at the averaging of the time between samples to detect sample time discontinuities by looking for a maximum deviation from max time difference to min time difference.
>
> Any input welcome.
>
> Paul McHale  |  Electrical Engineer, Energetics Systems  |  Excelitas Technologies Corp.
>
> Phone:   +1 937.865.3004   |   Fax:  +1 937.865.5170   |   Mobile:   +1 937.371.2828
> 1100 Vanguard Blvd, Miamisburg, Ohio 45342-0312 USA
> Paul.McH... at Excelitas.comwww.excelitas.com
>
> Please consider the environment before printing this e-mail.
> This email message and any attachments are confidential and proprietary to Excelitas Technologies Corp. If you are not the intended recipient of this message, please inform the sender by replying to this email or sending a message to the sender and destroy the message and any attachments.
> Thank you

```

• Prev by Date: Re: Plotting a simple line at a weibull
• Next by Date: Re: different results
• Previous by thread: mListFFT[] simple FFT function for review
• Next by thread: Re: simple FFT function for review