LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Fitting complicated step functions

Hi

 

I have complicated step function as in image. I need to get the values in each step, what is the fastest fitting procedure?

stepfunction.png

0 Kudos
Message 1 of 11
(3,816 Views)

Hi cornell,

 

usually one tries to detect the steps in your signal and average the parts in between…

 

What have you tried so far?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(3,807 Views)

Thank you for the reply. I am trying to fit it, find the derivatives and thresholds etc. Then average the values between indeces. But it starts to get complicated and I want to ask if there is something build in. 

 

 

0 Kudos
Message 3 of 11
(3,803 Views)

Hi cornell,

 

it starts to get complicated

You think to analyze your signal as shown is complicated? With easily detectable steps and nearly no noise?

 

I want to ask if there is something build in

Did you check the signal processing palette?

 

General hints:

- getting the derivate is to subtract two samples and divide by the time between them…

- your signal seems to have steps in a certain frequency so it might help to discover them as you already know when to expect the next step…

- to detect a step you could check if the current value is outside a range around a running average of the last x samples (range should be greater than expected noise level)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 11
(3,792 Views)

I agree it is a clear signal, but that fitting has to to happen for each pixel of an image. And I am using DAQ with 30kHz rate. I am looking for a tricky way of doing it. 

 

0 Kudos
Message 5 of 11
(3,787 Views)

@emrahturgut wrote:

And I am using DAQ with 30kHz rate. I am looking for a tricky way of doing it.


Let's explore this a little more.  Where is the signal coming from?  Does the source of the signal have a sample clock?  What is the rate of that clock?  Is is exportable so that you can sample it yourself (or use it as a sample clock yourself)?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 11
(3,770 Views)
Hi,

You don't want to fit, you want to split and average.
Have you tried my ideas/approaches?

Attach a VI with some default data in it!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(3,759 Views)

@emrahturgut wrote:

I am looking for a tricky way of doing it. 


If you are familar with wavelets then read on. Your signal looks taylor made for Haar wavelets. Unfortunately they are not in the base package, but you could program them in if necessary. Look at tutorials for wavelets if you are unfamiliar.

 

cheers,

mcduff

0 Kudos
Message 8 of 11
(3,742 Views)

Here are some data. 

0 Kudos
Message 9 of 11
(3,735 Views)

There are four signal read by DAQ. 

Two has 3kHz modulation, two is AI voltage. 

 

It needs to take 1-D scan at 100 pixel. But in each pixel it needs to sample ~200 points, so that it can sense the 3kHz modulation (DAQ rate is in order of 20kHz ). 

 

For each pixel, it needs to find the average of two AI voltage as shown in the figure. 

and find the peak to peak values in the modulated signal. 

 

In addition, it does the 1-D scan ~1000 times. 

I am planning increase 3kHz modulation and number of pixel later. That is why I am looking for some elegant way of doing it. 

 

Bestsstepfunction2.png

0 Kudos
Message 10 of 11
(3,731 Views)