CPFSK demodulator performance in MATLAB example with enabling modulation index

조회 수: 7 (최근 30일)
Jay
Jay 2023년 10월 10일
댓글: Jay 2023년 12월 6일
I've been checking CPFSK performance against various modulation indices and SNR.
MATLAB has nice examples in comm.CPFSKModulator. Here is the example code with enabling "modulation index" property and few changes to creates the plot (Default "modulation index" is 0.5). From the result, I noticed that there are always high error rate with the "modulation index" other than 0.5 which doesn't seem CPFSK to be usable. Since I'm just copying the example code with modifying "modulation index" parameter, I'm wondering if this is real CPFSK performance or not.. Since different "modulation index" could be used, I have feeling that I made mistake in the code below but could not locate it. Or did I use the function incorrectly?
The attached plot shows error rates for different modulation indices and SNR and the code which generated the plot.
rng(1000);
M = 2; % In power of 2
h = [0.25 0.5 0.75 1.0];
snr = (-10:1:20);
Len_h = length(h);
Len_snr = length(snr);
ser = zeros(Len_h, Len_snr);
for ind_h = 1:Len_h
cpfskMod = comm.CPFSKModulator(...
M, ...
BitInput=true, ...
SymbolMapping="Binary", ...
ModulationIndex=h(ind_h));
for ind_snr = 1:Len_snr
awgnChan = comm.AWGNChannel( ...
NoiseMethod="Signal to noise ratio (SNR)", ...
SNR = snr(ind_snr));
cpfskDemod = comm.CPFSKDemodulator(...
M, ...
BitOutput=true, ...
SymbolMapping="Binary");
numFrames = 1000;
k = log2(M);
spf = 100;
delay = log2(M)*cpfskDemod.TracebackDepth;
errorRate = comm.ErrorRate(...
ReceiveDelay=delay);
for counter = 1:numFrames
data = randi([0 1], k*spf, 1);
modSignal = cpfskMod(data);
noisySignal = awgnChan(modSignal);
receivedData = cpfskDemod(noisySignal);
errorStats = errorRate(data, receivedData);
end
ser(ind_h, ind_snr) = errorStats(1);
end
end
for i=1:Len_h
semilogy(snr, ser(i, :), 'LineWidth',2);
hold on;
end
legend('h=0.25', 'h=0.5', 'h=0.75', 'h=1.0');
xlabel('SNR');
ylabel('Symbol Error Rate');
hold off;
grid on;

채택된 답변

Jay
Jay 2023년 10월 11일
This is self-answering - I found the reason why the error rates are strange other than "modulation index" of 0.5. CPFSKDemodulator also requires to have the "modulation index" parameter like in CPFSKModulator, so that Modulator and Demodulator have the same "modulation index". In my original code, I set CPFSKModulator with "modulation index" but not in CPFSKDemodulator which causes the strange SNR curves other than the modulation index of 0.5. After fixing this, I got fairely reasonable plots.
  댓글 수: 2
Fatima  Ismail
Fatima Ismail 2023년 12월 6일
I'm Working on CPFSK modulation and demodulation and stuck at many points in my code? Where can I find help for it
Jay
Jay 2023년 12월 6일
MATLAB has some of sample codes you might want to refer and play with, or you could ask here (MATLAB Answers) with your issues.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Modulation에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by