| Contents | Index |
z = fskdemod(y,M,freq_sep,nsamp)
z = fskdemod(y,M,freq_sep,nsamp,Fs)
z = fskdemod(y,M,freq_sep,nsamp,Fs,symbol_order)
z = fskdemod(y,M,freq_sep,nsamp) noncoherently demodulates the complex envelope y of a signal using the frequency shift key method. M is the alphabet size and must be an integer power of 2. freq_sep is the frequency separation between successive frequencies in Hz. nsamp is the required number of samples per symbol and must be a positive integer greater than 1. The sampling frequency is 1 Hz. If y is a matrix with multiple rows and columns, the function processes the columns independently.
z = fskdemod(y,M,freq_sep,nsamp,Fs) specifies the sampling frequency in Hz.
z = fskdemod(y,M,freq_sep,nsamp,Fs,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.
The example below illustrates FSK modulation and demodulation over an AWGN channel.
M = 2; k = log2(M);
EbNo = 5;
Fs = 16; nsamp = 17; freqsep = 8;
msg = randi([0 M-1],5000,1); % Random signal
txsig = fskmod(msg,M,freqsep,nsamp,Fs); % Modulate.
msg_rx = awgn(txsig,EbNo+10*log10(k)-10*log10(nsamp),...
'measured',[],'dB'); % AWGN channel
msg_rrx = fskdemod(msg_rx,M,freqsep,nsamp,Fs); % Demodulate
[num,BER] = biterr(msg,msg_rrx) % Bit error rate
BER_theory = berawgn(EbNo,'fsk',M,'noncoherent') % Theoretical BER
The output is shown below. Your BER value might vary because the example uses random numbers.
BER =
0.1086
BER_theory =
0.1029

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |