09-04-2012 05:09 AM
hi,
I'm trying to filter my acquired digital data array. I'm sure its not hard, but I just dont get the idea to start. I'm acquiring serial data from 1 channel with this VI (based on Dynamic acquisition hardware pattern match.vi).
As you see, I'm acquiring my digital data as array of (1st data) 100000...0 (40 bits of booelan per each data) (2nd data) 100000...0 (3rd data) 100000...0
and I want to be able to filter them like this:
if my filter input is 4, means I'm getting my filtered array like this: (1st data) 100000...0 (5th data) 100000...0 (9th data) 100000...0, which means I get about 1/4 data only from the original data.
this is what I do to filter array of numbers:
so, if M is 4 and my data is: 0,1,2,3,4,5,6,7,8,9,10. I would get filtered data like this: 0,4,8
I just dont get it how to cut the digital array.
regards,
yan.
09-04-2012 02:22 PM
I'm not sure I know exactly what your question is, but I took a guess that you're having trouble converting your digital data to a more standard type. The image below shows an example of how to convert the data; there are many ways to do it, and some are certainly better than what I thought of for this example.
At first I simply create a fake digital waveform, then I convert the waveform to an array of integers, and finally I run the array of integers through your filter. The Front Panel shows the output:
09-04-2012 05:03 PM
hi mkirk, thanks for response.
hmm, what I'm trying to get is I want to filter my serial digital waveform, and save it into file. I'm putting an example of array of numbers with filtering, doesnt mean that I need to convert my digital waveform into array of numbers. But still I need to save the data (if its better to save them rather than in digital data form, I would use it).
But, since my data waveform consist of datas, and each data consist of 40 booleans, I think I might need to use 2x FOR loop, maybe?
So if I'm filtering with factor 4, which means in my output would be my first 40 booleans (index 0-39), then next come 40 booleans (index 160-199), then next come 40 booleans (320-359),...
if its better in digital waveform format to save it, I would rather not to convert it.
regards,
Yan.
09-04-2012 05:26 PM
I got an idea how to filter the data like this, but now I need to filter every 40 booleans instead every 1 boolean.
09-05-2012 01:10 AM
Did you try Array subset function in the array palette..
You need to change the 'index' and 'number of elements' input to the primitive in the for loop and extract data as per req.
(In this case, the number of items wil be 40.The index will change).
09-05-2012 02:13 AM
hi Frabto, thanks for the tip.
now I can filter just like how I want it. But I havent tested with the hardware yet, and I think there would be another problem when I working with the hardware, since I would use 40MHz data to work with.