<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Hamming (7,4) code with hard decision decoding</title>
	<atom:link href="http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/</link>
	<description>Signal Processing for Communication</description>
	<lastBuildDate>Fri, 30 Jul 2010 01:36:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Krishna Sankar</title>
		<link>http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/#comment-31338</link>
		<dc:creator>Krishna Sankar</dc:creator>
		<pubDate>Mon, 14 Jun 2010 01:21:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/?p=789#comment-31338</guid>
		<description>@Pawelitel: The above code works as intended? Great. People who needs C code can take this :)</description>
		<content:encoded><![CDATA[<p>@Pawelitel: The above code works as intended? Great. People who needs C code can take this <img src='http://www.dsplog.com/db-install/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: waheed</title>
		<link>http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/#comment-31087</link>
		<dc:creator>waheed</dc:creator>
		<pubDate>Thu, 10 Jun 2010 16:39:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/?p=789#comment-31087</guid>
		<description>Hi ,

is any boduyhas workd or ca nhelp me  on Linear Block code (15 ,11) using Viterbi decoding ..i want to wrtie a matlab program for it but i am facing some problems in the long and complex trellis stucture ...please email to me if somebody can help..thanks</description>
		<content:encoded><![CDATA[<p>Hi ,</p>
<p>is any boduyhas workd or ca nhelp me  on Linear Block code (15 ,11) using Viterbi decoding ..i want to wrtie a matlab program for it but i am facing some problems in the long and complex trellis stucture &#8230;please email to me if somebody can help..thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pawelitel</title>
		<link>http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/#comment-31062</link>
		<dc:creator>Pawelitel</dc:creator>
		<pubDate>Thu, 10 Jun 2010 08:24:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/?p=789#comment-31062</guid>
		<description>//my implementation in c (not be severely)
//Hamming(7,4) code in BAWGN channel with Hard desigion
//The result is a table of EbNo vs BER
//all worked
//Powered by Pawelitel in 2010

#include 
#include 
#include 

//white gaussian noise
double wgn(void)
{
    float PI=3.14159265358;
    static  int  _sw = 0;
    static  double  _t, _u, _x;
    if ( _sw == 0 )
    {
        _sw = 1;
        _x = (1.0 / (RAND_MAX + 1.0)) * rand();
        while (!_x)_x = (1.0 / (RAND_MAX + 1.0)) * rand();
        _t  = sqrt(-2 * log(_x));
        _u  = 2.0 * PI * ((1.0 / (RAND_MAX + 1.0)) * rand());
        return _t*cos(_u);
    }
    else
    {
        _sw = 0;
        return _t*sin(_u);
    }
}

int main(int argc, char **argv) {

    const int Hamming74EncodeTable[16] = {0 ,14 ,21 ,27 ,35 ,45 ,54 ,56 ,71 ,73 ,82 ,92 ,100 ,106 ,113 ,127};
    const int Hamming74DecodeTable[128] = {0 ,0 ,0 ,4 ,0 ,2 ,1 ,8 ,0 ,9 ,1 ,3 ,1 ,5 ,1 ,1 ,0 ,2 ,10 ,3 ,2 ,2 ,6 ,2 ,7 ,3 ,3 ,3 ,11 ,2 ,1 ,3 ,0 ,4 ,4 ,4 ,12 ,5 ,6 ,4 ,7 ,5 ,13 ,4 ,5 ,5 ,1 ,5 ,7 ,14 ,6 ,4 ,6 ,2 ,6 ,6 ,7 ,7 ,7 ,3 ,7 ,5 ,6 ,15 ,0 ,9 ,10 ,8 ,12 ,8 ,8 ,8 ,9 ,9 ,13 ,9 ,11 ,9 ,1 ,8 ,10 ,14 ,10 ,10 ,11 ,2 ,10 ,8 ,11 ,9 ,10 ,3 ,11 ,11 ,11 ,15 ,12 ,14 ,13 ,4 ,12 ,12 ,12 ,8 ,13 ,9 ,13 ,13 ,12 ,5 ,13 ,15 ,14 ,14 ,10 ,14 ,12 ,14 ,6 ,15 ,7 ,14 ,13 ,15 ,11 ,15 ,15 ,15};

    float count=pow(10,6);//number of tests
    float countfrom=0,countto=count, countstep=1,c=0;
    float noiseRootMeanSquare;
    float S=1,//signal level
            SNR,//energy per signal
            EbNo,//energy per bit
            simBER=-11.0;
    int i,j,l,nErr=0,errorBits,s;
    float fin;
    const int numberOfBits=4;
    const int numberOfCodedBits=7;
    int inUncoded,inCoded,outUncoded,outCoded;
    float syndroms[numberOfCodedBits];

    ///compute BER
    for ( c=countfrom; c&lt;countto; c+=countstep)
    {
        SNR=11-c/10.;///SNR from 11dB down with step 1/10 dB
        noiseRootMeanSquare=pow(10,-SNR/20.);
        EbNo=simBER=nErr=0;
        for ( i=0; i&lt;count; i++ )
        {
            inUncoded=rand()%16;
            inCoded=Hamming74EncodeTable[inUncoded];

            outCoded=0;
            for ( j = 0; j &lt; numberOfCodedBits; j++ )
            {
                s=(inCoded&amp;(1&lt;0;/// 0 или 1
                syndroms[j]=2*s-1+1/sqrt(2)*noiseRootMeanSquare*wgn();///BAWGN
                outCoded ^=(syndroms[j]&gt;0)&lt;&lt;j;//hard decision
            }
            outUncoded=Hamming74DecodeTable[outCoded];

            errorBits= inUncoded ^ outUncoded;
            if (errorBits)
                for ( l=0; l&lt;numberOfBits; l++ )
                    if (errorBits&amp;(1&lt;&lt;l))
                        nErr++;
        }
        SNR = 20*(log10(S/noiseRootMeanSquare));
        EbNo = SNR - 10*log10(numberOfBits/float(numberOfCodedBits));
        printf(&quot;%f &quot;,EbNo);
        simBER=log10(nErr/float(count*numberOfBits));
        printf(&quot;%f\n&quot;,simBER);

        if (EbNo&lt;0)break;
    }
    return 0;
}</description>
		<content:encoded><![CDATA[<p>//my implementation in c (not be severely)<br />
//Hamming(7,4) code in BAWGN channel with Hard desigion<br />
//The result is a table of EbNo vs BER<br />
//all worked<br />
//Powered by Pawelitel in 2010</p>
<p>#include<br />
#include<br />
#include </p>
<p>//white gaussian noise<br />
double wgn(void)<br />
{<br />
    float PI=3.14159265358;<br />
    static  int  _sw = 0;<br />
    static  double  _t, _u, _x;<br />
    if ( _sw == 0 )<br />
    {<br />
        _sw = 1;<br />
        _x = (1.0 / (RAND_MAX + 1.0)) * rand();<br />
        while (!_x)_x = (1.0 / (RAND_MAX + 1.0)) * rand();<br />
        _t  = sqrt(-2 * log(_x));<br />
        _u  = 2.0 * PI * ((1.0 / (RAND_MAX + 1.0)) * rand());<br />
        return _t*cos(_u);<br />
    }<br />
    else<br />
    {<br />
        _sw = 0;<br />
        return _t*sin(_u);<br />
    }<br />
}</p>
<p>int main(int argc, char **argv) {</p>
<p>    const int Hamming74EncodeTable[16] = {0 ,14 ,21 ,27 ,35 ,45 ,54 ,56 ,71 ,73 ,82 ,92 ,100 ,106 ,113 ,127};<br />
    const int Hamming74DecodeTable[128] = {0 ,0 ,0 ,4 ,0 ,2 ,1 ,8 ,0 ,9 ,1 ,3 ,1 ,5 ,1 ,1 ,0 ,2 ,10 ,3 ,2 ,2 ,6 ,2 ,7 ,3 ,3 ,3 ,11 ,2 ,1 ,3 ,0 ,4 ,4 ,4 ,12 ,5 ,6 ,4 ,7 ,5 ,13 ,4 ,5 ,5 ,1 ,5 ,7 ,14 ,6 ,4 ,6 ,2 ,6 ,6 ,7 ,7 ,7 ,3 ,7 ,5 ,6 ,15 ,0 ,9 ,10 ,8 ,12 ,8 ,8 ,8 ,9 ,9 ,13 ,9 ,11 ,9 ,1 ,8 ,10 ,14 ,10 ,10 ,11 ,2 ,10 ,8 ,11 ,9 ,10 ,3 ,11 ,11 ,11 ,15 ,12 ,14 ,13 ,4 ,12 ,12 ,12 ,8 ,13 ,9 ,13 ,13 ,12 ,5 ,13 ,15 ,14 ,14 ,10 ,14 ,12 ,14 ,6 ,15 ,7 ,14 ,13 ,15 ,11 ,15 ,15 ,15};</p>
<p>    float count=pow(10,6);//number of tests<br />
    float countfrom=0,countto=count, countstep=1,c=0;<br />
    float noiseRootMeanSquare;<br />
    float S=1,//signal level<br />
            SNR,//energy per signal<br />
            EbNo,//energy per bit<br />
            simBER=-11.0;<br />
    int i,j,l,nErr=0,errorBits,s;<br />
    float fin;<br />
    const int numberOfBits=4;<br />
    const int numberOfCodedBits=7;<br />
    int inUncoded,inCoded,outUncoded,outCoded;<br />
    float syndroms[numberOfCodedBits];</p>
<p>    ///compute BER<br />
    for ( c=countfrom; c&lt;countto; c+=countstep)<br />
    {<br />
        SNR=11-c/10.;///SNR from 11dB down with step 1/10 dB<br />
        noiseRootMeanSquare=pow(10,-SNR/20.);<br />
        EbNo=simBER=nErr=0;<br />
        for ( i=0; i&lt;count; i++ )<br />
        {<br />
            inUncoded=rand()%16;<br />
            inCoded=Hamming74EncodeTable[inUncoded];</p>
<p>            outCoded=0;<br />
            for ( j = 0; j &lt; numberOfCodedBits; j++ )<br />
            {<br />
                s=(inCoded&amp;(1&lt;0;/// 0 или 1<br />
                syndroms[j]=2*s-1+1/sqrt(2)*noiseRootMeanSquare*wgn();///BAWGN<br />
                outCoded ^=(syndroms[j]&gt;0)&lt;&lt;j;//hard decision<br />
            }<br />
            outUncoded=Hamming74DecodeTable[outCoded];</p>
<p>            errorBits= inUncoded ^ outUncoded;<br />
            if (errorBits)<br />
                for ( l=0; l&lt;numberOfBits; l++ )<br />
                    if (errorBits&amp;(1&lt;&lt;l))<br />
                        nErr++;<br />
        }<br />
        SNR = 20*(log10(S/noiseRootMeanSquare));<br />
        EbNo = SNR &#8211; 10*log10(numberOfBits/float(numberOfCodedBits));<br />
        printf(&quot;%f &quot;,EbNo);<br />
        simBER=log10(nErr/float(count*numberOfBits));<br />
        printf(&quot;%f\n&quot;,simBER);</p>
<p>        if (EbNo&lt;0)break;<br />
    }<br />
    return 0;<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mira</title>
		<link>http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/#comment-18340</link>
		<dc:creator>mira</dc:creator>
		<pubDate>Thu, 21 Jan 2010 07:18:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/?p=789#comment-18340</guid>
		<description>Mr. Krishna , 
always thank you for very helpful posts. sorry for question not related to post. i am new in this field,especially in mathlab. so t is the best way to learn writing code in Mathlab.  if you have any sugesstion? any suggestion will be appreciated.
thanks you</description>
		<content:encoded><![CDATA[<p>Mr. Krishna ,<br />
always thank you for very helpful posts. sorry for question not related to post. i am new in this field,especially in mathlab. so t is the best way to learn writing code in Mathlab.  if you have any sugesstion? any suggestion will be appreciated.<br />
thanks you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna Sankar</title>
		<link>http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/#comment-17313</link>
		<dc:creator>Krishna Sankar</dc:creator>
		<pubDate>Tue, 22 Dec 2009 00:50:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/?p=789#comment-17313</guid>
		<description>@victor: Well, that should be simple. 
You can group two coded bits into a QPSK, add awgn noise, demap into bits, then hamming decode
You can use this code as reference for qpsk mapping and demapping
http://www.dsplog.com/2007/11/06/symbol-error-rate-for-4-qam/</description>
		<content:encoded><![CDATA[<p>@victor: Well, that should be simple.<br />
You can group two coded bits into a QPSK, add awgn noise, demap into bits, then hamming decode<br />
You can use this code as reference for qpsk mapping and demapping<br />
<a href="http://www.dsplog.com/2007/11/06/symbol-error-rate-for-4-qam/" rel="nofollow">http://www.dsplog.com/2007/11/06/symbol-error-rate-for-4-qam/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: victor</title>
		<link>http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/#comment-17094</link>
		<dc:creator>victor</dc:creator>
		<pubDate>Tue, 15 Dec 2009 08:19:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/?p=789#comment-17094</guid>
		<description>Hi Krishna,
      I would like to Hamming code (7,4) into qpsk modulation and demodulation system?  what should I do?   thanks.</description>
		<content:encoded><![CDATA[<p>Hi Krishna,<br />
      I would like to Hamming code (7,4) into qpsk modulation and demodulation system?  what should I do?   thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna Sankar</title>
		<link>http://www.dsplog.com/2009/09/29/hamming-74-code-with-hard-decision-decoding/#comment-16940</link>
		<dc:creator>Krishna Sankar</dc:creator>
		<pubDate>Fri, 11 Dec 2009 01:15:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/?p=789#comment-16940</guid>
		<description>@thilini: Hopefully, this post discuss all the details which you require. Good luck.</description>
		<content:encoded><![CDATA[<p>@thilini: Hopefully, this post discuss all the details which you require. Good luck.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
