cancel
Showing results for
Did you mean:

## Remove drift function

Hello,

I'm working with a Diadem for the first time.

I have problem with remove drift function. I don´t know where I find function drift. I need speed give to back to zero.

Message 1 of 11
(1,861 Views)

## Re: Remove drift function

Hi Lukas_MIS,

The function for this is “Detrend” and is based on the linear regression.

Greetings

Walter

Message 2 of 11
(1,807 Views)

## Re: Remove drift function

Hello Walter_Rick,

I tried these function, but still it´s same. Could you give me an advice please ?

Below you can see the picture where the graph is before I integrate the signal into the speed. If you want these data send so I have file .DTM

Lukas_MIS

Message 3 of 11
(1,781 Views)

## Re: Remove drift function

Hi Lukas_MIS,

In DIAdem we have implemented a detrending function which is based on the linear regression function. The example “Detrending an Oscillation Signal” shows how it is working.

This function is well suitable for more or less linear trends.

Your signal seems to have two different trend directions. It can be that DIAdem detrend function is not the best for your type of signal.

Greetings

Walter

Message 4 of 11
(1,762 Views)

## Re: Remove drift function

Hello Walter_Rick

Lukas_MIS

Message 5 of 11
(1,740 Views)

## Re: Remove drift function

Hello Lukas_MIS,

Yes, I can try to help. First we need some realistic data and must know what is the expected signal. Then we can try to find an algorithm to eliminate the trend. And finally we define a script for it.

Greetings

Walter

Message 6 of 11
(1,729 Views)

## Re: Remove drift function

Hello Walter_Rick,

OK, super many thanks. Realistic data are in attachment.  I need integrate signal from acceleration to speed. I used filter 300

Expected signal: I need get signal back to zero.

Greetings

Lukas_MIS

Message 7 of 11
(1,715 Views)

## Re: Remove drift function

Hello Lukas_MIS,

Finding an algorithm which fits quiet well can be time-consuming and very complex. In general, you need a function which follows the original curve well but without too much peaks. This curve must then be subtracted from the original curve.

I think a good compromise can be the approximation function with these parameters:

The subtraction result is then:

Comparing the result and original curve looks like this:

This is just a suggestion for this curve and other curves may need other functions.

Here is the script code.

``````dim iLoop
for iLoop = 1 to 26
ApprAnsatzFct(iLoop) = "-"
next
ApprAnsatzFct(2) = "Yes"
ApprAnsatzFct(6) = "Yes"
ApprAnsatzFct(7) = "Yes"
ApprAnsatzFct(8) = "Yes"
ApprAnsatzFct(9) = "Yes"
ApprAnsatzFct(10) = "Yes"
call ChnApprXYCalc("", "[1]/Integrated", "", "/ApproximatedY", "Partition complete area", 2501, 1)
call = ChnSub("[1]/Integrated", "[1]/ApproximatedY", "/Subtracted1")
``````

Greetings

Walter

Message 8 of 11
(1,693 Views)

## Re: Remove drift function

Hello Walter_Rick

I need your support because I have still problem with settings. I use same curve and I used same settings as you and it's writing me this message.

Can you please advise me where i am making a mistake ?

Many thanks,

Lukas_MIS

Message 9 of 11
(1,673 Views)

## Re: Remove drift function

Hi Lukas_MIS,

You are calculation quantity based, which is in general good, because DIAdem handles in the background the correct calculation regarding the physical units. But for this it is necessary to have correct SI units which your dataset doesn’t have.

For this you need to change two things. The unit for gravity (in your case “g”) is for SI “m/s^2”. In addition, your waveform channels have no time parameters. As an example I added the name  “Time”, the unit “ms” and the step width “1” for your input channels.

Then I recalculated everything.

Greetings

Walter

Message 10 of 11
(1,646 Views)