LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Resample digital waveform on line

I am a bit new to digital waveforms and HSDIO but I am looking for a particular functionality that I think should exist.

 

What I want to do is take a digital waveform, say for example of 4 DIO lines sampled at 2Mhz, where DIO0 is a clock running at 2kHz.  I'd like to resample the waveform to only contain samples on all the other lines where the DIO0 transitioned.  Does this function exist?

0 Kudos
Message 1 of 5
(3,342 Views)

Do you need to programmatically process your data or acquire data at new rate?

Hardware solution: 

You can set clock for the input task to detect transitions.

See solution here for example http://forums.ni.com/t5/Counter-Timer/LabVIEW-USB-6366-sample-2-AI-and-Encoder-Value-triggered-with-...

 

For software solution...

Check first line value, shift register, detect change. 4 kHz (both edges) out of 2 MHz. 

I doubt regular windows PC (not real time) will keep up with this speed. It also depends what you need to do with the data, how fast you need to regenerate this signal.

0 Kudos
Message 2 of 5
(3,322 Views)

Hi Alexander,

Not really able to concider hardware changes at this time.  Also, the waveform contains all the information and I am post processing so no wories about speed, so really lets not concider hardware at all.  Basically, the waveform contains an oversample clock and I'd like to convert to a waveform that only has the samples on the transition of that clock.

 

I am looking at the implementation of the compression VI.  Particulary the DTbl Compress Digital.vi.  The functionality in this VI is very close to what I am looking for however it does "compression" on the change of any line or bit and not just of one.  I am looking at copying this code and tweaking the functionality slightly.

 

The other implemenation that worked was to use the existing compression on just the subset of the one line.  Then using the transition array back on the origonal data and pull out only the samples at those transition indexes.  It is a two step process that could be handled with a tweak of the compression vi.

 

But, if this functionality exists natively I'd like to use that.

0 Kudos
Message 3 of 5
(3,309 Views)

Yes, DTbl Compress Digital.vi will work with modifications. Just replace the comparison of arrays with comparison of the first element in array.

If you have LV 2015 (or may be earlier),  it has conditional autoindexing of the output tunnel. It would get rid of most of this VI code: shift registers, case structure, cutting output arrays.

0 Kudos
Message 4 of 5
(3,301 Views)

@Alexander_Sobolev wrote:

Just replace the comparison of arrays with comparison of the first element in array.

 


Unfortunatly it is not that easy.  The one shift registers is saving the last transistion, not the last sample.

0 Kudos
Message 5 of 5
(3,267 Views)