Macro Examples - PSD and data processing

Beta releases, announcements and anything else that doesn't fit below. Please read the <B>Welcome</B> topic.

Moderator: DPlotAdmin

Post Reply
analysispros
Posts: 1
Joined: Sat Dec 02, 2006 10:10 am

Macro Examples - PSD and data processing

Post by analysispros »

Hi there,

Is anyone aware where can I find more DPlot Macro examples?
I am specifically looking for data processing Macros like generating PSD's from time history data and manipulating the time history.
Excel can't handle over 64000 rows and I can not do manipulations there.
There are couple of Macro examples that come with Dplot but it is not enough to teach someone the Macro language from scratch.

Thanks,

Roni Plachta
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

There is no macro repository on the site, but if you have specific questions about how to do something I'll be happy to answer them.

To generate the PSD:

FFTMethod(1)
FFT()
EditOperateY("Y^2")

FFTMethod(1) says "Don't pad the input record with 0's out to the next power of 2". As an aside, I may get rid of this option in a future release. For large records with large prime factors, the FFT calculation time can be long, but "long" is getting shorter all the time and there's no mathematical justification for padding with 0's.
Visualize Your Data
support@dplot.com
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Post by jsc »

David,

DON'T get rid of pad w/zero's option - still very slow (microwave slow) on a large data set (400k points). Just tried it -seemed like 10 times slower, ie, 50 seconds vs. 5 seconds on my 1.73gHz laptop. Not everyone is using 3+ gHz machines to crunch data!

jsc
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

Noted :D

As long as you more or less understand what you're doing I suppose there's no harm in it. I should probably add a few examples showing how that option can give less-than-perfect results at some frequencies in certain cases.
Visualize Your Data
support@dplot.com
jsc
Posts: 222
Joined: Fri Dec 02, 2005 8:56 am

Post by jsc »

Well, I definitely fall into the category of not knowing what I am doing! (Well, sometimes!!)

So examples would be appreciated!
User avatar
DPlotAdmin
Posts: 2312
Joined: Tue Jun 24, 2003 9:34 pm
Location: Vicksburg, Mississippi
Contact:

Post by DPlotAdmin »

I'm no expert at FFTs either, but you can experiment with simple stuff like sine waves to see the difference. Just off the top of my head I tried this:

Y=sin(100*pi*X) with 0<X<4 and dX=0.0001

In a perfect world the FFT would show a single spike at 50Hz and 0's everywhere else. And that's very close to what you get if you check "Run the FFT as is". If you pad with 0's (which adds 25535 0's to your 40001 input points) you get the same spike at (close to) 50Hz and smaller nonsense values on either side of 50Hz. This admittedly isn't a bad problem in this case, but I'm reasonably sure I can come up with worse examples once I put my thinking cap on.
Visualize Your Data
support@dplot.com
Post Reply