To Eric: for Octave users it's a right; for Matlab users it's a privilege.
To the OP: precisely what is hard decoding and what is soft decoding? In
which ways does soft decoding differ from hard?
If you are unsure, I suggest you to open a textbook (e.g. by Proakis)
and keep reading it until you are able to see what's wrong with your code.
Fortunately, even the best tools cannot substitute knowledge.
Gene
On 26.04.2017 1:06, eric.jacobsen@ieee.org wrote:
> I'm not sure; is decoding a right or a privilege?
>
>
> On Tue, 25 Apr 2017 12:11:42 -0500, "somedspguy" <120759@DSPRelated>
> wrote:
>
>> Having a hard time figuring out how to properly do soft decoding with
>> vitdec for bpsk. I tried using 'unquant' but my results are the same as
>> hard decision decoding.
>>
>> trellis = poly2trellis(4,[11 15]);
>> for i = 1:7
>> for q = 1:n_block
>>
>> %create coded message
>> code = convenc(msg(:,q),trellis);
>>
>> %convert to bpsk
>> code_bpsk = 2*code-1;
>>
>> %add noise
>> tx = code_bpsk' + sqrt(No(i)/2)*n;
>>
>> %hard decoding
>> rx_hard = tx > 0;
>>
>>
>> decode = vitdec(rx_hard,trellis,5*4,'trunc','hard');
>> decodesoft = vitdec(rx_hard,t2,5*4, 'trunc', 'soft',3);
>>
>>
>>
>> [num rt] = biterr(decode,msg(:,q)');
>> [numsoft rt2] = biterr(decodesoft,msg(:,q)');
>>
>> %soft
>> err_conv_soft(i) = err_conv_soft(i) + numsoft;
>>
>> %hard
>> err_conv(i) = err_conv(i) + num;
>>
>> end
>> err_conv(i) = err_conv(i)/(block_sz*n_block);
>> err_conv_soft(i) = err_conv_soft(i)/(block_sz*n_block);
>>
>> end
>>
>>
>>
>> ---------------------------------------
>> Posted through http://www.DSPRelated.com
>
>
> ---
> This email has been checked for viruses by Avast antivirus software.
> https://www.avast.com/antivirus
>
Reply by ●April 25, 20172017-04-25
I'm not sure; is decoding a right or a privilege?
On Tue, 25 Apr 2017 12:11:42 -0500, "somedspguy" <120759@DSPRelated>
wrote:
>Having a hard time figuring out how to properly do soft decoding with
>vitdec for bpsk. I tried using 'unquant' but my results are the same as
>hard decision decoding.
>
>trellis = poly2trellis(4,[11 15]);
>for i = 1:7
> for q = 1:n_block
>
>%create coded message
> code = convenc(msg(:,q),trellis);
>
>%convert to bpsk
> code_bpsk = 2*code-1;
>
>%add noise
> tx = code_bpsk' + sqrt(No(i)/2)*n;
>
>%hard decoding
> rx_hard = tx > 0;
>
>
> decode = vitdec(rx_hard,trellis,5*4,'trunc','hard');
> decodesoft = vitdec(rx_hard,t2,5*4, 'trunc', 'soft',3);
>
>
>
> [num rt] = biterr(decode,msg(:,q)');
> [numsoft rt2] = biterr(decodesoft,msg(:,q)');
>
> %soft
> err_conv_soft(i) = err_conv_soft(i) + numsoft;
>
> %hard
> err_conv(i) = err_conv(i) + num;
>
> end
> err_conv(i) = err_conv(i)/(block_sz*n_block);
> err_conv_soft(i) = err_conv_soft(i)/(block_sz*n_block);
>
>end
>
>
>
>---------------------------------------
>Posted through http://www.DSPRelated.com
Having a hard time figuring out how to properly do soft decoding with
vitdec for bpsk. I tried using 'unquant' but my results are the same as
hard decision decoding.
trellis = poly2trellis(4,[11 15]);
for i = 1:7
for q = 1:n_block
%create coded message
code = convenc(msg(:,q),trellis);
%convert to bpsk
code_bpsk = 2*code-1;
%add noise
tx = code_bpsk' + sqrt(No(i)/2)*n;
%hard decoding
rx_hard = tx > 0;
decode = vitdec(rx_hard,trellis,5*4,'trunc','hard');
decodesoft = vitdec(rx_hard,t2,5*4, 'trunc', 'soft',3);
[num rt] = biterr(decode,msg(:,q)');
[numsoft rt2] = biterr(decodesoft,msg(:,q)');
%soft
err_conv_soft(i) = err_conv_soft(i) + numsoft;
%hard
err_conv(i) = err_conv(i) + num;
end
err_conv(i) = err_conv(i)/(block_sz*n_block);
err_conv_soft(i) = err_conv_soft(i)/(block_sz*n_block);
end
---------------------------------------
Posted through http://www.DSPRelated.com