LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Morse Decoder Array Problem

Solved!
Go to solution

Hello everyone,

 

I'm trying too make a morse decoder in LabVIEW.

So far everything is working out fine, but now I'm stuck on a simple problem.

I'm trying to compare my 8 bit array with a bigger array with all the possible letters in it e.g: 10001010.

At the end of the program I want to know the number of the row of the corresponding letter, so I can say: this code is for instance letter F.

Do you have any idea how I have to do this? I found a few programs on this forum, but none of them did what I was looking for.

Thanks in advance,

 

Nicolas Smiley Very Happy

0 Kudos
Message 1 of 12
(3,649 Views)

Nicholas,

 

Since Morse is a variable length code, how do you encode it in 8 bits?

 

I think you may be making this much more difficult than it needs to be.  Convert the 8 bits to an integer. Is that integer the answer you want?

 

Lynn

 

0 Kudos
Message 2 of 12
(3,568 Views)

I made my own adaptation of morse, because otherwise it would be too difficult to manually produce and record the code.

I'm able to make 6 small arrays of 1 byte (6 letters). I also made an arrays with all the codes in it. 

I only need to compare both arrays and be able to tell which letter it is.

 

This is my own code:

Thank you for the fast reply

0 Kudos
Message 3 of 12
(3,557 Views)
Solution
Accepted by topic author InspectorMorse

Nicolas,

 

Create two arrays in the same order.  One will have the numeric codes. The other will have the letters.  Use the Search 1D array function with the code value. The output will be the index in the array where the value is found.  Use Index Array to get the corresponding letter from the other array.

 

Lynn

Message 4 of 12
(3,535 Views)

·-- ···· ·- -   ·- -··· --- ··- -   -· ··- -- -··· · ·-· ···   ··--··   
·----   ··---   ···--   ····-   ·····   -····   --···   ---··   ----·   -----

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 5 of 12
(3,522 Views)

I don't really understand how I can make them in the same order? Can I add more numbers in one place in the array? Or do I have to use clusters?

Because Search array only exists for 1D.

Sorry for being so foolish Smiley Embarassed

0 Kudos
Message 6 of 12
(3,495 Views)

As Lynn stated earlier, your best bet is to convert your 8-bit code into a number (Boolean Array to Number).  You can then use the Search 1D Array to get an index for which letter was received.

 

So you need 2 arrays of the same length.  One will be the coded numbers.  The other the letters corresponding to the coded number.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 12
(3,486 Views)

Inpsector,

 

Not being foolish, just not too experienced with LabVIEW yet.

 

Since you will be creating the arrays manually, just make the arrays like the table you posted. 

 

Letters: [A, B, C, D,... Z]

Codes: [10110000, 11101010, 11101110, 11101000,... 11111010]

 

Searching Codes for 11101110 will return index 2. Letters[2] = C.

 

Lynn

0 Kudos
Message 8 of 12
(3,484 Views)

be sure to drink your Ovaltine

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 12
(3,466 Views)

Thank you all for replying so fast.

After my previous post, I tried making it without 'search array'.

After a while I found another way to make the program (attachement).

I just logged in again to tell you it's working and now I see how I could have used the search function.

 

Nicolas

p.s.: if you are interested, I can post a movie of the robot here later.

 

0 Kudos
Message 10 of 12
(3,462 Views)