bin2gray

Convert positive integers into the corresponding Gray-encoded integers

Syntax

y = bin2gray(x,modulation,M)
[y,map] = bin2gray(x,modulation,M)

Description

y = bin2gray(x,modulation,M) generates a Gray-encoded vector or matrix output 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] = bin2gray(x,modulation,M) generates a Gray-encoded output y with its respective Gray-encoded constellation map, map.

Examples

To Gray-encode a vector x with a 64-QAM Gray-encoded constellation, use

y = bin2gray(x,'qam',64);

To Gray-encode a vector x with a 64-FSK Gray-encoded constellation and return its map, use

[y,map] = bin2gray(x,'fsk',64);

To Gray-encode a vector x with a 256-DPSK Gray-encoded constellation, use

y = bin2gray(x,'dpsk',256);

To Gray-encode a vector x with a 1024-PSK Gray-encoded constellation, use

y = bin2gray(x,'psk',1024);

See Also

gray2bin


© 1994-2005 The MathWorks, Inc.