09-27-2022 04:23 AM
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
09-27-2022 05:13 AM
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.
09-27-2022 10:47 AM
@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…
(Go ahead ,Bob, I know your going to ask how I went there)
.hint: that's not noise!
09-27-2022 12:56 PM
@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.
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 🙂
09-28-2022 12:17 AM
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
09-28-2022 12:24 AM
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?
09-28-2022 09:37 AM
09-28-2022 09:52 AM
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