08-31-2013 09:04 AM
Hello, i am getting data from excel file into array, then i am using 'sim arbitrary signal' block to set a dt which i need and to plot signal(it is voltage signal). Then i need to get a 1st derivative of this signal. and there i am getting problems cause after using derivative from (time domain sig pallete) my derivative doesnt look proper. Is there anyone who could help me? U can see in attachments some piece of my VI, Graph of Voltage Signal and Graph of Derivative of Voltage Signal
Solved! Go to Solution.
08-31-2013 10:16 AM
Are you sure your dt is correct? Looking at the image vol.png I would guess that the dt is closer to 100 us than 4 us. That will make a big difference in the derivative.
Please post your VI (rather than an image of part of the block diagram) and the data file.
Lynn
08-31-2013 10:52 AM - edited 08-31-2013 10:58 AM
I am 100% sure that my dt is 0,000004s
I ve attached my project, excelorto867 is main file, inside is also a setting file (settings.png)
08-31-2013 12:09 PM
The problem is that your data is rather noisy and the standard differentiation techniques accentuate the noise. Another factor is the decreasing dt at the beginning. This creates overlapping plots.
I tried the Savitsky-Golay smoothing and differentiation method and can definitely see the derivative.
This is for the portion after the time column reaches zero and starts increasing. The setting was for 240 side points and 3rd order polynomial for the Savitsky-Golay differentiatior. The blank spaces at the ends are due to the smoothing process which cannot cleanly handle the ends of the data array. The image below shows the same calculation with 50 sidepoints of smoothing.
You can see the sinusoidal signal in there, just barely, but the extra smoothing above helps. Note that ti takes much longer to run with more sidepoints.
I do not have the Excel VIs so I converted your file to a tab-delimited text file then read it once with Read from Spreadsheet File.vi. Then I created a constant from the all rows indicator and used that as my data source.
Lynn
08-31-2013 12:38 PM - edited 08-31-2013 01:00 PM
Wow, thx, u ve done a big thing. It is very helpful to me. Can u look at my attachment, how should i connect it to my VI correctly? Some kind of error is occuring
08-31-2013 01:47 PM
Error -5111 is one I defined for the Differentiator and Smoother VI. The second line of the error message is the clue to the problem. L <= 2k + 1. L repesents the length of the input array. K is the number of side points. It appears that the input array is too small for the number of side points you have selected.
Note the constant 1709 connected to the Array Subset functions. That is based on the location of the minimum in the first column. If you are using different data, you will need to change that or remove it for data with monotonic time values.
There are some things about your code I do not understand. You have a 2D array coming from the spreadsheet. You connect it to Index Array with a control wired to both Column inputs and nothing wired to the row inputs. This gives you two copies of the selected colu