DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Slope

I am trying to get a dynamic slope in DasyLab.
 
The way the worksheet is currently set up gives me a reading once every second. The reading is decaying over time, with variation about a mean slope. I can get a slope by using the cursor tool, but this is calculated using only the endpoints and is not really a good fit to the intermediate data. Is there a way to get a slope of a line using only the last 30 or 60 or 300 data points?
0 Kudos
Message 1 of 5
(7,833 Views)
Use the Differentiation module in conjunction with some form of data reduction, such as the Average module. Differentiation will compute dy/dt continuously, then the Average module can provide you with the mean over the number of samples that you want to evaluate.
Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 2 of 5
(7,805 Views)

Thanks CJ. I recieved the same advice from the DasyLab technical support.

How does the differentiation module work? It seems like it is programmed to give the differential for a function rather than a set of discrete data points. Can I make it consider only the most recent data points and not everything I've fed it?

Brad

0 Kudos
Message 3 of 5
(7,793 Views)
Differentiation is dy/dt, where dt is the sampling distance (1/rate), and dy is (y1-y0). It is computed continually - the output signal is the slope as it changes over time.

To change the computation, you can use a Relay to snapshot samples based on a trigger or other timing signal, or, you can use Averaging to do the computation (average over 3000 samples, at 10 s/sec, would give you points every 5 minutes).

I also looked at Linear Regression, where the block size was modified (I used the Data Window module) to make the block be 3000 samples. The output value matched the Average slope, and matched the cursor values, too. I was using a Sine wave, to guarantee that the slope changed over time.
Measurement Computing (MCC) has free technical support. Visit www.mccdaq.com and click on the "Support" tab for all support options, including DASYLab.
0 Kudos
Message 4 of 5
(7,783 Views)

CJ, thanks again for your input. I needed to get a least squares regression from my data, so I ended up using a DDE with Excel to export the data for regression. This seems works very well and I'm getting exactly what I need now.

Brad

0 Kudos
Message 5 of 5
(7,762 Views)