示例#1
0
    def do(self, nb_tx, nb_rx):
        def check(chan):
            assert_equal(chan.noises, None,
                         err_msg='Default noises is not None')
            assert_equal(chan.channel_gains, None,
                         err_msg='Default channel gains is not None')
            assert_equal(chan.unnoisy_output, None,
                         err_msg='Default unnoisy output is not None')

        chan = MIMOFlatChannel(nb_tx, nb_rx)

        # Test output state before any propagation
        check(chan)

        # Test that noise standard deviation must be set before propagation
        with assert_raises(AssertionError):
            chan.propagate(array((1, 1)))

        # Test output state before any propagation
        check(chan)
示例#2
0
    def do(self, nb_tx, nb_rx):
        def check(chan):
            assert_equal(chan.noises, None,
                         err_msg='Default noises is not None')
            assert_equal(chan.channel_gains, None,
                         err_msg='Default channel gains is not None')
            assert_equal(chan.unnoisy_output, None,
                         err_msg='Default unnoisy output is not None')

        chan = MIMOFlatChannel(nb_tx, nb_rx)

        # Test output state before any propagation
        check(chan)

        # Test that noise standard deviation must be set before propagation
        with assert_raises(AssertionError):
            chan.propagate(array((1, 1)))

        # Test output state before any propagation
        check(chan)
示例#3
0
    def do(self, nb_tx, nb_rx):
        # Without padding
        chan = MIMOFlatChannel(nb_tx, nb_rx, 0)
        out = chan.propagate(ones(nb_tx * 2))
        assert_array_equal(chan.channel_gains.shape, (2, nb_rx, nb_tx),
                           err_msg='Wrong channel shape without padding')
        assert_array_equal(chan.noises.shape, (2, nb_rx),
                           err_msg='Wrong channel shape without padding')
        assert_array_equal(chan.unnoisy_output.shape, (2, nb_rx),
                           err_msg='Wrong channel shape without padding')
        assert_array_equal(out.shape, (2, nb_rx),
                           err_msg='Wrong channel shape without padding')

        # With padding
        chan = MIMOFlatChannel(nb_tx, nb_rx, 0)
        out = chan.propagate(ones(nb_tx * 2 + 1))
        assert_array_equal(chan.channel_gains.shape, (3, nb_rx, nb_tx),
                           err_msg='Wrong channel shape with padding')
        assert_array_equal(chan.noises.shape, (3, nb_rx),
                           err_msg='Wrong channel shape with padding')
        assert_array_equal(chan.unnoisy_output.shape, (3, nb_rx),
                           err_msg='Wrong channel shape with padding')
        assert_array_equal(out.shape, (3, nb_rx),
                           err_msg='Wrong channel shape with padding')
示例#4
0
    def do(self, nb_tx, nb_rx):
        # Without padding
        chan = MIMOFlatChannel(nb_tx, nb_rx, 0)
        out = chan.propagate(ones(nb_tx * 2))
        assert_array_equal(chan.channel_gains.shape, (2, nb_rx, nb_tx),
                           err_msg='Wrong channel shape without padding')
        assert_array_equal(chan.noises.shape, (2, nb_rx),
                           err_msg='Wrong channel shape without padding')
        assert_array_equal(chan.unnoisy_output.shape, (2, nb_rx),
                           err_msg='Wrong channel shape without padding')
        assert_array_equal(out.shape, (2, nb_rx),
                           err_msg='Wrong channel shape without padding')

        # With padding
        chan = MIMOFlatChannel(nb_tx, nb_rx, 0)
        out = chan.propagate(ones(nb_tx * 2 + 1))
        assert_array_equal(chan.channel_gains.shape, (3, nb_rx, nb_tx),
                           err_msg='Wrong channel shape with padding')
        assert_array_equal(chan.noises.shape, (3, nb_rx),
                           err_msg='Wrong channel shape with padding')
        assert_array_equal(chan.unnoisy_output.shape, (3, nb_rx),
                           err_msg='Wrong channel shape with padding')
        assert_array_equal(out.shape, (3, nb_rx),
                           err_msg='Wrong channel shape with padding')
示例#5
0
 def do(self, nb_tx, nb_rx):
     chan = MIMOFlatChannel(nb_tx, nb_rx, 0)
     with assert_raises(TypeError):
         chan.propagate(array((1, 1j)))
示例#6
0
 def do(self, nb_tx, nb_rx):
     chan = MIMOFlatChannel(nb_tx, nb_rx, 0)
     with assert_raises(TypeError):
         chan.propagate(array((1, 1j)))