mListFFT[] simple FFT function for review

• To: mathgroup at smc.vnet.net
• Subject: [mg125310] mListFFT[] simple FFT function for review
• From: "McHale, Paul" <Paul.McHale at excelitas.com>
• Date: Tue, 6 Mar 2012 05:56:21 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com

```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[InputList]-1}]/(Length[InputList]-1);
Xaxis=1/AveragePeriod*Range[0,Floor@(Length[InputList]/2.)-1]/Length[InputList];
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.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

```

• Prev by Date: Re: Suppress Cell Labels
• Next by Date: Re: Suppress Cell Labels
• Previous by thread: get rid of auxiliary brackets
• Next by thread: Re: mListFFT[] simple FFT function for review