Home > other >  Matlab prepared FSK demodulation program
Matlab prepared FSK demodulation program

Time:10-14

The function FSK
Fc=10; % carrier frequency
Fs=40;
% system sample frequencyFd=1; % code rate
N=the Fs/Fd;
Df=10;
NumSymb=25; % information simulation code number
M=2; % hexadecimal number
SNRpBit=60; % SNR
SNR=SNRpBit/log2 (M);
Seed=[12345] 54321;
NumPlot=25;
% 25 binary random code
X=randsrc (numSymb, 1, [0: M - 1)); % 25 binary random code
Figure (1)
Stem ([0: numPlot - 1), x (1: numPlot), 'bx);
The title (' binary random sequence)
Xlabel (' Time ');
Ylabel (' Amplitude);

% modulationY=dmod (x, Fc, Fd, Fs, FSK, M, df);
NumModPlot=numPlot * Fs.
T=[0: numModPlot - 1]./Fs.
Figure (2)
The plot (t, y (1: length (t)), 'b -');
Axis ([min Max (t) (t) 1.5 1.5]).
The title (' modulated signal)
Xlabel (' Time ');
Ylabel (' Amplitude);
The % of coherent demodulation
Randn (' state ', the seed (2));
Y=awgn (y, SNR - 10 * log10 (0.5) - 10 * log10 (N), "measured", [], 'dB'); % in the modulated signal with gaussian white noise
Z1=ddemod (y, Fc, Fd, Fs, FSK, M, df);
% with output waveform frequency shift keying demodulation coherent M yuan
Figure (3)
Stem ([0: numPlot - 1), x (1: numPlot), 'bx);
Hold on.
Stem ([0: numPlot - 1], z1 (1: numPlot), 'ro');
Hold off.
The axis ([0 numPlot 0.5 1.5]);
The title (' coherent demodulation signal after the original sequence comparison)
Z1=ddemod (y, Fc, Fd, Fs, FSK, M, df);
% with output waveform frequency shift keying demodulation coherent M yuan
Figure (4)
Stem ([0: numPlot - 1), x (1: numPlot), 'bx);
Hold on.
Stem ([0: numPlot - 1], z1 (1: numPlot), 'ro');
Hold off.
The axis ([0 numPlot 0.5 1.5]);
The title (' coherent demodulation signal after the original sequence comparison)
Legend (' the original input binary random sequence ', 'coherent signals after demodulation)
Xlabel (' Time ');
Ylabel (' Amplitude);

The % of noncoherent demodulation

Z2=ddemod (y, Fc, Fd, Fs, FSK/noncoh, M, df);

% with output waveform frequency shift keying demodulation incoherent M yuan
Figure (5)
Stem ([0: numPlot - 1), x (1: numPlot), 'bx);
Hold on.
Stem ([0: numPlot - 1], z2 (1: numPlot), 'ro');
Hold off.
The axis ([0 numPlot 0.5 1.5]);
The title (' incoherent signals after demodulation)
Legend (' the original input binary random sequence, 'after the noncoherent demodulation signal')
Xlabel (' Time ');
Ylabel (' Amplitude);

% ber statistics[~, ratioSym]=symerr (x, z1);
Figure (6)
Simbasebandex ([0:1:5]);
The title (' coherent demodulation error rate after statistics')
[~, ratioSym]=symerr (x, z2);
Figure (7)
Simbasebandex ([0:1:5]);
The title (' noncoherent demodulation error rate after statistics')

CodePudding user response:

The original poster hello

I can't found when running the program running,
Undefined simbasebandex tips

CodePudding user response:

Dmod function can also be used

CodePudding user response:

This dmod function the original poster can send it to me?
  • Related