06-18-2021 01:11 PM
Hello,
I have a question about 2 data that have 2 different time data synchronization.
For example. I have these channel.
- Time1 (Numeric X channel)
- Data1 (Numeric Y channel)
- Time2 (Numeric X channel)
- Data2 (Numeric Y channel)
These two channel Time1 and Time2 do not have same sampling rate.So, they are not synchronized.
I want to synchronize them in one Time channel. Diadem may increase the data number in channel by interpolating. Finally I need these 3 channels.
- Time
- Data1
- Data2
Note: I am trying to export the data to excel with just one time channel.
Thank you.
Solved! Go to Solution.
06-20-2021 06:43 PM
Please post a small sample of the data. This will help us to help you.
I created a channel synchronization app to help with these issues (idea and solution based on a forum post by Brad Turpin). Please try it and see if it helps with your specific problem. http://www.savvydiademsolutions.com/apps.php?topic=apps-synchronize-channels
06-21-2021 05:13 AM
Hello,
Savvysolutions do not solve my problem. I want a common and shared time channel . I am sharing an example data.
I shared a excel file. These data are collected from one recorder and these can be drawn synchronizedly in a graphic. However, if you pay attention, time channels are fully synchronize. I need just one time channel, not two.
Thank you.
06-22-2021 08:25 AM
Hello, I found the solution.
You should choose resampling from analysis part. Analysis -> Channel Function -> Resampling -> Sprecify interpolation channel and choose the time channel that has the biggest sampling rate.
Have a good day.
07-09-2021 10:24 AM
I tried this and got the following error message:
Cannot execute the operation because the "[16]/Voltage Side B-28V" channel is not monotonic increasing from line 1 onwards.
It's monotony property is set to not monotone.
Does resampling only work on monotonic data?
07-10-2021 02:59 AM - edited 07-10-2021 03:01 AM
Please share .tdm or .tdms file next time instead of .xlsx as the import process into DIAdem can affect the result.
Below is a script I used to synchronize the "Data X" and "Data Y" channels to "Time".
Dim sFilePath, oChnX1, oChnY1, oChnX2, oChnY2, oChnDelta, oElementList
sFilePath = "D:\Documents\_junk\Sample Data.tdms"
Call Data.Root.Clear()
Call DataFileLoad(sFilePath,"TDMS","Load|ChnXYRelation")
Set oChnX1 = Data.GetChannel("[1]/Time"): Set oChnX1.XRelation = Nothing
Set oChnY1 = Data.GetChannel("[1]/Data X")
Set oChnY1.XRelation = oChnX1
Set oChnX2 = Data.GetChannel("[1]/Time_1"): Set oChnX2.XRelation = Nothing
Set oChnY2 = Data.GetChannel("[1]/Data Y")
Set oChnY2.XRelation = oChnX2
'Delete NoValues in channels "Time 1" and "Data Y"
Call ChnNovHandle(oChnX2, oChnY2, "Delete", "XY", True, False, 0)
'Calculate the sample rate for "Time" and add as property "SampleRateHz"
Set oChnDelta = Data.Root.ChannelGroups(1).Channels.Add(oChnX1.Name & "_Delta", DataTypeChnFloat64)
'Calculate the difference between two successive channel values.
Call ChnDeltaCalc(oChnX1, oChnDelta)
'Calculate the median for oChnDelta
Call ChnStatisticsChannelCalc(oChnDelta, eStatsMedian+eStatsArithmeticMean+eStatsGeometricMean)
Call oChnX1.Properties.Add("SampleRateHz", 1/oChnDelta.Properties("Result~Statistics~MeanValues~GeometricMean").Value)
Call LogFileWrite("'" & oChnX1.Name & "' sample rate = " & Str(oChnX1.Properties("SampleRateHz").Value,"AutoAdj") & String(1,vbTab) & "Hz")
Set oElementList = Data.CreateElementList()
Call oElementList.Add(oChnDelta)
Call Data.Remove(oElementList)
Set oChnDelta = Nothing: Call oElementList.RemoveAll: Set oElementList = Nothing
'Calculate the sample rate for "Time_1" and add as property "SampleRateHz"
Set oChnDelta = Data.Root.ChannelGroups(1).Channels.Add(oChnX2.Name & "_Delta", DataTypeChnFloat64)
'Calculate the difference between two successive channel values.
Call ChnDeltaCalc(oChnX2, oChnDelta)
'Calculate the median for oChnDelta
Call ChnStatisticsChannelCalc(oChnDelta, eStatsMedian+eStatsArithmeticMean+eStatsGeometricMean)
Call oChnX2.Properties.Add("SampleRateHz", 1/oChnDelta.Properties("Result~Statistics~MeanValues~GeometricMean").Value)
Call LogFileWrite("'" & oChnX2.Name & "' sample rate = " & Str(oChnX2.Properties("SampleRateHz").Value,"AutoAdj") & String(1,vbTab) & "Hz")
Set oElementList = Data.CreateElementList()
Call oElementList.Add(oChnDelta)
Call Data.Remove(oElementList)
Set oChnDelta = Nothing: Call oElementList.RemoveAll: Set oElementList = Nothing
'Re-sample "Data Y" to same sample rate as "Time"
Call LogFileWrite("Resampling '" & oChnY2.Name & "' from " & Str(oChnX2.Properties("SampleRateHz").Value,"AutoAdj") & " to " & Str(oChnX1.Properties("SampleRateHz").Value,"AutoAdj") & " Hz..")
Call ChnResampleFreqBased(oChnX2, oChnY2, oChnY2, oChnX1.Properties("SampleRateHz").Value, "Automatic", False, False, "Akima")
'Channel "Time_1" is no longer valid because "Data Y" is now a waveform channel, so delete it.
Set oElementList = Data.CreateElementList()
Call oElementList.Add(oChnX2)
Call Data.Remove(oElementList)
Set oChnX2 = Nothing: Call oElementList.RemoveAll: Set oElementList = Nothing
'Convert "Data Y" from waveform back into X-Y numeeric channels..
Set oElementList = WfChnToChn(oChnY2, False, "WfXRelative")
Set oChnX2 = Data.GetChannel(oElementList.Item(1).GetReference(eReferenceNameName))
oChnX2.Name = "Time_1"
'Calculate the sample rate for "Time_1" and add as property "SampleRateHz"
Set oChnDelta = Data.Root.ChannelGroups(1).Channels.Add(oChnX2.Name & "_Delta", DataTypeChnFloat64)
'Calculate the difference between two successive channel values.
Call ChnDeltaCalc(oChnX2, oChnDelta)
'Calculate the median for oChnDelta
Call ChnStatisticsChannelCalc(oChnDelta, eStatsMedian+eStatsArithmeticMean+eStatsGeometricMean)
Call oChnX2.Properties.Add("SampleRateHz", 1/oChnDelta.Properties("Result~Statistics~MeanValues~GeometricMean").Value)
Call LogFileWrite("'" & oChnX2.Name & "' sample rate = " & Str(oChnX2.Properties("SampleRateHz").Value,"AutoAdj") & String(1,vbTab) & "Hz")
Set oElementList = Data.CreateElementList()
Call oElementList.Add(oChnDelta)
Call Data.Remove(oElementList)
Set oChnDelta = Nothing: Call oElementList.RemoveAll: Set oElementList = Nothing
'You don't need channel "Time_1" anymore, so delete it..
Set oElementList = Data.CreateElementList()
Call oElementList.Add(oChnX2)
Call Data.Remove(oElementList)
Set oChnX2 = Nothing: Call oElementList.RemoveAll: Set oElementList = Nothing
'Fix "Data Y" XYRelation
Set oChnY2.XRelation = oChnX1
The LogFile output is:
'Time' sample rate = 61.05 Hz
'Time_1' sample rate = 7.51 Hz
Resampling 'Data Y' from 7.51 to 61.05 Hz..
'Time_1' sample rate = 61.05 Hz
07-12-2021 07:55 AM
Thanks for your reply. I cannot share Data as it is under ITAR control, but I will try the script and let you know how it worked out.
Thanks Very Much