where is the wrong this code!
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
where is the wrong in this code.i can't run this code
clear; clc;
% Modulation schemes to compare
modulations = {'BPSK', 'QPSK', '8-PSK', '16-QAM', '64-QAM'};
% Transmit power and data rate
P_t = 0.1; % W
R = 100e6; % bps
% Extinction coefficient
c = 0.15; % m^-1
% PIN PD parameters
eta = 0.82;
fc = 300e6; % Hz
% Rx parameters
d = 0.2; % m
f = 0.25; % m
fov = 0.69;
% BER calculation
for i = 1:length(modulations)
modulation = modulations{i};
% Assume ideal receiver for simplicity
[~, ber(i)] = berawgn(modulation, R, P_t);
end
% Plot BER results
semilogy(1:length(modulations), ber, '-o');
xlabel('Modulation');
ylabel('BER');
xticks(1:length(modulations));
xticklabels(modulations);
grid on;
0 comentarios
Respuestas (1)
Cris LaPierre
el 30 de En. de 2023
The first input to berawgn must be a scalar or vector. Your first input is a character vector that seems to what is expected as the second input (modtype).
The first input argument, EbNo, is the ratio of bit energy to noise power spectral density in dB (Eb/N0).
Consult the documentation to be sure you are supplying the inputs the function expects.
0 comentarios
Ver también
Categorías
Más información sobre PHY Components en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!