07-22-2015 10:57 AM
Dear forum members,
With my USB6008 I measure the position of coupled pendulums. Fortunately, this works very well.
But I want to create the envelope of my measured curve (see picture).
I tried to do this with help the Butterworth Filter VI and the Peak Detector VI.
All I got is the first part of the red line and then the black line. But I want to have that the whole line is as the red line (see for example also here https://de.wikipedia.org/wiki/Datei:Sine_envelope.svg).
Attached are my measured data. I would be very thankful if somebody of you here can help me to solve this problem!
Solved! Go to Solution.
07-23-2015 05:42 AM
Attached you can find a simplified version of my code (for LabVIEW 2013 and 8.6) - in reality my code works with live data.
I made some comments and hope that you can understand and improve the code.
If not or if you have questions/hints, please write back!
07-28-2015 04:12 AM
Hallo,
I just wanted to ask if someone of you have an idea to solve my problem.
I do not expect a perfect code, but I would be glad to get some hints!
07-28-2015 04:32 AM - edited 07-28-2015 04:33 AM
07-28-2015 06:51 AM
Dear GerdW,
Thank you for your reply!
Your code produces the same result as my code.
But the problem is that I am not able to adapt your/my code to my needs.
The envelop may not be like in your picture, it must be like here.
That is why I am asking here this question. I simply do not have an idea how I can refine your/my code to get the correct envelop.
Do you or others have an idea/some code?
07-28-2015 06:57 AM
The code posted by GerdW finds the envelope of the positive peaks. Duplicate the code and modify it to find the envelope of the negative peaks (valleys). Then combine the two envelopes to get what you are looking for.
Lynn
07-28-2015 06:58 AM
07-29-2015 03:35 PM
Dear Lyn and GerdW,
For sure I tried to implement things as you suggested. But (for me) this is hard to implement.
Attached you can find a new LabVIEW file in which I try to combine the lines.
It only works a bit as you can see from the attached picture.
Perhaps you can give me some more hints/code examples so that I can improve my code to get the correct envelop.
I really would be glad if you or some others could help me a bit more.
07-29-2015 07:12 PM
Is this what you want?
The changes to get there:
1. Use the same signal as input to both peak detectors. Set one to find Paeks and the other to find Valleys.
2. Subtract the Mean (and then add it back later to get the exact center rather than guessing that it is about 16.
3. Scale the Locations outputs of the peak detectors by dt.
4. Plot peak amplitudes against scaled locations.
Lynn
07-30-2015 02:01 AM
Dear Lynn,
Thanky a lot for your reply and efforts!
Your code is for sure a step into the right direction, but the green and the red line has to cross, as in this picture here.
I tried to implement this for e.g. the red line (see my code here and the result here), but I cannot improve my code by myself.
Do you have another idea?
Attached you can find another file with data. The code I try to write has to work with more data too.
I hope you or some others here can help me!