From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

multi channel resample function

Solved!
Go to solution

I'm using LabView 2009 Fall and I want to resample multi channel data (2D array) continously. This means that I need a resample function with one filter stage per channel. Is there any subVI available that I can use? I can only find VI's for one channel at a time and this doesn't work since they don't provide initial conditions; they only have initialize/continous.. I want the VI to pad the data automatically so that the data lines up with the unfiltered data and so that I'm not losing any data.

 

Thanks

0 Kudos
Message 1 of 11
(3,145 Views)

hi mrsound, 

 

I am not clear on your desired application, but from my understanding you should look in the LabVIEW Examples (Help> Find Examples).  Depending on what kind of reading you are expecting, this path may change, but for an example I am using Voltage readings: click Hardware Input and Output > DAQmx > Voltage > Acq&Graph Voltage-Int Clk.vi

 

Once you open this VI, go to the front panel, and select your device. Then, to read multiple channels, select multiple channels in the drop-down menu or use a colon (for example, a0:2 to read channels 0, 1, and 2). 

 

Hope this helps!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 2 of 11
(3,128 Views)

Thank you, but I don't understand how this will help me. I wrote resample..

 

I have a huge data set and therefore need to process it in chunks. For this I need a continuous multi channel resample function.

0 Kudos
Message 3 of 11
(3,126 Views)

hi mrsounds,

 

My apologies for misunderstanding you. So you are not actually reading from different channels, as much as you are trying to pull certain sections off of a

spreadsheet?

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 4 of 11
(3,123 Views)

Sorry for being unclear. I will try to explain..

 

I'm trying to process a huge multi channel data set that is saved in a binary file. Since the file is so huge I cannot read it all into memory; I have to do all my processing in chunks. The multi channel data in the binary file is saved interleaved, which means that the different channels are all mixed together, and I don't want to chunk through the file more than ones.

 

The first step in my processing of the data is to resample it. Therefore I want a resample function that can process one chunk at a time and remember the filter stages for the different channels separately. Then the chunk is passed on to my second processing step.

0 Kudos
Message 5 of 11
(3,118 Views)

Never mind..

 

Seems like the built in resample function actually can handle multiple channels at ones if I wire a 2D array to it. 🙂

0 Kudos
Message 6 of 11
(3,105 Views)

ah, now I understand. Have you actually written this file yet? If not, I would highly recommend you write a TDMS file (a specialized form of binary, with headers which distinguish the data from each channel). If you have already written it to a binary file, you will need to reverse the write and then re-write it into a TDMS file. The TDMS pallette (under File I/O in LabVIEW) will do exactly what you need. If you want to use the binary file you already have written, you can progromatically parse through it, but you will need to know exactly how the data is stored. For example, you could find the total length of the file, then divide it by the number of channels you are reading from, then iterate through and pull every section of that length. However, if any of the bit lengths are non-uniform, or you get off by one bit, your data will be completely skewed. 

 

If you need any further clarification on this, please let me know. Thanks!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 7 of 11
(3,101 Views)

Thanks,

 

The original file is a wave file (and I think all of them are interleaved). This perticular file is from a data recorder that even adds extra information to the wave file, for example scaling factors. I can read all information with my custom made reader, following the manufacturer's file specification. Then I add even more information and save it in my own similar format.

0 Kudos
Message 8 of 11
(3,099 Views)

so, the built in resample function does what you need? If so, please post where it is in the functions pallette and tag that as a solution. Thanks!

 

~kgarrett

 

District Sales Engineer
0 Kudos
Message 9 of 11
(3,087 Views)
Solution
Accepted by topic author mrsound

@kgarrett88 wrote:

so, the built in resample function does what you need? If so, please post where it is in the functions pallette and tag that as a solution. Thanks!

 

~kgarrett

 



Signal Processing -> Signal Operation -> Rational Resample 🙂

0 Kudos
Message 10 of 11
(3,080 Views)