CPFSK demodulator performance in MATLAB example with enabling modulation index

4 次查看(过去 30 天)
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