# Channel Model

**URL:** <https://www.ruby-forum.com/t/channel-model/242889>\
**Category:** GNU Radio\
**Created:** [August 5, 2015, 1:27pm UTC](https://www.ruby-forum.com/t/channel-model/242889 "2015-08-05T13:27:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [August 5, 2015, 1:27pm UTC](https://www.ruby-forum.com/t/channel-model/242889/1 "2015-08-05T13:27:01Z")

</div>

Hii

I am using channels.channel\_model as

channels\_channel\_model\_0 = channels.channel\_model(  
noise\_voltage = self.EbN0\_to\_noise\_voltage(EbN0),  
frequency\_offset=0.0,  
epsilon=1.0,  
taps=(1.0 + 0j, ),  
noise\_seed=RAND\_SEED,  
block\_tags=True  
)

in the place of Add and Noise\_Source in berawgn.py file… But the BER is  
not following the theory curve. I am attaching the curve i got.

What does this channel model do ? Can someone please explain it.

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 5, 2015, 3:45pm UTC](https://www.ruby-forum.com/t/channel-model/242889/2 "2015-08-05T15:45:28Z")

</div>

On Wed, Aug 5, 2015 at 7:25 AM, monika bansal [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> block\_tags=True  
> )
> 
> in the place of Add and Noise\_Source in berawgn.py file.. But the BER is  
> not following the theory curve. I am attaching the curve i got.
> 
> What does this channel model do ? Can someone please explain it.

The channel\_model is a hierarchical block to add noise, frequency  
offset,  
timing offset, and a constant channel. In your case, you’ve turned off  
everything but the noise source, which is generated using a  
gr::analog::noise\_source\_c.

> **[GNU Radio Manual and C++ API Reference: gr::channels::channel\_model Class...](https://www.gnuradio.org/doc/doxygen/classgr_1_1channels_1_1channel__model.html)**

My guess is that you’re setting the noise voltage level incorrectly.

Tom

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 5, 2015, 9:52pm UTC](https://www.ruby-forum.com/t/channel-model/242889/3 "2015-08-05T21:52:55Z")

</div>

On 05.08.2015 04:25, monika bansal wrote:

> block\_tags=True  
> )

Try

noise\_voltage = self.EbN0\_to\_noise\_voltage(EbN0)/sqrt(2)

the original berawgn.py was already buggy, because it didn’t follow a  
recent change in the noise power. I’ve submitted a patch, but it  
probably won’t be merged before the release cycle is reset (cf  
[https://github.com/gnuradio/gnuradio/compare/master...mbr0wn:digital/berawgn\_fix\_noisepower?expand=1](https://github.com/gnuradio/gnuradio/compare/master...mbr0wn:digital/berawgn_fix_noisepower?expand=1)).

M

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 6, 2015, 6:48am UTC](https://www.ruby-forum.com/t/channel-model/242889/4 "2015-08-06T06:48:37Z")

</div>

Hii  
Thanks for your responses.

The problem is this channel model is eating some initial 6 bits(3 qpsk  
symbols) and last 10 bits(5 qpsk symbols).  
Because of this index of output symbol is different fron input which is  
resulting in error for all snr ranges.  
You can see the output for noise\_volage =0.0

Input = (0L, 0L, 2L, 3L, 1L, 2L, 1L, 1L, 2L, 3L, 0L, 1L, 0L, 1L, 1L,  
3L,  
2L, 3L, 1L, 0L, 2L, 0L, 3L, 2L, 2L, 1L, 3L, 2L, 3L, 0L, 2L, 2L, 0L, 1L,  
2L,  
3L, 3L, 0L, 2L, 2L, 0L, 2L, 3L, 3L, 2L, 2L, 3L, 0L, 0L, 0L, 1L, 0L, 2L,  
2L,  
2L, 0L, 3L, 0L, 1L, 1L, 3L, 0L, 1L, 3L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ug 6, 2015 at 2:34 AM, Johnathan C.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 6, 2015, 10:34am UTC](https://www.ruby-forum.com/t/channel-model/242889/5 "2015-08-06T10:34:41Z")

</div>

> How should i calculate the error now?  
> That pretty much depends on what /you/ want to measure – obviously,  
> these bits are lost, so practically, this increases your BER.  
> If you want to demonstrate asymptotic behaviour, however, then you could  
> just increase the length of your simulation until a few bits lost at  
> start and end just don’t matter anymore.

Greetings,  
Marcus

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 5, 2015, 11:05pm UTC](https://www.ruby-forum.com/t/channel-model/242889/6 "2015-08-05T23:05:57Z")

</div>

On Wed, Aug 5, 2015 at 12:51 PM, Martin B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> Try
> 
> noise\_voltage = self.EbN0\_to\_noise\_voltage(EbN0)/sqrt(2)
> 
> the original berawgn.py was already buggy, because it didn’t follow a  
> recent change in the noise power. I’ve submitted a patch, but it  
> probably won’t be merged before the release cycle is reset (cf

[https://github.com/gnuradio/gnuradio/compare/master...mbr0wn:digital/berawgn\_fix\_noisepower?expand=1](https://github.com/gnuradio/gnuradio/compare/master...mbr0wn:digital/berawgn_fix_noisepower?expand=1)

> ).

​This did get merged for 3.7.8 release.​

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 6, 2015, 11:16am UTC](https://www.ruby-forum.com/t/channel-model/242889/7 "2015-08-06T11:16:45Z")

</div>

Taking a blind guess here:  
How many samples do you simulate for Eb/N0 = 8dB? And for 10dB? And for  
12dB?

Best regards,  
Marcus

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 6, 2015, 11:32am UTC](https://www.ruby-forum.com/t/channel-model/242889/8 "2015-08-06T11:32:32Z")

</div>

160000 bits for all snr values.,…

On Thu, Aug 6, 2015 at 2:45 PM, Marcus Müller [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 6, 2015, 10:59am UTC](https://www.ruby-forum.com/t/channel-model/242889/9 "2015-08-06T10:59:48Z")

</div>

Yes Marcus…  
and i used delay block at the output of the demodulator to make output  
bits  
align with input bits.  
Now it is tracing the theoretical curve till 9 db but after that error  
is  
not reducing.

I am attaching the curve.  
Why is this happening ??

On Thu, Aug 6, 2015 at 2:03 PM, Marcus Müller [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 6, 2015, 11:39am UTC](https://www.ruby-forum.com/t/channel-model/242889/10 "2015-08-06T11:39:33Z")

</div>

-----BEGIN PGP SIGNED MESSAGE-----  
Hash: SHA1

As a rule of thumb with expected error rate BERe:

num simulation bits: (1 / BERe) \* 100  
that’s more like a minimum. It’s probably better to go for \* 1000.  
Also if you use BER block, it has a parameter ’ BER Min. Errors’. As  
long as it didn’t count at least this amount of errors it’ll not  
output anything.  
Depending on your code and your SNR 8-12dB I’d expect you need at  
least 1Gbit or in case of SNR=12dB more towards 100Gbit in order to  
obtain meaningful results.  
Hope that helps.

On 06.08.2015 11:31, monika bansal wrote:

> > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> > 
> > > Greetings, Marcus  
> > > output for noise\_volage =0.0  
> > > 0L, 1L, 2L, 3L, 3L, 0L, 2L, 2L, 0L, 2L, 3L, 3L, 2L, 2L, 3L, 0L,
> > > 
> > > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)\> wrote:
> > > 
> > > > > didn’t follow a recent change in the noise power. I’ve  
> > > > > submitted a patch, but it probably won’t be merged before  
> > > > > the release cycle is reset (cf
> > > > > 
> > > > > [https://github.com/gnuradio/gnuradio/compare/master...mbr0wn:digit](https://github.com/gnuradio/gnuradio/compare/master...mbr0wn:digit)  
> > > > > al/berawgn\_fix\_noisepower?expand=1

).

> > > > * * *
> > > > 
> > > > Discuss-gnuradio mailing list [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> > > > [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)
> > > 
> > > * * *
> > > 
> > > Discuss-gnuradio mailing  
> > > [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)://lists.gnu.org/mailman/listinfo/d  
> > > iscuss-gnuradio

* * *

> mailing list [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> [Discuss-gnuradio Info Page](https://lists.gnu.org/mailman/listinfo/discuss-gnuradio)

-----BEGIN PGP SIGNATURE-----  
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJVwyrLAAoJEO7fmkDsqywMumwQAJ9YXsjZrX051rtAp61Rrbdp  
PqsblRAqNAy2kXNGVX+Ag1B9BUnSqsIpSZVgYCvXqiPH8Cy9qAGFv3EkPPk80BN0  
O+4zzIFCovnPXHHnJB90ntyUUvHZlUd5TTDRn0RNzMSvI1ABg+ssk7pUYM424vvO  
wTMBA4yP41aCr7nbYDowpMd+GnzdC0nwpxpTVdEVX8yS8PlhECAv45/U2Ze/6CT2  
EcK3pUIZRTgZlWezrS1mqD5afGqNYPHz1WhPQx05Hx2OjyP2wNwPx9RA6VKhIosU  
iywpvz4zdpbaKFEpgTwB6h0w0+CeclnqmipSP+hPIkUmFa7kbQyzNjAn5WTYfQrd  
Ne+v2W9ztxQlbvihswVmHdrBxwk2/gDlL6pzBWy6zf2T0NfAJxlW/zcOQlVc+fEs  
tL5l0ZVNha0Ppam2I6jxKzINMDOm3Gln0h3F75FD9CpcTyHRKxV9a8Sg4BCi4jei  
+l6rnT4mhQk6RirDBOXUwWIXLbk28RLAWYNL8Jyn0n7M50ax7WMGXBS+yDUf/G1A  
mmiLAFm1ATZRHBN1Aw99DXkI/LN+qp10oUYkKRcx7Ji3z6Oc+CKIqE0r9QBck0qS  
z0JfxOG9N1z+iEgWJ/Ui4GZx85zHJVkmyHQs72QTecoFnhO1j/GWqeRRAyyWDTJ8  
zMsQVtreQnqYEPkSSQKK  
=rixl  
-----END PGP SIGNATURE-----

---

<div class="post-metadata">

**Author:** ![monika\_bansal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@monika\_bansal](https://www.ruby-forum.com/u/monika_bansal)\
**Post date:** [August 6, 2015, 11:58am UTC](https://www.ruby-forum.com/t/channel-model/242889/11 "2015-08-06T11:58:49Z")

</div>

Yes …  
Thanks !

On Thu, Aug 6, 2015 at 3:07 PM, Johannes D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
