DASYLab

cancel
Showing results for 
Search instead for 
Did you mean: 

Finding slope after getting maximum points of a signal

Hi, I am a beginner for Dasylab and I am using Dasylab V10. Below are the problem that I faced:

 

Firstly, I save a triggered signal by write data module and use it as signal source by read data module (The signal is shown in Y/t chart 01). Then, I use min/max module to extract the max value. After that, I use arithmetric module and tick the ln(channel). This is because I would like to find out the relationship between ln (Xpeak) versus time. Then I use regression module to find out the slope of the line. However, the slope value shown in the digital Me00 is not the slope for the line. It is the last value ln(Xpeak) as shown in list01. I have tried to find the slope in excel and result is different with it too. And I discovered that the result of Min/Max module is unable to shown in Y/t chart. Why does this happen? Can anyone please explain to me what is my problems to plot the graph of ln(Xpeak) versus time  and calculate the slope? How can I solve it? Thank you!20705iA424B359A4CF27EFAfter

0 Kudos
Message 1 of 7
(8,647 Views)

Hello,

hope this is helpful. If you have known XY relations between the Y axis and t axis then you can use trigonometry relations for a first simple step.

 

Min/Max00 -> determine maxima and minima

Statistik 00 -> determine cumulative maximum (1), maximum position (3)

Statistik 01 -> determine cumulative minimum (2), minimum position (4)

Variable s00 -> write (1), (2), (3) and (4) into global variable (1), (2), (3) and (4)

Relais00 -> after signal wave is stopped, read out the global variable and use tan Alpha trigonometry

(1) - (2)

---------- = tan Alpha, calculate via arctan your Alpha

(4) - (3)


But you can use only this way if you can set the (4) - (3) time diff into any useful relation to Y samples. And the simple solution require that you general use the slope into first global max - min part from signal wave.


Best regards,

MHa

20719iBC02F1464C684BCC


20721i387DFB698CB946A8

0 Kudos
Message 2 of 7
(8,638 Views)

Hello,

an more useful algorithm is for next step (see my last post)

cut out all sample between maximum position (3) and minimum position (4), collect these into an circular buffer and use these sample material for a regression module and the Polynomical coefficients results.

 

Best regards,

MHa

0 Kudos
Message 3 of 7
(8,635 Views)

Dear MHa,

 

First of all, thanks for your input. I really appreciate that. For the solution that sir shows me, I tried it before but this method calculates an inaccurate result since it only can select 2 point to determine the slope. Furthermore, in my case, I am not interest on the minimum points. What I want to do is I would like to collect the maximums value from the 4 peaks of the signal. Then use arithmetric module to (ln) the 4 peaks values. From theory, graph of ln(peak) versus time in my case will show linear regression and the slope or gradient is the -ve decay rate.  However I face problem to plot the graph and calculated the slope by regression module (as stated in my early post). The last graph shown as below is exactly what I want to plot and to do the linear regression to get the slope in dasylab. 

 

 20813i1F8D05AF9A715438

20811i08396DA237F4202D

 

20809i1D74968C9950AC85

In fact I can find the slope between 2 points by using the cursor from the graph or by the method that you show me.  However, it is not suitable for me to applied this method. This is because it can't evaluate accurately the slope for a linear regression comprised of more than 2 maximum points.

 

On the other hand, I have tried to the find the slope by using the differential module but I fail also.

 

By the way, can sir show me how the circular buffer works in my case please? Thank you.

 

 

Best regard,

Mikeson

  

0 Kudos
Message 4 of 7
(8,622 Views)

Hello,

I think now that I have understand your application goal.

20819i2F8B8C6F2AD45EBB

I figure out that the problem based the input value blocks for regression module. The min/max module produce 4 standalone blocks with blocksize 1 for the 4 found maxima. And the regression module get 4 standalone blocks and can't work with this. The strategic is that we have to put the 4 standalone blocksize 1 blocks into 1 with blocksize 4 and give this block to calculation.

But this is not so easy:

- I have checked the usage from Shift Register module, don't work - this module can't handle the "trigger" data from min/max module.

- I have checked the usage from Circular Buffer module, don't work - via Action you can put out the collected values but there are always splitted into 4 block shots with blocksize 1.
So I have not yet an idea to solve this step. Perhaps we get an new refelcetion from other thread post reader here? The option is to write based on DASYLab extension toolkit a C/C++ module to solve this application.

Best regards,

National Instruments Engineering GmbH & Co. KG | Pascalstraße 18 | D-52076 Aachen

 

0 Kudos
Message 5 of 7
(8,614 Views)

Hello,

If I have not error in my reflections, sorry I think this is not possible with standard modules from DASYLab. I think I have a optional way that you can solve your application. Here in germany is a DASYLab reseller. He also offer an additional module "Geradheit" into a DASYLab addon package. But all these informations are only in german, also the internet description. If you interested so I thinks it's the best way if you direct contact the dealer via info@premega.de in english. There you get all informations what you need. Sorry that we can't solve direct with DASYLab standard modules, but perhaps I have any mistake into my reflections ... Perhaps are new ideas from CJ or Tom Rizzo?

Hope this is helpful.

Best regards,

MHa

 

20871i680B940B9E3315DC

0 Kudos
Message 6 of 7
(8,608 Views)

I don't know if this will help. MHa is a better mathematician than I am....

 

There is a module, Signal Adaptation, that would allow you to interpolate the Min/Max points back to a continuous line, using the Full Linear Interpolation function. It's important that the first input of the Adapt module (ch 0) is the original signal timing, and the second input is the slower Min/Max output.

 

Once you have this line, the Differential module will work, more or less correctly, computing. Linear Regression is still not going to work right, since it's block based.

 

20965i8D87E5B069FC377F

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 7 of 7
(8,579 Views)