Reply by December 1, 20022002-12-01
 If you have communication toolbox, check the functions dmodce and modmap. The mapping of indices to bits, as you required, you can use a look-up table (a vector). For example, we can have bits=[0 2 1 3]. Then for an input index in_phase (0 to 3), bits(in_phase) (when converted to binary), is the decoded bits. You can use the same way for encoding. Another way to deal with multiple it-clauses is the switch-clause. You can check it out with helps. Hope this helps, Feng -----Original Message----- From: Toivon Sarastus [mailto:] Sent: Saturday, November 30, 2002 2:23 PM To: Subject: [matlab] bits to symbols and vice versa Hi, Is there some easy way to encode and decode QPSK symbols to bits? For exmple 0 -> 00, 1-> 10, 2 -> 01, 3 -> 11. I didn't find any function that does that. Of course one can write a simple function with four if - clauses, but can you do it more elegantly? http://docs.yahoo.com/info/terms/> .
Reply by December 1, 20022002-12-01
 dec2bin(number,2) should result in 00 for 0 01 for 1 10 for 2 11 for 3 if you could find some way to reverse the resulting string u wud get the result u wanted. regards, narayanan --- Toivon Sarastus <> wrote: > Hi, > > Is there some easy way to encode and decode QPSK > symbols to bits? > For exmple 0 -> 00, 1-> 10, 2 -> 01, 3 -> 11. > I didn't find any function that does that. Of course > one can write a simple > function with four if - clauses, but can you do it > more elegantly? > > ===== Narayanan Srinivasan Graduate Student LDCSEE West Virginia University Morgantown, WV 26505 Ph: 1 (304) 293 6925(Off.) 1 (304) 685 2165(Cell) __________________________________________________
Reply by November 30, 20022002-11-30
 Hi, Is there some easy way to encode and decode QPSK symbols to bits? For exmple 0 -> 00, 1-> 10, 2 -> 01, 3 -> 11. I didn't find any function that does that. Of course one can write a simple function with four if - clauses, but can you do it more elegantly?