Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Cross Spectrum CRBasic


nstatom Dec 1, 2014 09:45 PM

Hello,

I would like to output wave directional spectrum parameters from IMU accelerations or GPS position using CRBasic. This would require some cross spectrums to be computed from the position information. I see the FFT command but don't know if it can be extended to two variables? Please let me know if this is possible. If not, is there a way to pay Campbell to extend support for this command in their OS? Looking to use CR6 or CR1000.

Thanks,
Nick


GTProdMgr Dec 2, 2014 07:40 PM

Short Answer: The FFT and FFTSpa commands do not currently support 2 dimensions for input (2-valued [vector] inputs). The two main options you have are 1) implement your own algorithm in CRBasic that can use multiple single-dimension FFTs to obtain the desired result, or 2) initiate a detailed discussion with Campbell Scientific about the kind of 2D-FFT that could be implemented.

Long Answer:
I've never seen a request like this, so I had to do a bit of research. At this point I'm assuming your inertial measurement unit (IMU) and GPS device is on board an ocean vessel and that the requested directional spectrum output is for characterizing ocean waves (the two dimensions being wave frequency and direction of propagation). I suppose the other possibility is that you have a network of buoys, but you still would be characterizing sea wave conditions.

Right now, the FFT and FFTSpa instructions in the CR6 and CR1000 perform only one-dimensional fourier transforms.
They take a basic series of values (the "time-series" input of 2^n points) and return one of the following outputs: Amplitude, Real-Img, Amp-Phase, Power, or Power Spectral Density (this is the "frequency domain" output).
So the output is a series of single values or a series
of pairs, depending on which output is chosen.

One possibility to consider is that an algorithm could be developed that relies only on several single-dimensioned FFTs combined together in some way to obtain the desired output. That algorithm could be implemented in a CRBasic program by you or someone else. However, a knowledge of that algorithm is something CSI personnel don't have, and so a required first step would be to provide/articulate that algorithm.

Perhaps you could do all of this on your own if you only had
a "two-dimensional" FFT function added to the CRBasic language. If that is something you want to explore, we would need to have some guidelines about exactly what kind of 2D-FFT calculation would be required.

What inputs would there be besides the instantaneous wave height/water level ? Position or velocity ?

I've looked at links like those below, but we would
require some further guidance. We have pretty good
support for Covariance operations, if those become
relevant in your algorithm.
http://en.wikipedia.org/wiki/Cross-spectrum
http://fourier.eng.hmc.edu/e101/lectures/Image_Processing/node6.html

I recommend that you contact your local Campbell Scientific representative, including a discussion of any paid programming that might be relevant.

Log in or register to post/reply in the forum.