Can someone help me? - Plotting complex number with index

1 vue (au cours des 30 derniers jours)
adriane duarte
adriane duarte le 26 Mai 2021
I plotted complex numbers as follows:
and I got some complex numbers, like for example:
result plot:
how do I put the corresponding bit values (1000,1100, ...) according to the example below???
Can someone help me?

Réponse acceptée

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 27 Mai 2021
Hi,
Here is the answer to convert imaginary and real numbers from a floating point format into binary:
N = 16; % Number bits for integer part:
M = 25; % Number bits for fraction part:
% Conversion from floating point format into binary number
%% REAL Part:
for ii=1:numel(q_real)
BIN1(ii,:) = fix(rem(q_real(ii)*pow2(-(N-1):M),2));
% Test the inverse transformation
DEC1(ii) = BIN1(ii,:)*pow2(n-1:-1:-m).';
end
%% IMAG Part:
for ii=1:numel(q_imag)
BIN2(ii,:) = fix(rem(q_imag(ii)*pow2(-(N-1):M),2));
% Test the inverse transformation
DEC2(ii) = BIN2(ii,:)*pow2(n-1:-1:-m).';
end
Good luck.
  2 commentaires
adriane duarte
adriane duarte le 27 Mai 2021
Thanks!!
Sulaymon Eshkabilov
Sulaymon Eshkabilov le 27 Mai 2021
Most Welcome!

Connectez-vous pour commenter.

Plus de réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 26 Mai 2021
  4 commentaires
adriane duarte
adriane duarte le 26 Mai 2021
Modifié(e) : adriane duarte le 26 Mai 2021
L = 1e4; % number of bits
SNRdB = 0:28;
max_run = 100;
alpha = 0.3;
for sk = 1:length(SNRdB)
for tk = 1:max_run
% 1 ou -1 para sinal em fase (an)
x_inp_I = sign(rand(1,L)- 0.5);
% 1 ou -1 para sinal de quadratura (bn)
x_inp_Q = sign(rand(1,L)- 0.5);
% Gera bits de marca d'água aleatórios (dI)
Bit_wat_I = sign(rand(1,L)- 0.5);
% Gera bits de marca d'água aleatórios (dQ)
Bit_wat_Q = sign(rand(1,L)- 0.5);
for k = 1:L
if Bit_wat_I(k) == 1 && Bit_wat_Q(k) == 1
Bit_enviado(k) = (x_inp_I(k) .* ((sqrt(1-alpha)) + (sqrt(alpha)))) + (1i .* x_inp_Q(k) * ((sqrt(1-alpha)) + (sqrt(alpha))));
end
end
end
end
q_real = real(Bit_enviado);
q_imag = imag(Bit_enviado);

Connectez-vous pour commenter.

Catégories

En savoir plus sur Blue dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by