QAM64Demod.m
上传用户:xinxin4122
上传日期:2013-04-03
资源大小:464k
文件大小:1k
- function bits = QAM64Demod(rx_symbols)
- soft_bits = zeros(1,6*length(rx_symbols)); % Each symbol consists of 6 bits
- bit0 = real(rx_symbols);
- bit3 = imag(rx_symbols);
- bit1 = 4/sqrt(42)-abs(real(rx_symbols));
- bit4 = 4/sqrt(42)-abs(imag(rx_symbols));
- for m=1:length(rx_symbols)
-
- if abs(4/sqrt(42)-abs(real(rx_symbols(m)))) <= 2/sqrt(42) % bit is one
- bit2(m) = 2/sqrt(42) - abs(4/sqrt(42)-abs(real(rx_symbols(m))));
- elseif abs(real(rx_symbols(m))) <= 2/sqrt(42) % bit is zero, close to real axis
- bit2(m) = -2/sqrt(42) + abs(real(rx_symbols(m)));
- else
- bit2(m) = 6/sqrt(42)-abs(real(rx_symbols(m))); % bit is zero
- end;
-
- if abs(4/sqrt(42)-abs(imag(rx_symbols(m)))) <= 2/sqrt(42) % bit is one
- bit5(m) = 2/sqrt(42) - abs(4/sqrt(42)-abs(imag(rx_symbols(m))));
- elseif abs(imag(rx_symbols(m))) <= 2/sqrt(42) % bit is zero, close to real axis
- bit5(m) = -2/sqrt(42) + abs(imag(rx_symbols(m)));
- else
- bit5(m) = 6/sqrt(42)-abs(imag(rx_symbols(m)));
- end;
- end;
- soft_bits(1:6:end) = bit0;
- soft_bits(2:6:end) = bit1;
- soft_bits(3:6:end) = bit2;
- soft_bits(4:6:end) = bit3;
- soft_bits(5:6:end) = bit4;
- soft_bits(6:6:end) = bit5;
- bits=soft_bits>0;