Skip to content

Commit 3dd07ae

Browse files
committed
Adding tests for non-unitary QAM modulation
1 parent 84f580b commit 3dd07ae

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/test_bitMapping.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ println("Tests for symbol mapper with QAM sequences");
2626
buff = [0x01 0x00 0x00 0x00 0x00 0x01 0x01 0x01 ];
2727
@show bitMappingQAM(2,buff)
2828
@test all(bitMappingQAM(2,buff) .≈ [1; -1; -1; -1; -1; 1; 1; 1]);
29+
@test all(bitMappingQAM(2,buff;unitaryPower=false) .≈ [1; -1; -1; -1; -1; 1; 1; 1]);
2930
end
3031

3132
@testset "qpsk" begin
@@ -44,6 +45,7 @@ end
4445
# Some manual check due to gray coding
4546
buff = [0x01 0x00 0x00 0x00 0x00 0x01 0x01 0x01 ];
4647
@test all(bitMappingQAM(4,buff) .≈ 1/sqrt(2)*[1-1im; -1-1im; -1+1im; 1+1im]);
48+
@test all(bitMappingQAM(4,buff;unitaryPower=false) .== [1-1im; -1-1im; -1+1im; 1+1im]);
4749
end
4850

4951

@@ -62,6 +64,7 @@ end
6264
# Some manual check due to gray coding
6365
buff = [0x01 0x00 0x00 0x00 0x00 0x01 0x01 0x01 ];
6466
@test all(bitMappingQAM(mcs,buff) .≈ 1/sqrt(10)*[-3+3im;1-1im]);
67+
@test all(bitMappingQAM(mcs,buff;unitaryPower=false) .== [-3+3im;1-1im]);
6568
end
6669

6770

@@ -80,6 +83,7 @@ end
8083
# Some manual check due to gray coding
8184
buff = [0x01 0x00 0x00 0x00 0x00 0x01 0x01 0x01 0x01 0x00 0x01 0x00];
8285
@test all(bitMappingQAM(mcs,buff) .≈ 1/sqrt(42)*[-7+5im;-3-7im]);
86+
@test all(bitMappingQAM(mcs,buff;unitaryPower=false) .== [-7+5im;-3-7im]);
8387
end
8488

8589

@@ -100,4 +104,5 @@ end
100104
# Some manual check due to gray coding
101105
buff = [0x01 0x00 0x00 0x00 0x00 0x01 0x01 0x01 0x01 0x00 0x01 0x00 0x01 0x01 0x00 0x00];
102106
@test all(bitMappingQAM(mcs,buff) .≈ 1/sqrt(170)*[3-5im;9-7im]);
107+
@test all(bitMappingQAM(mcs,buff,unitaryPower=false) .== [3-5im;9-7im]);
103108
end

0 commit comments

Comments
 (0)