| Communications Toolbox | ![]() |
Convert Gray-encoded positive integers to corresponding Gray-decoded integers
y = gray2bin(x,modulation,M)
[y,map] = gray2bin(x,modulation,M)
y = gray2bin(x,modulation,M) generates a Gray-decoded output vector or matrix y with the same dimensions as its input parameter x. x can be a scalar, vector, or matrix. modulation is the modulation type, and must be a string equal to 'qam', 'pam', 'fsk', 'dpsk', or 'psk'. M is the modulation order that can be an integer power of 2.
[y,map] = gray2bin(x,modulation,M) generates a Gray-decoded output y with its respective Gray-encoded constellation map, map.
To Gray-decode a vector x with a 64-QAM Gray-encoded constellation, use
y = gray2bin(x,'qam',64);
To Gray-decode a vector x with a 64-FSK Gray-encoded constellation and return its map, use
[y,map] = gray2bin(x,'fsk',64);
To Gray-decode a vector x with a 256-DPSK Gray-encoded constellation, use
y = gray2bin(x,'dpsk',256);
To Gray-decode a vector x with a 1024-PSK Gray-encoded constellation, use
y = gray2bin(x,'psk',1024);
| gfweight | hammgen | ![]() |
© 1994-2005 The MathWorks, Inc.