Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Bit Error Rate High Values
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (0개)
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!