07-07-2016 12:35 PM
I have a data stream coming from an instrument. I am looking at a string of about 90 pulses, each 1 usec width. I am digitzing 2100 samples 2100/90 = 23 samples/pulse.
I need a binary representation of the analog waveform. I tried decimating the entire data stream but the instrument output has too much jitter that I have no control over. I attached a visual of what I am trying to do. I hope this makes sense. I'm scratching my head thinking I may need to go in an entirely different direction. We have time and hardware constraints to consider.
Thanks in advance.
07-07-2016 03:28 PM
What do you mean? I don't fully understand what you're trying to do, from what you've told us so far, you want to create an analog to digital converter? From what I can infer you would need to:
-Take said 23 samples and turn them into a binary representation (resolution depends on your needs) such as %11111111 (1024 decimal)
-Store said samples to reconstruct the signal. You mention 23 samples per pulse, i.e. 23 times the signal frequency, so sampling rate sounds great to me
So in a nutshell, you would have 90 binary numbers, one per pulse, from which you would reconstruct the signal (hopefully). Please attach VI for further advance.
07-07-2016 03:58 PM
Not clear on either the final goal or the specific constraints.
What I see:
What you described:
What I surmise:
What I suggest:
-Kevin P
07-07-2016 04:25 PM
It seemed like it might be fun to code up... so I did. I didn't bother with optimizations, but this should execute fairly fast.
07-07-2016 05:10 PM
Thanks for the followup! Kudos granted, other comments not meant as criticism, just offered to help original poster. Note: I'm on LV2013 and couldn't inspect the non-visible code in the snippet.
-Kevin P
07-11-2016 01:40 PM
I had a few ideas soon after I posted but got sidtracked Friday into something else.
I was a little confused because this seems like something that needs to be done often enough that we would have a more out-of-the-box primitive to this. So I did it myself. This is what I came up with.
Later on down the pipe I use some decimation to convert 23 sample-wide pulses to 1 bit booleans. Little to no jitter to speak of. Works well. Data seems solid. Thanks for the ideas and suggestions.
07-11-2016 02:24 PM
Hi Paul,
why do you need so many loops? 😄
You can compare array with a comparison as they employ polymorphism.
You can search for elements in an array!
You can do the whole stuff on booleans instead of DBL values storing just 0 or 1…