How to plot colorful histogram type constellation diagram in Matlab
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I would like to plot constellation diagram similar to the figure below.
My approach is something like this
clc;
clear all;
close all;
N=30000;
M=16;
Sr=randint(N,1,[0,(M-1)]);
S=qammod(Sr,16,0,'gray'); S=S(:);
Noisy_Data=awgn(S,20,'measured'); % Add AWGN
figure(2)
subplot(1,2,1)
plot(S,'o','markersize',10);
grid on
subplot(1,2,2)
plot(Noisy_Data,'.');
grid on
May you assist me to make necessary modification to get graph similar to the figure attached above. Thank you
0 Commenti
Risposte (1)
emehmetcik
il 12 Dic 2015
You can use hist3 function. Here is an example for "Noisy_Data" in your code:
figure;
z = [real(Noisy_Data), imag(Noisy_Data)];
Mx = 100; % Number of grids in x axis
My = 100; % Number of grids in y axis
x = linspace(min(z(:, 1)), max(z(:, 1)), Mx);
y = linspace(min(z(:, 2)), max(z(:, 2)), My);
hz = hist3(z, [Mx, My]);
hz(hz==0) = nan;
pcolor(x, y, hz)
set(get(gca,'child'),'FaceColor','interp','CDataMode','auto');
view(2); shading flat
colormap(jet)
colorbar
0 Commenti
Vedere anche
Categorie
Scopri di più su Multirate Signal Processing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!