08-01-2011 01:58 AM
Hello,
I have a speed signal and I want to find its ups and downs. How could I find the indexes of the signal where it behave like increasing or decreasing?
For example, on this picture. There is a pink signal. Its my speed and I want to find the indexes of the signal where I emphasize the red circle. There has been a drop in about 1 km/h. I dont want to get the smaller values significant.
08-01-2011 03:45 AM
Hi No_Regret,
We might be able to help you further if you can provide more information in regards to the data that is used to draw the plot or a VI that you have created?
In a glance, if you have a waveform data type, you could get the array index of the waveform to get the signal index of the particular waveform.
Regards,
08-01-2011 06:22 AM
Ok. I uploaded an example of my speed signal. There has been 3 point where I emphasized with the red circle. I pointed these places because there have been drop in 10km/h changes. The others smaller than 10. I want to find the start index and the final index of these 3 places.
08-01-2011 06:42 AM
Hello,
First let me clarify the problem - as I understand you want to get the range of indexes of slope, in which signal falls / rises for more than 1 km/h; and ignore all the slopes that changes the signal less than 1 km/h, am I correct?
Regards,
Gregor Cerne
08-01-2011 06:44 AM
More than 10km/h if you use my speed.tdms file.Because In my first message I showed the different signal. And yes, thats what I want but I dont want to ignore. Just want to take the indexes.
08-01-2011 07:01 AM
Oh sorry I understood wrong. Yes I want to get the range of indexes of slope, in which signal falls / rises for more than 10 km/h; and ignore all the slopes that changes the signal less than 10 km/h,
08-01-2011 07:29 AM
Hello,
there are few possible ways to implement:
- first one is to put high-pass filter to eliminate slow changes of the signal. This way you will get only slopes, because constant speed will be filtered.
- other one is to use waveform peak detection VI to detect peaks or valleys (for output you get 2 arrays - one for locations and one for values of peaks/valleys), and then check if the difference between neighbor peak and valley is big enough to detect it. In this case you will output the index of peak and index of valley as begin/end of slope.
- next option is to derivate whole signal (Derivative x(t)) - when you have derivate, you know that the integration between two neighbor zeros will give you the speed difference on one slope - after you get the difference you check if it is desired or not.
The choice of technique is yours, so if you will have any further questions or problems about implementation please fell free to ask.
Regards,
Gregor Cerne
08-01-2011 11:30 AM
I couldn't solve it using high-pass filter. May the values I use might be different I don't know but I've tried many Lower cut off values and frequencies but didnt get what I want.
could you please explain the other methods a little bit more in detail?
08-02-2011 02:42 AM
Hello,
You probably set the frequency at the high pass filter to a too high frequency, so it filtered not only constant speed but some of the peaks. Try slowly lowering the filtered frequency and monitor the output until you get better graph, the please post the results.
Regards,
Gregor Černe
08-02-2011 03:15 AM
I've tried but will try a bit more values thanks. On the other hand I guess my problem is about phase shift. Im not good at filtering, I'm still trying different things but if I couldnt solve this problem using filter nothing came to my mind different solutions.