06-18-2010 09:57 PM
Hi,
I acquire data (4 channels) with a high sampling rate and then do some data manipulation and reduction. So chunks of 1000 acquired values gives me 1 value for each channel. I then use the Convert to Dynamic Data with input data type "1D array of scalars - multiple channels" and the Collector subVI to create a Dynamic Data Signal. How can I set the sample rate of that signal? It is set to 1 per default but I need to set it to 1/1000 of my original sample rate to get the correct frequency information for my new signal in further calculations.
Thanks
Andreas
06-18-2010 11:36 PM - edited 06-18-2010 11:42 PM
Makes no sense to me. How can a single sample have any sort of rate. Need at least two samples to define a time interval between them. How can you calculate a frequency from a single sample?
That's the evil of dynamic data. It allows you to wire signals to anything, even data that makes no sense. Even the 1D data would not yield anything meaningful since all four channels are acquired at the same time.
edit - saw that you were using the collector. In that case, your sample rate is how fast your loop iterates. Again no relationship to the actual original sample rate.
06-21-2010 12:02 PM
it definitely makes sense what I am doing. Think of it as offline data processing. So the loop rate doesn't matter.
06-21-2010 12:47 PM
Every time your loop iterates, you get 1 sample per channel, correct? Then it does not matter what the original DAQ sampling was. It only matters what the loop rate is - how often you get that single sample. Effectively, you are doing the same thing as NChan 1Samp. Say you acquire 100 samples at 1000 Samples/sec and reduce it to 1. Then you change it to 100000 samples at 100000 Samples/sec and reduce it to 1. With both you are acquiring a single sample every 100 msec.
If the way you are actually acquiring and reducing is something different than what I understand from your explanation, post your code so no one has to do any guessing.
06-21-2010 12:58 PM
Alright, let's say I have one sample every 100msec. My question now is: How do I set this sampling rate for my new dynamic data?
06-21-2010 01:22 PM
With 2009, you can use the Set Dynamic Data Attributes but pay attention to this bug. In earlier versions or to avoid dynamic data, use a waveform data type and the Build Waveform function.
06-21-2010 02:21 PM
and what is the attribute called that I have to set?
06-21-2010 02:29 PM
Sorry, never really used the Express VI and with a brief look, thought the x unit would work. Appears this does not allow you to set a dt value. Have to use the Build Waveform to set dt.