Effacer les filtres
Effacer les filtres

label dots with bits - Can someone help me?

1 vue (au cours des 30 derniers jours)
adriane duarte
adriane duarte le 27 Mai 2021
Commenté : adriane duarte le 30 Mai 2021
how do i label my points?
are complex points.
My code is as follows:
clear all;
close all;
clc;
L = 1e4; % Number of bits
SNRdB = 0:28;
SNR = 10.^(SNRdB/10);
r = 10.^(SNRdB/10);
alpha = 0.3;
max_run = 100;
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);
QPSK = x_inp_I + 1i .* x_inp_Q;
% 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);
% Outra forma de encontrar a equação
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
h = scatterplot(QPSK);
hold on
scatterplot(Bit_enviado,[],[],'r*',h)
I would like to label it with bits like the example below:
  3 commentaires
Adam Danz
Adam Danz le 27 Mai 2021
Where do the binary values come from? How are they related to the points?
adriane duarte
adriane duarte le 30 Mai 2021
the random bits are produced through the variables:x_inp_I,x_inp_Q,Bit_wat_I and Bit_wat_Q.
then I use it in an equation to reproduce my complex points.

Connectez-vous pour commenter.

Réponse acceptée

Image Analyst
Image Analyst le 27 Mai 2021
Did you try calling text()?
  4 commentaires
Image Analyst
Image Analyst le 28 Mai 2021
Modifié(e) : Image Analyst le 28 Mai 2021
So did you try the code in my comment above (click "Show older comments" link above to see it)?
I can't run your program because
'scatterplot' requires Communications Toolbox.
You forgot to add the Communications Toolbox to the product list when you posted so I'll add it now.
adriane duarte
adriane duarte le 30 Mai 2021
Modifié(e) : adriane duarte le 30 Mai 2021
Oi!!!
Eu testei seu código sim!
obrigado.
Você poderia me ajudar com outra pergunta? @Image Analyst

Connectez-vous pour commenter.

Plus de réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 27 Mai 2021
Modifié(e) : Sulaymon Eshkabilov le 27 Mai 2021
Hi,
(1) you need to create binary representation of your plotted points using dec2bin() for labels to display on the plot
(2) to put labels to all of your plotted points, you can employ this code written by Adam Danz
https://www.mathworks.com/matlabcentral/fileexchange/46891-labelpoints
  1 commentaire
adriane duarte
adriane duarte le 27 Mai 2021
i am not experienced in matlab but i will try

Connectez-vous pour commenter.

Catégories

En savoir plus sur Data Type Conversion dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by