DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I decimate a data channel?

How do you decimate a channel in Diadem?  I have done some searching but have not
found any answers.  I thought there was a decimate function but I can't find it.
 
Jim Sweeten
 
0 Kudos
Message 1 of 9
(3,975 Views)
Hi Sweeten,

If you would like to reduce the channel length - lets say from 100 to 50 - you can easily change the channel attribute "Length".
Or you can decimate a channel with the "Classification and Data Reduction" (Panel ANALYSIS -> Statistics functions --> Reducing classification). With this function you can split a channel into n classes and calculate for each class the mean, max, min, quantity and sum.

I hope this info will help you.

Greetings

Walter


0 Kudos
Message 2 of 9
(3,966 Views)

Thanks for the reply but that is not exactly what I was looking for.  What I have is a time channel and a data channel and I want to

create 2 new channels with every 100th point.  It looks like we will be writing a function.

Thanks,

Jim

0 Kudos
Message 3 of 9
(3,960 Views)
Hi sweeten,
 
Actually, Walter's suggestion of the function "Classification and Data Reduction" (Panel ANALYSIS -> Statistics functions --> Reducing classification) is able to pull out every 100th point for you.  It will run much faster than anything depending on a VBScript loop.
 
I'd highly recommend you use it,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 4 of 9
(3,956 Views)
Hi sweeten,
 
Actually, Walter's suggestion of the function "Classification and Data Reduction" (Panel ANALYSIS -> Statistics functions --> Reducing classification) is able to pull out every 100th point for you.  It will run much faster than anything depending on a VBScript loop.
 
I'd highly recommend you use it,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
0 Kudos
Message 5 of 9
(3,956 Views)

Hi Brad,

 

I am still having problems with this.  I have also read what you wrote here http://forums.ni.com/t5/DIAdem/Good-decimation-function/td-p/1138235  

 

Basically, I am going to disagree with you and hope that you can show me that I am wrong.

 

You said "...is able to pull out every 100th point for you..."  I cant make the function do that.  

 

I have 4001 lines of data in two channels, one a time channel and one a data channel. The time channel has evenly spaced times from 0 to 0.4 at 0.0001 time step (10 kHz sampling).  

 

I can use Reducing Classification to resample this data to a 100 Hz sampling (401 data points from t=0 to t=0.4 with 0.001 timestep) by using Reducing Classifcation (with X-channel settings: Determination Mode--> Begin/End/Width, Begin --> -0.0005, End -->0.4005, width 0.001)  But the only thing that makes sense in the "Reduction Mode" setting is "MEAN".  Thus, it actually takes the mean of the 10 values surrounding each new time and reports them in that time.  

 

I do not want that.

 

I want another reduction mode called "VALUE" or something, that does what you say...just gives me the value...i.e. I dont want to average the signal from t= -0.0005 to t=+0.0005 to give me the value at t=0, I just want it to take the value at t=0 and return it (forgetting about the other 10 values around).  

 

Show me that I dont know what I am talking about!!! PLEASE!!!

0 Kudos
Message 6 of 9
(2,951 Views)

Hi jrk3z,

 

On closer inspection, I have to admit I was wrong about the reducing classification function.  The "Quantity" option counts the number of values, it doesn't pull the Nth value unchanged.  However, DIAdem 2014 has a new function call "Resampling" which looks like it does what you want for data that is already loaded.

 

If you're loading data from file, though, then you should be able to load with data reduction and get the Nth value behavior you're looking for.

 

IntervalValue = 100
Call DataDelAll
DataFilePath = "C:\Users\Public\Documents\National Instruments\DIAdem 2012\Data\Example.tdm"
Call DataFileLoadSel(DataFilePath, "TDM", "[1]/*")
Call DataFileLoadRed(DataFilePath, "TDM", "[1]/*", "IntervalWidth", IntervalValue, 1)

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 7 of 9
(2,939 Views)

Hi Brad,

 

I will definitely try v2014 for the new functions.  I need to check if we have a license.

 

For the loading data, that is an interesting idea...unfortunately though, the data I want to resample resulted from several calculations done in diadem.  I guess I could spit out hte data in CSV, and then re-load it with data reduction, but it seems pretty bass-ackwards to do it this way...

 

Thanks for your help though!

 

Jason

0 Kudos
Message 8 of 9
(2,937 Views)

Hi jrk3z,

 

DIAdem 2014 isn't officially released yet, but you could sign up for the Beta program.  If you decide to spit out the data with DataFileSaveSel(), I'd recommend sending it to a temporary TDM file instead of CSV-- it will perform way faster AND preserve all your properties.

 

Brad Turpin

DIAdem Product Support Engineer

National Instruments

0 Kudos
Message 9 of 9
(2,934 Views)