Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Windowing and counting the number of edges

Hi for a project I am continuously acquiring a signal . The signal contains Sync bit and Data bits. The pattern is attached to this email. After finishing acquiring I would like to extract the data . The method in my mind is to use a window ( the same widths of the data window and count the number of rising edges and falling edges and if it is equal to the number of RE and FE in data window I can say that window is my data window. then I save data

Could you please help me using this method. Do you think is it a good method and how can I implement this windowing and counting the number of edges in LabVIEW/. my input is a digital waveform

 

0 Kudos
Message 1 of 2
(5,372 Views)

Hi tintin_99,

 

So just to confirm, your idea is to 'window' the data, by essentially counting the pulses in the first sync bits part, then counting the pulses in the data bits part.

 

This seems like it should work. Another method could be to mask the data with different binary values, then count edges.

 

For example to count the pulses in the sync bits, mask the digital waveform with a value that turns all the values in the data bits part to zero. Then, you can just count how any true/false values you have.

 

So if my signal is as follows.

 

Sync Bits      Data Bits

10110           10010111011011 ... I can use an OR gate to mask this with the following value...

11111           00000000000000 ... Which will give me...

10110           00000000000000 ... Now I can simple count the boolean values, to ascertain how many pulses were received.

 

The same approach should be applicable to mask the sync bits to count the data bits.

 

I hope this is helpful!

Josh E
Applications Engineer
National Instruments UK & Ireland
0 Kudos
Message 2 of 2
(5,353 Views)