LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make this function >>random chose bits and flip it

Hi ni and member

I try to make this vi that do this function 

I need it to use in academic research

I have  stream of bits  have length=100bitsmove in serial

and I want a selector that select between ratio  0.1 0.2 or 0.05 that represent error ratio

its ratio of bit that much flip (0 to 1) and (1 to 0)

for exqmple

for 0.1 ratio 10 bit of stream must randomly chosen and flipped

for 0.5 ratio  50 bit of stream must randomly chosen and flipped

 

any help please

 

best regards

 

 

 

hi ?Q>

0 Kudos
Message 1 of 4
(2,066 Views)

Hi mangood,

 

- use a ring or enum for your selector

- depending on the selector value create a boolean array containing randomly set bits

- XOR your boolean array with your stream bit array

Done...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 4
(2,060 Views)

@GerdW wrote:

Hi mangood,

 

- use a ring or enum for your selector

- depending on the selector value create a boolean array containing randomly set bits

- XOR your boolean array with your stream bit array

Done...


thank you with kudos

i did not understand the stament """use a ring or enum for your selector"""

can you make a pic for the vi  

 

best regards

hi ?Q>

0 Kudos
Message 3 of 4
(2,051 Views)

Hi mangood,

 

when placing a control on your frontpanel you could use a ring or enum found in the "Rings and Enum" control palette...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(2,031 Views)