EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: FFT and waveform
From: Mark Rivers <[email protected]>
To: "'Gofron, Kazimierz'" <[email protected]>, "'[email protected]'" <[email protected]>
Cc: "Jan Marjanovic \([email protected]\)" <[email protected]>
Date: Mon, 28 Mar 2016 17:37:39 +0000

Hi Kaz,

 

You should be able to just use the code in ADCore/ADApp/pluginSrc/fft.c.  It is only 132 lines of code, and has no external dependencies, so it can even run on VxWorks and RTEMS.  It contains these 2 functions:

 

void fft_1D(double data[], unsigned long nn, int isign);

void fft_ND(double data[], unsigned long nn[], int ndim, int isign);

 

These functions do the FFT in-place.  data[] is really a complex array, with each element of data[] consisting of 2 doubles, the first containing the real part and the second containing the imaginary part.

 

For your application the data from the electrometer will be put in the real part of data[],  the imaginary part will be set to 0.  isign should be 1.  nn is the array dimensions which must be a power of 2.  On return data[] will contain the complex FFT, with both real and imaginary values.

 

Mark

 

 

 

From: Gofron, Kazimierz [mailto:[email protected]]
Sent: Monday, March 28, 2016 11:01 AM
To: Mark Rivers; '[email protected]'
Cc: Jan Marjanovic ([email protected])
Subject: RE: FFT and waveform

 

Hello Mark,

 

Indeed my inquiry is related to TetrAMM. The TetrAMM has two interfaces: Cat6 ethernet beamline network, and LC fiber (connected to BEST FPGA feedback system). The digital current measurement data flow through both interfaces simultaneously.

The 1G Ethernet communication is process by quadEM module and provides many areaDetector features including the upcoming FFT update.

 

In addition, CAENels released open version of the BEST ioc this month, and I have started using it.

GitHub: https://github.com/CAENels/best-epics-ioc

The view through BEST FPGA system allows information about implemented (piezo) feedback, in addition to passive monitoring that quadEM allows. However, the BEST IOC is missing some useful features like FFT. Adding FFT would enhance it.

 

Kaz

 

 

From: Mark Rivers [mailto:[email protected]]
Sent: Sunday, March 27, 2016 1:27 PM
To: Gofron, Kazimierz; '[email protected]'
Subject: RE: FFT and waveform

 

Hi Kaz,

 

This is from the areaDetector/ADCore release notes for the upcoming R2-5 release.  These items are available now in the master branch on github.

 

****************************************

### NDPluginFFT

* New plugin to compute 1-D or 2-D Fast Fourier transforms.  It exports 1-D or 2-D

  NDArrays containing the absolute value of the FFT.  It creates 1-D waveform

  records of the input, and the real, imaginary, and absolute values of the first row of the FFT.

  It also creates 1-D waveform records of the time and frequency axes, which are useful if the 1-D

  input represents a time-series. The waveform records are convenient for plotting in OPI screens.

* The FFT algorithm requires that the input array dimensions be a power of 2, but the plugin

  will pad the array to the next larger power of 2 if the input array does not meet this

  requirement. 

*  The simDetector test application in

  [areaDetector/ADExample](https://github.com/areaDetector/ADExample)

  has a new simulation mode that generates images based on the sums and/or products of 4 sine waves.

  This application is useful for testing and demonstrating the NDPluginFFT plugin.

****************************************

 

 

This is from the areaDetector/ADExample notes for the upcoming R2-2 release.  These items are available now in the master branch on github.

 

****************************************

* Created a new driver in ADExample/exampleApp/ADCSimDetectorSrc.

  This driver generates times-series data for 8 signals as a 2-D array [8, NumTimePoints].

  The signals are common waveforms (sine, cosine, square wave, sawtooth, random noise, etc.)

 

  The driver was written in part to test the new NDPluginTimeSeries and NDPluginFFT plugins

  in ADCore R2-5. But it can also serve as a starting point for writing drivers that are used

  to collect time-series data like ADCs, waveform digitizers, etc. 

 

  There is a new iocs/iocADCSimDetector directory that creates an application for testing

  the driver.

* Added a new sine-wave simulation mode to simDetector.  This simulation mode constructs images

  as the sum or products of two sine waves in the X and Y directions.  It was designed in part

  to test the new NDPluginFFT plugin in ADCore R2-5.

****************************************

 

Mark

 

 

From: [email protected] [mailto:[email protected]] On Behalf Of Gofron, Kazimierz
Sent: Sunday, March 27, 2016 11:24 AM
To: '[email protected]'
Subject: FFT and waveform

 

Hi all,

 

My waveform (1024 current reading in [A], @1s) needs to be processed for frequencies using FFT method. The current values are in range between pA and mA ranges.

 

There is an existing tech-talk exchange on FFT from about 5 years ago that discuss FFT3, fftw, and waveProc.  

 

FFT3 based:

http://www.aps.anl.gov/epics/tech-talk/2011/msg01143.php

http://www.fftw.org/fftw3_doc/Complex-DFTs.html#Complex-DFTs
 
The github fftw development:
https://github.com/FFTW/fftw3

 

The waveProc is bit dated (2004?)

http://www.aps.anl.gov/epics/download/modules/index.php

 

Any newer solutions and suggestions?

 

Kazimierz Gofron

NSLS-II Controls Group

Brookhaven National Laboratory

(p) +1 (631) 344 5283

(f) +1 (631) 344 8085

(e) [email protected]

(w) www.bnl.gov/nsls2

 


Replies:
Re: FFT and waveform Jan Marjanovic
References:
FFT and waveform Gofron, Kazimierz
RE: FFT and waveform Mark Rivers
RE: FFT and waveform Gofron, Kazimierz

Navigate by Date:
Prev: RE: FFT and waveform Gofron, Kazimierz
Next: Modbus devices lost connectivity Wallace, Alex
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: FFT and waveform Gofron, Kazimierz
Next: Re: FFT and waveform Jan Marjanovic
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 15 Jul 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·