参考一下fskmod
y = fskmod(x,M,freq_sep,nsamp) outputs the complex envelope y of the modulation of the message signal x using frequency shift keying modulation. M is the alphabet size and must be an integer power of 2. The message signal must consist of integers between 0 and M-1. freq_sep is the desired separation between successive frequencies in Hz. nsamp denotes the number of samples per symbol in y and must be a positive integer greater than 1. The sampling rate of y is 1 Hz. By the Nyquist sampling theorem, freq_sep and M must satisfy (M-1)*freq_sep <= 1. If x is a matrix with multiple rows and columns, the function processes the columns independently.
y = fskmod(x,M,freq_sep,nsamp,Fs) specifies the sampling rate of y in Hz. Because the Nyquist sampling theorem implies that the maximum frequency must be no larger than Fs/2, the inputs must satisfy (M-1)*freq_sep <= Fs.
y = fskmod(x,M,freq_sep,nsamp,Fs,phase_cont) specifies the phase continuity. Set phase_cont to 'cont' to force phase continuity across symbol boundaries in y, or 'discont' to avoid forcing phase continuity. The default is 'cont'.
y = FSKMOD(x,M,freq_sep,nsamp,Fs,phase_cont,symbol_order) specifies how the function assigns binary words to corresponding integers. If symbol_order is set to 'bin' (default), the function uses a natural binary-coded ordering. If symbol_order is set to 'gray', it uses a Gray-coded ordering.