MathGroup Archive 2012

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: simple FFT function for review

  • To: mathgroup at smc.vnet.net
  • Subject: [mg125397] Re: simple FFT function for review
  • From: "McHale, Paul" <Paul.McHale at excelitas.com>
  • Date: Mon, 12 Mar 2012 04:06:26 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201203071038.FAA02486@smc.vnet.net>

Dana,

Sweet!  Never heard of Differences[].  Nice approach.

Paul


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.McHale at Excelitas.com
www.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


-----Original Message-----
From: Dana DeLouis [mailto:dana2010 at me.com]
Sent: Wednesday, March 07, 2012 5:38 AM
To: mathgroup at smc.vnet.net
Subject: [mg125397] simple FFT function for review

Hi.  Not sure if this helps...

Symbolic data (x,y) pairs:

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

Your equation for AveragePeriod:

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: How to use Save/Get for interpolation of unstructured
  • Next by Date: Re: Engineering requests
  • Previous by thread: Re: mListFFT[] simple FFT function for review
  • Next by thread: Equation numbers funny problem