Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Bit Error Rate High Values

조회 수: 1 (최근 30일)
Kawther
Kawther 2014년 12월 1일
마감: MATLAB Answer Bot 2021년 8월 20일
Dear All,
I am using this code to find the bit error rate for the Kmeans clustering algorithm for receving a QPSK modulated data. Running the code high BER values are obtained (something more than 80). Can anyone help me with that ASAP.
clear all
clc
T=[ 2+2*i 2-2*i -2+2*i -2-2*i];
A=randn(150,2)+2*ones(150,2); C=randn(150,2)-2*ones(150,2);
B=randn(150,2)+2*ones(150,2); F=randn(150,2)-2*ones(150,2);
D=randn(150,2)+2*ones(150,2); G=randn(150,2)-2*ones(150,2);
E=randn(150,2)+2*ones(150,2); H=randn(150,2)-2*ones(150,2);
X = [A; B; D; C; F; E; G; H];
for k=1:5
[idx, centroids] = kmeans(X, k, 'Replicates', 20);
x = X(:,1);
y = X(:,2);
BER=[];
for nn=1:4
ber=0;
gt = zeros(1,4);
for idx = 1 : 4
[dummy,gt(idx)] = min(sum(bsxfun(@minus, [real(T(idx)), imag(T(idx))],...
centroids).^2, 2));
end
randn('seed',123);
rand_ind = randi(4, 10, 1);
test_sequence = T(rand_ind);
gt_labels = gt(rand_ind);
x = real(test_sequence).*(nn*randn(1, 10));
y = imag(test_sequence).*(nn*randn(1, 10));
labels = zeros(1, 10);
for idx = 1 : 10
[dummy,labels(idx)] = min(sum(bsxfun(@minus, [x(idx), y(idx)],...
centroids).^2, 2));
end
ber = sum(labels ~= gt_labels) / 10 * 100;
BER=[BER ber];
end
plot(nn,BER)
end
Thank you very much. Kawther

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by