1) Input mod 1 , mod 2 , , mod N ; N is the number of modulations

2) Input s i g i ; 1 i q

3) mod = { mod 1 , mod 2 , , mod N }

4) Acquire f j ; 1 j 13 for s i g i and f e a t 13 = { f 1 , f 2 , , f 13 } ; ( f j is signal feature).

5) Choose three random elements of f e a t 13 and assign them to s i g i .

s i g i = [ f t , f h , f p ] ; t , h , p { 1 , 2 , , 13 }

6) Plot s i g i = [ f t , f h , f p ] in 3D

7) Apply k-means clustering (k=N) for s i g i ; 1 i q

8) [ s i g i ] is i t h cluster and assume I i = c a r d ( [ s i g i ] )

9) c n = c e n t e r [ s i g n ] ; 1 n N

10) d n = 1 I i i = 1 I i | s i g i C n | ; s i g i [ s i g n ]

11) Receive s i g i + 1 and do stage 4 to 6 then continue.

12) d ( i + 1 , n ) = { | s i g i + 1 c n | , 1 n N } and T = { d ( i + 1 , 1 ) , , d ( i + 1 , N ) }

13) T m = min { d ( i + 1 , n ) , 1 n N } , there exist m , 1 m N such that T m d ( i + 1 , m )

14) T m = { d ( i + 1 , n ) | 1 n N , n m } ; while d ( i + 1 , m ) is omitted.

15) If d ( i + 1 , m ) d m thus s i g i + 1 [ s i g m ] then go to stage 28.

16) Else compute the average power of m t h cluster ( P m ) and P i + 1 as the power of s i g i + 1 .

17) If P i + 1 P m thus s i g i + 1 [ s i g m ] then go to stage 28.

18) Else Calculate the average SNAR of cluster m,

S N A R m = 1 I m i = 2 I m μ s i g ( i 1 ) m + μ s i g i m σ s i g ( i 1 ) m + σ s i g i m

μ s i g ( i 1 ) m is the Mean and σ s i g ( i 1 ) m is the Standard Deviation of ( i 1 ) t h signal from cluster m respectively.

19) Compute the average SNAR of s i g i + 1 ,

S N A R ( i + 1 , m ) = 1 I m i = 1 I m μ s i g i + 1 + μ s i g ( i + 1 , m ) σ s i g i + 1 + σ s i g ( i + 1 , m )

20) If S N A R ( i + 1 , m ) S N A R m thus s i g i + 1 [ s i g m ] then go to stage 28.

21) Else calculate the average BER of cluster m,

B E R m = 1 I m i = 2 I m 0.5 × e r f c ( s q r t ( 10 ^ ( μ s i g ( i 1 ) m + μ s i g i m 20 ( σ s i g ( i 1 ) m + σ s i g i m ) ) ) )

22) B E R ( i + 1 , m ) = 1 I m i = 1 I m 0.5 × e r f c ( s q r t ( 10 ^ ( μ s i g i + 1 + μ s i g ( i + 1 ) m 20 ( σ s i g i + 1 + σ s i g ( i + 1 ) m ) ) ) )

23) If B E R ( i + 1 , m ) B E R m thus s i g i + 1 [ s i g m ] then go to stage 28.

24) Else T m = min ( T m ) = min { d ( i + 1 , n ) | 1 n N , n m } , there exist 1 m N 1 such that T m = d ( i + 1 , m )

25) If T m = ϕ then go to stage 27.

26) Else go to stage 15.

27) Announce s i g i + 1 is a malicious user.

28) Input another signal s i g i + 1 = SIG go to stage 11.