LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what's the best technique to calculate rise and fall times of noisy waveform

I am working on a project where I need to calculate the rise and fall times of waveforms. I am receiving very noisy waveforms from a photodetector. I just want to calculate rise and fall times. at the moment, the rise and fall times I am getting don't make sense and are not repeatable due to noise. 

 

I am thinking of using some kind of curve fitting as I have shown in the attached picture. I tried o use curve fitting express VI but it didn't give me the expected fit. the fit I obtained from curve fitting VI was more like a sine wave. But I need to get something as shown in the picture.  

 

If any of you have experience with solving something like this, please help me... Thank you !!  if you need any more information, let me know 

0 Kudos
Message 1 of 8
(1,812 Views)

Hi ATX,

 


@ATX1122 wrote:

I am receiving very noisy waveforms from a photodetector. I just want to calculate rise and fall times. at the moment, the rise and fall times I am getting don't make sense and are not repeatable due to noise. 


  • Apply a filter on your data to reduce the noise.
  • Use the filtered data to detect the parts of the signal with your level changes.
  • Then use the unfiltered data to calc rise/fall times: using the detected timestamps cut a small part from your signal which only includes the level change and calc your times from that…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 8
(1,792 Views)

@GerdW wrote:

Hi ATX,

 


@ATX1122 wrote:

I am receiving very noisy waveforms from a photodetector. I just want to calculate rise and fall times. at the moment, the rise and fall times I am getting don't make sense and are not repeatable due to noise. 


  • Apply a filter on your data to reduce the noise.
  • Use the filtered data to detect the parts of the signal with your level changes.
  • Then use the unfiltered data to calc rise/fall times: using the detected timestamps cut a small part from your signal which only includes the level change and calc your times from that…

  • Use an incandescent source rather than the compact florescent. 

(Go ahead ,Bob, I know your going to ask how I went there)

.hint: that's not noise!


"Should be" isn't "Is" -Jay
Message 3 of 8
(1,744 Views)

@JÞB wrote:

.hint: that's not noise!


To add to this hint: look at the period of your "noise". It'll stand out.

 

And, to expand on GerdW's post a little bit: He suggested three steps...

1. Filter your data

2. Use filtered data to detect changes in waveform

3. Return to unfiltered data to calculate your times

 

There's an implicit point in his steps which is "don't use your filtered data for rise time detection" that I thought worth making explicit. One of the major problems with most filters is that they will not effectively preserve the edges. If you take your square wave and too heavily filter it, it'll start to resemble a sinewave and mess up your calculations for rise and fall time.

 

For example, looking at the plot below the blue line is original signal and the red line is a lowpass Butterworth filter. You can see that I've managed to get a good portion of the noise, but there is a time shift and the edges are not preserved.

 

BowenM_0-1664300224946.png

 

So you will want to pick your filter carefully to preserve edges, and decide how to use it to detect major changes in your data. Then go back to original signal and use that for calculating your rise and fall times.

 

Or just dig more into JÞB's suggestion and look closer at your light source 🙂

Message 4 of 8
(1,728 Views)

Hi, 

Thank you for your explanation. 

 

One thing is not clear to me. What do you mean by "go back to the original signal and calculate the rise time"? when I use my original signal, my rise times are not repeated well ( ex: if I take 3 measurements it's like 1.9ms, 5.3ms, 2.4ms like that. ) That's the main reason I thought of filtering or some kind of processing to the signal to be able to calculate repeatable rise time. 

 

So lets say I use a filter to clear the noise. But still, I have to use the unfiltered signal to get rise time? 

 

Thanks 

0 Kudos
Message 5 of 8
(1,675 Views)

Thanks for the idea. 

I control the time changes of the signal at a specified frequency. So, in this case, I don't need to determine the time stamps of level signal level changes using filtered data since I know exactly when the time changes occur. ( because I know the high/low change frequency ) 

 

so basically, what I have to do is just select a smaller time frame that covers only the transition part of the signal and calculate the rise time. 

 

Have i understood your solution correctly? 

 

0 Kudos
Message 6 of 8
(1,674 Views)
Yes, if you are controlling the transitions, you can focus on the transition time segments and ignore the steady state noise

"Should be" isn't "Is" -Jay
0 Kudos
Message 7 of 8
(1,635 Views)

And make a calculation about the expected uncertainty due to noise ..

compare it with your results

 

steps with  defined risetimes have a defined spectrum.

now look at the noise spectrum

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 8 of 8
(1,630 Views)