ese499 engineering capstone project

31
Sniper Localization Using Acoustic Sensors ESE 499 Final Report Brian Carpenter, Drew Lanning, Marie Swarzenski Systems Science and Engineering, Class of 2014 Faculty Advisor: Dr. Arye Nehorai Preston M. Green Department of Electrical and Systems Engineering Washington University in St. Louis [email protected] Spring 2014

Upload: brian-carpenter

Post on 10-Feb-2017

71 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: ESE499 Engineering Capstone Project

                       

Sniper  Localization  Using  Acoustic  Sensors  ESE  499  Final  Report    Brian  Carpenter,  Drew  Lanning,  Marie  Swarzenski  Systems  Science  and  Engineering,  Class  of  2014    Faculty  Advisor:  Dr.  Arye  Nehorai    Preston  M.  Green  Department  of  Electrical  and  Systems  Engineering  Washington  University  in  St.  Louis  [email protected]      

Spring   2014  

08  Fall  

Page 2: ESE499 Engineering Capstone Project

  2  

Table  of  Contents      Abstract    .................................................................................................................................................  3  

Introduction    .........................................................................................................................................  4  

Signal  Model    .........................................................................................................................................  5                                          Time  of  Arrival    ........................................................................................................................................  5                                          Time  Difference  of  Arrival    .................................................................................................................  5                      Model    .................................................................................................................................................  6  

Estimation    ............................................................................................................................................  6                      Maximum  Likelihood  Estimation    .........................................................................................................  7                      Mean  Square  Error    ......................................................................................................................................  8                      Implementation    ..............................................................................................................................  9  

Results    ......................................................................................................................................................  10                      Sensor  Network  Setup    .................................................................................................................  10                      Parameter  Variation  for  Single  Line  Sensor  Setup    ..............................................................  13                      Noise  Level  Analysis    ....................................................................................................................  16                                          Cramér-­‐Rao  Bound    ............................................................................................................................  16                                          Signal-­‐to-­‐Noise  Ratio    ..................................................................................................  17  

Detection    .................................................................................................................................................  18                      Neyman-­‐Pearson  Lemma    ...........................................................................................................  19                      Power  Analysis    ..............................................................................................................................  20  

Conclusion    ..............................................................................................................................................  22  

References    ..............................................................................................................................................  23  

Appendix  A    .........................................................................................................................................  25  

Appendix  B    .........................................................................................................................................  28  

Appendix  C    ..........................................................................................................................................  30  

 

Page 3: ESE499 Engineering Capstone Project

  3  

Abstract    Sniper  localization  can  be  broken  down  into  two  distinct  subcategories  –  estimation,  

that  is  determining  the  origin  of  gunfire,  and  detection  –  that  is  determining  whether  the  

detected  signal  is  sniper  fire  or  noise.  Both  problems  rely  primarily  on  acoustic  signals  

from  a  gunshot,  which  can  be  detected  and  time-­‐stamped  by  acoustic  sensor  nodes.  These  

measurements  can  then  be  exploited  to  estimate  where  the  shot  was  fired  from.  In  this  

project,  we  used  MATLAB  to  generate  sample  time  of  arrival  measurements  of  the  muzzle  

blast  signal,  which  we  used  to  calculate  time  difference  of  arrival  (TDOA)  between  sensors.  

Using  a  model  based  on  TDOA  data,  we  were  able  to  implement  the  maximum  likelihood  

method  in  order  to  estimate  the  sniper’s  position.  From  there,  we  investigated  the  effect  of  

different  sensor  node  arrangements,  as  well  as  parameter  variation,  on  localization  

accuracy.  In  addition  to  estimation,  we  used  hypothesis  testing  and  the  Neyman-­‐Pearson  

lemma  to  explore  detection  of  a  sniper,  and  to  quantify  the  distinction  between  a  gunshot  

and  noise.    

 

 

 

 

 

 

Page 4: ESE499 Engineering Capstone Project

  4  

Introduction      

Sniper  localization  is  an  important  issue  in  both  military  defense  and  civilian  

security.  There  are  many  different  types  of  source  localization  systems  in  use  today,  which  

consist  of  sensor  nodes  that  can  detect  signals  such  as  sound,  motion,  and  light.  Our  project  

deals  solely  with  an  acoustic  sensor  network,  which  recognizes  acoustic  phenomena  

produced  by  a  gunshot.  These  systems  rely  primarily  on  information  received  from  two  

acoustic  signals  of  a  shot  –  the  muzzle  blast  (MB),  which  is  the  waveform  generated  by  a  

bullet  leaving  the  barrel,  and  the  supersonic  shock  wave  (SW)  generated  by  a  bullet  itself  

[1].  The  shock  wave  can  only  be  detected  by  sensors  located  within  the  bullet  path  –  a  

rapidly  expanding  cone,  whose  axis  is  the  bullet  trajectory  [3].    

Standard  acoustic  systems  use  microphone  arrays,  either  stationary  or  mobile,  to  

detect  and  time  stamp  these  two  signals.  In  military  operations,  sensors  are  often  placed  on  

soldiers'  helmets  or  on  artillery  vehicles;  however,  the  inclusion  of  sensor  mobility  and  

other  physical  interference  raises  the  complexity  of  our  estimation  problem,  so  we  

applied  our  model  to  a  static  acoustic  sensor  network  [4].    

By  considering  sensor  location  in  conjunction  with  the  time  measurements  from  

the  acoustic  phenomena  of  a  gunshot,  it  is  possible  to  estimate  a  sniper's  position  to  a  

fairly  high  degree  of  accuracy.  Some  systems  use  an  advanced  time  of  arrival  (TOA)  

technique,  which  deals  with  synchronization  errors  individually  across  the  entire  network  

of  sensors.  However,  the  majority  of  systems  rely  on  a  time  difference  of  arrival  (TDOA)  

algorithm  to  localize  the  origin  of  the  signal.  Most  military  operations  implement  a  TDOA  

model  that  uses  a  combination  of  the  MB  and  SW  signals.  Implementing  a  model  based  on  

the  shock  wave  of  a  gunshot  increases  localization  accuracy,  but  requires  knowledge  

Page 5: ESE499 Engineering Capstone Project

  5  

of  bullet  speed  and  trajectory,  parameters  that  are  not  easy  to  simulate.  Therefore,  to  

simplify  our  project,  we  only  considered  the  muzzle  blast  in  our  signal  model.  

 

Signal  Model    

In  this  project,  we  use  MATLAB  generated  data  to  simulate  muzzle  blast  time  of  

arrival  (TOA)  measurements.  Our  model  assumes  the  existence  of  a  single  sniper  within  an  

acoustic  sensor  network.  

 

Time  of  Arrival  (TOA)  

TOA  of  the  muzzle  blast  signal,  τ iT ,  is  an  m  x  T  matrix,  where  m  is  the  number  of  

sensors  in  the  network  and  T  is  the  number  of  shots.  The  time  of  arrival  at  the  ith  sensor  is  

given  by:    

τ iT =

ric+τ 0  

where ri  is  the  distance  from  the  ith  sensor  to  the  source  of  gunfire  and   c  is  the  speed  of  

sound,  constant  at  343.2  m/s.τ 0 is  the  time  origin  of  the  muzzle  blast,  and  is  modeled  as  

noise  using  a  Gaussian  distribution  with  mean,  μ  =  0,  and  variance,  σ2.  τ iT ,  then,  is  the  exact  

time  in  seconds  it  takes  the  muzzle  blast  signal  of  the  Tth  shot  to  reach  sensor  i,  plus  a  

randomly  generated  time  origin  of  the  signal.    

 

Time  Difference  of  Arrival  (TDOA)  

Having  generated  TOA  data,  we  were  able  to  determine  time  difference  of  arrival  

measurements  to  use  in  our  signal  model.  Setting  one  sensor  as  a  reference  allowed  us  to  

   [2]  

Page 6: ESE499 Engineering Capstone Project

  6  

find  the  difference  between  arrival  times  at  the  indicated  sensor  and  the  rest  of  the  sensors  

in  the  system  –  for  every  non-­‐reference  sensor  i,  we  calculated  the  difference  between  the  

TOA  at  the  reference  sensor  and  the  TOA  at  sensor  i,  which  gave  us  a  total  of  m-­‐1  TDOA  

measurements  for  each  shot.  TDOA  data  is  much  more  robust  than  TOA  data  because  it  

reduces  the  time  synchronization  error  that  occurs  when  multiple  sensors  are  detecting  

the  same  signal;  this  issue  would  otherwise  have  to  be  dealt  with  using  advanced  GPS  

locating  techniques  for  each  individual  sensor.  The  mathematical  equation  for  TDOA  is  

below.  

TDOA = τ iT −τ1

T =ric−r1c

"

#$

%

&'+ τ 0

i −τ 01( )    

Model  

Our  final  model  for  processing  can  be  written  as  Y  =  θ  +  e,  where  Y  is  the  

environment,  θ  is  the  exact  time  difference  of  arrival  –  our  deterministic  unknown  

estimator,  and  e  is  the  error  from  time  origin  measurements.  Y  and  e  are  independent  and  

normally  distributed  such  that  Y ~ N θ,σ 2( )  and   e ~ N 0,σ 2( ) .  Then,    

Y =θ + e = ric−r1c

"

#$

%

&'+ τ 0

i −τ 01( ) .  

 

Estimation    

In  order  to  estimate  the  position  of  a  sniper,  we  exploited  the  generated  time  stamps  

of  the  acoustic  signals  and  then  calculated  TDOA  measurements.  In  our  setup,  we  assumed  

that  both  the  exact  position  of  the  sniper  and  the  position  of  the  sensor  nodes  were  known.  

   [2]  

Page 7: ESE499 Engineering Capstone Project

  7  

With  this  information,  we  were  able  to  apply  the  maximum  likelihood  method  to  our  model  

to  estimate  the  position  of  the  shooter.  

 

Maximum  Likelihood  Estimation  

Maximum  likelihood  estimation  is  a  statistical  method  of  estimating  the  parameters  

of  a  given  statistical  model.  In  general,  the  model  is  based  on  n  observations  of  a  random  

variable,  X.  In  our  case,  there  are  n  =  T  observations,  one  for  each  gunshot.  To  apply  the  

maximum  likelihood  method,  the  likelihood  function,   lik(θ ) = f x1, x2,…, xn |θ( ) ,  of  the  

observed  data  has  to  be  specified,  where   lik(θ ) is  the  probability  of  observing  the  given  

data  as  a  function  of  θ .  If  the   Xi  are  independent  and  identically  distributed,  then  

lik(θ ) = f xi |θ( )i=1

n

∏  [7].  The  estimates  are  calculated  as  the  values  of  the  unknown  

parameters  that  maximize  this  likelihood  function.  In  our  model,  our  unknown  parameter,  

θ ,  is  deterministic  and  represents  the  exact  time  difference  of  arrival  from  sensor  i  to  the  

reference  sensor,   ric−r1c

"

#$

%

&'  [6].  

In  practice,  it  is  quite  tedious  to  maximize  this  equation,  so  we  exploit  the  natural  

logarithm,  and  the  fact  that  it  is  a  monotonically  increasing  function.  Because  of  this  fact,  

maximizing  the  likelihood  function  is  equivalent  to  maximizing  the  log  of  the  likelihood  

function,  

   

Our  signal  model  is  normally  distributed  with  mean,  μ  =  θ,  and  variance,  σ.  Therefore,    

l θ( ) = log f xi |θ( )( )i=1

n

∑    [6]  

Page 8: ESE499 Engineering Capstone Project

  8  

lik θ( ) = P Y |θ( ) = ei=2

m

∏j=1

T

∏−(Yi, j−θi )

2

2σ 2

   

where  T  is  the  number  of  shots  fired,  m  is  the  number  of  sensors  in  the  network,  and  Yi,j    is  

the  TDOA  for  the  jth  shot  at  the  ith  sensor.  Then,  the  log  likelihood  function  for  our  purposes  

will  be:  

l(θ ) = −12σ 2 (Yi, j −θi )

2

i=2

m

∑j=1

T

∑  

and  we  see  that  the  maximum  likelihood  estimator  is  equivalent  to  minimizing  the  sum  of  

squared  errors, (Yi, j −θi )2 ,  for  our  deterministic,  unknown  parameter,  θ.  

 

Mean  Square  Error  

The  mean  square  error  (MSE)  measures  the  difference  between  the  estimator  and  

what  is  estimated;  by  definition,  the  MSE  is  the  average  of  the  sum  of  each  error  term  

squared.  In  our  model,  the  sum  of  squared  errors  is  averaged  over  m-­‐1  TDOA  

measurements  and  T  shots.    

 

 

However,  since  our  ultimate  goal  was  to  estimate  sniper  position,  rather  than  TDOA,  we  

replaced  θ  with  x  and  y  as  follows:  

 

θ  represents  the  time  difference  of  arrival  between  signals  at  the  reference  sensor  and  

another  sensor  in  the  network  for  a  shot  fired  from  position  (x,y).    

MSE = 1m−1

* 1T* (θ −θi

i=2

m

∑ )2j=1

T

MSE =1

m−1* 1T* (x − xi )

2

i=2

m

∑ + (y− yi )2

j=1

T

   [6]  

   [6]  

   [7]  

   [7]  

Page 9: ESE499 Engineering Capstone Project

  9  

Implementation  

We  used  the  maximum  likelihood  method  and  mean  square  errors  to  estimate  the  

position  of  a  sniper.  This  involved  searching  every  integer  coordinate  point  in  a  given  range  

to  determine  which  (x,y)  point  resulted  in  the  smallest  mean  square  error  for  the  m-­‐1  TDOA  

measurements  across  T  shots.  However,  in  order  to  implement  this  algorithm,  we  had  to  

convert  each  of  the  (x,y)  coordinates  in  our  search  space  into  a  time  measurement  

equivalent  to  its  associated  exact  TOA  measurements.  This  calculation  was  done  by  finding  

the  distance  from  each  searched  coordinate  point  to  the  true  sniper  position  and  dividing  

this  distance  by  the  speed  of  sound,  c.  Once  this  was  done,  we  were  able  to  convert  each  of  

the  time  estimates  into  time  difference  of  arrival  estimates  based  on  the  TDOA  model  

discussed  earlier.    

Next,  we  found  the  difference  between  our  estimated  TDOA  measurements  in  the  

search  space  and  the  generated  TDOA  times,  squared  each  of  these  differences,  or  errors,  

and  then  summed  them  across  the  m-­‐1  TDOA  measurements  and  T  shots.  A  portion  of  our  

MATLAB  code  designed  to  find  mean  square  error  is  shown  below  for  reference.      

for x = 0:xrange for y = 0:yrange dist = sqrt((sensorLocales(1:M,1)-x).^2 + (sensorLocales(1:M,2)-y).^2); estTime = (dist)/c; for i=2:M deltaEst(i-1,:) = estTime(i) - estTime(1); end for i=1:T ssMsmts = sum((delta(1:M-1,i) - deltaEst(1:M-1)).^2); sse = ssMsmts + sse; end

... end end

Page 10: ESE499 Engineering Capstone Project

  10  

In  order  to  minimize  the  2500  MSE  values  we  calculated,  we  declared  an  initial  

minimum  sum  of  squared  errors  (SSE)  variable,  which  we  compared  each  of  the  calculated  

values  to.  As  we  iterated  through  the  search  space,  each  new  smallest  SSE  value  that  was  

reached  was  saved  over  the  previous  smallest  value,  so  that  the  final  value  assigned  to  the  

initial  variable  was  the  true  minimum  squared  error  value  over  the  entire  search  space.  

Each  SSE  value  was  then  converted  to  an  MSE  value  by  dividing  by  m-­‐1  TDOA  

measurements  and  T  shots.  Finally,  in  order  to  produce  a  contour  localization  plot,  each  

MSE  value  was  attached  to  its  associated  (x,y)  coordinate  point  so  that  we  could  reference  it  

back  to  an  estimated  sniper  position.    

   Results       Our  implementation  of  the  maximum  likelihood  estimation  on  our  signal  model  

allowed  us  to  examine  the  effect  of  varying  different  parameters  in  our  system.  The  

following  parameters  were  used  in  our  baseline  system  setup:  

T  (#  of  shots):  200     m  (#  of  sensors):  6     σ  (noise):  0.01     Search  Space:  [0,0]-­‐[50,50]     Exact  Sniper  Location:  (25,25)    

Sensor  Network  Setup  

First,  we  tested  our  model  on  a  variety  of  sensor  arrangements  and  examined  

position  localization  performance  for  these  different  network  setups.  Our  initial  

arrangement  was  a  single  line  of  sensors.    

 

Page 11: ESE499 Engineering Capstone Project

  11  

Single  Line  Sensor  Arrangement:  Estimated  Sniper  Position  (25,26)  

Figure  1a  depicts  our  most  

basic  sensor-­‐sniper  arrangement.  

The  shooter,  located  at  (25,25),  is  

15  meters  from  a  single  line  of  six  

sensors  that  are  spaced  five  

meters  apart.  With  σ  fixed  at  0.01,  

our  model  localized  the  sniper  to  

(25,26).  To  better  visualize  mean  

square  error  over  the  search  

space,  we  plotted  the  MSE  values  over  their  (x,y)  coordinate  in  our  region  of  interest  

(Figure  1b).    

 

 

 

 

 

 

 

 

 

 

Figure  1a  Single  Line  Sensor  Setup  

Figure  1b  Single  Line  Sensor  Localization    

Page 12: ESE499 Engineering Capstone Project

  12  

In  this  figure  the  dark  blue  parts  of  the  mesh  plot  are  associated  with  lower  position  

error  while  the  red  parts  indicate  a  higher  degree  of  error.  Our  estimation  for  the  single  

line  sensor  array  setup  wasn't  entirely  accurate  –  if  it  had  been  extremely  accurate,  the  

projection  of  the  MSE  values  onto  the  XY  plane  would  have  formed  a  series  of  circles  

around  (25,25),  the  true  sniper  position.    

We  also  examined  three  other  sensor  geometries  –  a  circle  of  sensors  around  the  

sniper,  two  lines  of  sensors,  and  a  randomly  generated  arrangement  of  sensors.  

 Circular  Sensor  Arrangement:  Estimated  Sniper  Position  (25,25)  

 

Random  Sensor  Arrangement:  Estimated  Sniper  Position  (25,25)  

 

Figure  2a  Circular  Sensor  Setup  

Figure  2b  Circular  Sensor  Localization  

Figure  3a  Random  Sensor  Setup  

Figure  3b  Random  Sensor  Localization  

Page 13: ESE499 Engineering Capstone Project

  13  

Two  Line  Sensor  Arrangement:  Estimated  Sniper  Position  (25,25)  

 

 

 

 

 

 

The  circular  arrangement  (Figures  2a-­‐b),  yields  an  extremely  accurate  localization,  

as  can  be  seen  in  the  MSE  contours.  However,  this  arrangement  is  unrealistic  in  military  

operations.  The  random  arrangement  of  sensor  nodes  achieves  an  accurate  estimation  as  

well,  but  this  is  likely  due  to  the  sniper’s  centralized  location  in  the  system  (Figures  3a-­‐b).  

The  two  line  setup,  (Figures  4a-­‐b),  while  accurate,  is  also  somewhat  unrealistic,  although  

this  arrangement  can  be  seen  as  two  stationary  arrays  mounted  on  the  sides  of  opposite  

buildings.  The  single  line  sensor  node  arrangement  is  perhaps  most  relevant  to  real  world  

applications  because  it  most  closely  mimics  a  stationary  array  of  sensors,  or  the  movement  

of  a  group  of  soldiers  in  unison.  In  general  though,  the  single  line  setup  is  not  nearly  as  

perceptive  as  other  sensor  arrangements,  and  does  not  consistently  estimate  source  fire  

accurately.    

 

Parameter  Variation  for  Single  Line  Sensor  Setup  

  After  testing  our  model  on  various  sensor  arrangements,  we  focused  on  increasing  

the  reliability  and  accuracy  of  position  localization  for  a  single  line  sensor  network.  We  did  

Figure  4a  Two  Line  Sensor  Setup  

Figure  4b  Two  Line  Sensor  Localization  

Page 14: ESE499 Engineering Capstone Project

  14  

this  by  changing  a  single  parameter  at  a  time,  while  fixing  the  remaining  parameters  as  was  

in  our  baseline  setup.  Variables  we  investigated  were  number  of  shots  (T),  number  of  

sensors  (m),  and  interspacing  of  sensors.  The  effects  of  each  variation  on  localization  

performance  are  noted  here.  

No.  of  Shots  (T)  • T  =  1000:  (25,25)  • T  =  100:  (25,26)  • T  =  10:  (25,31)  • T  =  1:  (21,33)    

No.  of  Sensors  (m)  • m  =  12:  (25,25)  • m  =  10:  (25,25)  • m  =  6:  (25,26)  • m  =  2:  (24,  50)  

 

Sensor  Interspacing:  • 20  meters:  (25,25)  • 10  meters:  (25,26)  • 5  meters:  (26,27)  • 1  meter:  (24,30)  

Varying  basic  system  parameters  did  not  have  as  drastic  of  an  effect  as  we  expected;  

however,  the  variations  did  yield  some  interesting  results.    

Despite  having  the  largest  range  (1-­‐1000),  shot  number,  T,  appears  to  have  the  least  

effect  on  localization.  The  1000-­‐shot  simulation  was  the  only  one  of  the  four  variations  of  

its  kind  to  accurately  estimate  the  sniper’s  position;  however,  the  likelihood  of  a  stationary  

shooter  firing  1000  shots  is  very  small.  The  100-­‐shot  simulation  was  a  single  meter  off,  and  

when  T=10,  we  were  able  to  estimate  the  shooter  position  to  within  nine  meters  of  its  true  

location.  This  last  case  yields  a  more  significant  and  relevant  result  because  it  can  

reasonably  represent  a  lone  gunman  in  the  real  world.  

  Our  initial  six-­‐sensor  single  line  system  estimated  the  shooter  to  be  one  meter  from  

his  true  position.  When  the  number  of  sensors  was  increased  to  ten,  our  model  produced  

the  correct  estimation.  However,  when  the  number  of  sensors  was  decreased  by  the  same  

amount  so  that  there  were  just  two  remaining,  our  estimation  lost  all  accuracy.  It  is  obvious  

from  these  results  that  the  number  of  sensors  is  important  to  the  accuracy  of  our  

estimation,  especially  when  you  consider  that  sensor  number  is  directly  used  in  the  

calculation  of  the  mean  squared  error.  

Page 15: ESE499 Engineering Capstone Project

  15  

  The  last  variable  we  looked  at  –  sensor  interspacing  –  is  perhaps  the  most  

interesting  of  the  three.  In  our  initial  simulation,  the  sensors  were  placed  five  meters  apart,  

and  this  resulted  in  our  estimation  being  slightly  off  target.  Increasing  the  spacing  between  

sensors,  which  increased  the  actual  TDOA  values,  greatly  increased  the  ability  of  our  model  

to  estimate  the  sniper’s  true  location.  Similarly,  the  reduction  of  interspacing  to  one  meter  

led  to  extremely  inaccurate  localization,  even  though  this  scenario  is  more  realistic  in  

combat.      

  It  is  clear  from  our  analysis  that  in  general,  sniper  situations  that  arise  in  real  life,  

whether  in  military  operation  or  in  civilian  security,  are  not  necessarily  the  most  conducive  

for  accurately  estimating  the  origin  of  gunfire.  Below  are  a  few  simple  graphs,  which  plot  

the  variation  of  a  parameter  against  the  error  in  position,  in  meters.    

           

 

-­‐10  

0  

10  

20  

30  

0   5   10   15  Error  in  Position  (m)  

Number  of  Sensors  

Variation  in  Sensor    Number  (m)  

0  

2  

4  

6  

0   10   20   30  

Error  in  Position  (m)  

Distance  Between  Sensors  (m)  

Variation  in  Sensor  Interspacing  

0  

2  

4  

6  

8  

10  

0.1   1   10   100   1000  

Error  in  Position  (m)  

log(#  Shots)  

Variation  in  Shot  Number  (T)  

Page 16: ESE499 Engineering Capstone Project

  16  

Noise  Level  Analysis    

  Finally,  we  sought  to  extend  our  knowledge  of  the  relationship  between  the  noise  

level,  σ,  and  the  accuracy  of  our  sniper  position  estimation.    

 Cramér-­‐Rao  Bound    

The  Cramér-­‐Rao  Bound  (CRB)  is  the  lower  bound  on  the  variance  of  estimators  of  a  

deterministic  parameter,  and  represents  the  best  possible  result  that  can  be  expected  for  a  

given  noise  level,  σ  [8].  Essentially,  this  means  that  if  our  minimum  MSE  value  is  equivalent  

to  the  calculated  CRB  at  a  given  σ,  our  estimation  has  achieved  the  lowest  possible  error.  To  

a  certain  extent,  the  CRB  derivation  should  indicate  whether  a  method  of  estimation  is  

worth  pursuing;  if  the  estimator  never  converges  with  the  lower  bound,  then  it  is  not  

optimal.    

The  CRB  is  obtained  by  taking  the  inverse  of  the  Fisher  Information  Matrix  (FIM).  

Because  our  model  is  multivariate,  each  element  in  the  Fisher  Information  Matrix  is  

modeled  as  an  𝒳  ~  𝑁 𝜇 𝜃 , Σ 𝜃  random  variable.  The  derivation  for  the  standard  FIM  of  

a  Gaussian  distribution  is  as  follows  [9]:    

𝑓 𝑥;𝜃 =12𝜋𝜎

exp𝑥 − 𝜃2𝜃!  

 

ln 𝑓 𝑥;𝜃 =  − ln 2𝜋𝜎! –  𝑥 − 𝜃2𝜃!  

 𝜕𝜕𝜃 ln 𝑓 𝑥;𝜃 =  

𝑥 − 𝜃𝜎!  

 

ℒ 𝜃 =  𝐸𝑥 − 𝜃𝜎!  =  

1𝜎! 𝐸 𝑥 − 𝜃 !  =  

1𝜎!  

 

Page 17: ESE499 Engineering Capstone Project

  17  

For  our  calculations,  µT θ( ) =θT and   θ( )∑ =σ 2I .  Since  the  mean  of  our  TDOA  vector  is  

scalar,  we  can  simplify  the  partial  derivative  of   f with  respect  to  µ to  a  column  vector  of  

size  m-­‐1,  where  each  entry  is  0  except  the  ith,  which  is  1.  Thus,  the  Fisher  Information  

Matrix,  J,  for  a  single  shot  is   J =

1σ 2 … 0

! " !

0 … 1σ 2

!

"

######

$

%

&&&&&&

=1σ 2 * I(m−1)x(m−1) ,  and  for  T  independent  

shots,   JT θ( ) = T * J(θ ) = Tσ 2 I .  Then  the  final  form  of  the  CRB  for  T  shots  and  m  sensors  is:  

CRB(θ ) = JT−1(θ ) = σ

2

TI(m−1)x(m−1)    

Signal-­‐to-­‐Noise  Ratio  

Having  derived  the  Cramér-­‐Rao  lower  bound  for  a  given  noise  level,  σ,  we  were  able  

to  show  that  our  model  eventually  achieved  the  best  possible  outcome.    In  order  to  

compare  the  CRB  and  MSE,  we  relied  on  the  signal-­‐to-­‐noise  ratio,  SNR.  The  SNR  measures  

the  noise  level  relative  to  the  overall  signal  strength.  In  our  analysis,  our  signal  was  the  

average  of  the  arrival  times  of  the  muzzle  blast  over  the  m  sensors.  The  general  form  of  

SNR  is:    

𝑆𝑁𝑅!"   =  10  𝑙𝑜𝑔!"  !"#$%&  !"#$%

!"#$%  

In  our  model,  this  becomes:    

⎥⎥⎥

⎢⎢⎢

= 210

)(

log*10σcravg

SNR  

   [9]  

   [12]  

Page 18: ESE499 Engineering Capstone Project

  18  

  Because  CRB,  MSE,  and  SNR  all  depend  primarily  on  noise  level,  σ,  we  were  able  to  

vary  σ  to  determine  whether  our  estimation  method  was  able  to  achieve  the  optimal,  or  

minimum,  mean  square  error.  This  comparison  can  be  seen  in  the  figure  below,  which  plots  

both  the  MSE  of  θ,  in  seconds,  and  the  CRB  against  SNR  for  100  trials  where  σ  =  

0:0.01:0.25.  As  σ  decreases,  the  signal-­‐to-­‐noise  ratio  (SNR)  increases,  and  the  mean  square  

error  converges  to  the  Cramér-­‐Rao  Bound.  

 

 

Detection    

We  used  detection  theory  to  investigate  the  difference  between  sniper  fire  and  noise  

and  implemented  hypothesis  testing  in  our  project  to  confirm  whether  or  not  the  generated  

Figure  5  MSE  of  θ,  CRB  vs.  SNR  

Page 19: ESE499 Engineering Capstone Project

  19  

signals  were  resultant  of  a  shooter  in  a  single  sensor  system,  or  simply  noise.  To  quantify  

this  distinction,  we  used  the  Neyman-­‐Pearson  Test  (NP)  –  the  “best  possible”  test  for  a  

specified  size,  α.  Ultimately,  we  wanted  to  find  the  power  of  this  test  for  a  range  of  

significance  levels.    

 Given  a  random  variable  Y ~ f (y;θ ) ,  where  Y1,Y2,…,YT are  independent  and  

identically  random  samples  of  Yi ,  a  given  hypothesis  test  of  size  α  can  determine  the  

validity  of  the  following  hypotheses:H0 :θ =θ 'H1 :θ =θ ''

 for  significance  level,  α,  where  θ  is  the  

parameter  of  interest  and  θ’  and  θ’’  are  instances  of  θ  based  on  the  statistical  model.    The  

four  outcomes  of  a  hypothesis  test  are  as  follows:  

 

 

   

 

Neyman-­‐Pearson  Lemma  

The  Neyman-­‐Pearson  Lemma  enables  us  to  find  the  optimal  critical  region,  c,  for  

which  the  power  of  a  test  is  maximized.  According  to  this  lemma,  if  we  are  given  the  

aforementioned  hypothesis  test,  then  the  critical  region  is   Y = (Y1,Y2,…,YT ) :{L(θ ';Y )L(θ '';Y )

≤ k}  

where  k  is  determined  from  P L(θ ';Y )L(θ '';Y )

≤ k |H0

"

#$

%

&'=α ,  and  

L(θ ';Y )L(θ '';Y )

is  the  likelihood  ratio.    

For  our  problem,  we  defined  the  hypothesis  test  to  be:    

  H0   H1  

Y ∈ c   Type  I  Error  α  

No  Error  “Power”  

Y ∉ c   No  Error   Type  II  Error  β  

Page 20: ESE499 Engineering Capstone Project

  20  

θ ' = 0

θ '' = r1c  

because  we  wanted  to  differentiate  between  a  system  with  no  sniper,  θ ' = 0 ,  and  a  system  

with  a  single  sensor r1meters  from  the  sniper’s  location.  Then,  by  definition,  it  followed  that  

the  critical  region  for  our  problem  was  of  the  form:    

y ≥ −ln ke

−T2 (θ '')

2( )Tθ ''

≡ c  

We  rejected  the  null  hypothesis,  θ’=0,  for y ≥ c ,  where  c  is  calculated  from  α = P(y ≥ c |H0 )

under  H0 :Y ~ N(θ ',σ2 )  and  Y ~ N(θ ',σ

2

T)  [10].  

From  this,  we  determined  P Y −θ 'σ 2

T

≥c−θ 'σ 2

T

#

$

%%%

&

'

(((=α  and   c−θ '

σ 2

T

= zα ,  where  P Z ≥ zα( ) =α  

and   Z ~ N(0,1) .    

Hence,  our  optimal  critical  region  was  as  follows:  

c =θ '+ σnzα  

and  we  rejected  H0  if   y ≥θ '−σnzα  and  accepted  H0  if   y <θ '−

σnzα .  

 Power  Analysis  

In  our  implementation  of  detection,  we  returned  to  a  single  sensor  system,  in  which  

a  single  sniper  fires  T=3  shots  and  the  noise  level,  σ,  is  fixed  at  0.1.    We  defined  our  

hypotheses  as  outlined  above  and  observed  our  results  for  α  ranging  from  0  to  1,  in  

increments  of  0.1.  For  each  of  the  10  values  of  α,  we  calculated  the  corresponding  power  

   [11]  

   [11]  

Page 21: ESE499 Engineering Capstone Project

  21  

level,  such  that  α  =  P(critical  region|H0)  and  power  =  P(critical  region|  H1).  With  these  

values,  we  created  a  receiver  operation  characteristic  (ROC)  curve  by  plotting  the  false  

positive  rate,  α,  against  the  power  of  a  test,  or  the  true  positive  rate.      

 

 

As  α  increases,  the  critical  region  increases  and  so  too  does  the  power  of  the  given  

test.    Because  power  =  1-­‐β,  increasing  power  implies  that  the  probability  of  a  Type  II  Error  

is  decreasing.  Despite  this  outcome,  there  is  still  an  increasing  risk  of  rejecting  the  null  

hypothesis  when  it  is  actually  true,  a  more  significant  error  than  its  counterpart.    

 

 

Figure  6  ROC  Curve,  α  vs.  Power  

Page 22: ESE499 Engineering Capstone Project

  22  

Conclusion       The  purpose  of  our  project  was  to  estimate  the  position  of  a  sniper  using  a  network  

of  acoustic  sensor  nodes  that  can  detect  the  muzzle  blast  of  a  gunshot.  We  simulated  time  

of  arrival  measurements  in  MATLAB,  and  used  the  maximum  likelihood  estimation  method  

on  our  signal  model  to  localize  the  sniper's  position.  Our  results  indicate  that  we  built  a  

robust  model,  which  could  accurately  estimate  the  location  of  generated  sourcefire  for  

varied  model  parameters  in  different  sensor  node  arrangements.    

In  addition,  our  implementation  of  sniper  detection  yielded  a  highly  accurate  ROC  

curve  for  the  generated  signal  in  a  single  sniper,  single  sensor  network.    

    With  more  time,  we  would  have  liked  to  apply  our  model  to  a  multiple  sniper  system  

and  included  physical  interference,  such  as  walls  and  atmospheric  condition.  We  could  also  

have  looked  at  implementing  more  complex  signal  models,  which  rely  on  the  shock  wave  of  

a  gunshot  in  addition  to  the  muzzle  blast.  An  even  more  complex  model  would  have  

used  simulated  measurements  from  a  mobile,  rather  than  static,  sensor  network.    

Finally,  we  would  have  also  liked  to  see  how  our  model  holds  up  against  real  shooter  

data.  Although  we  contacted  several  sources  requesting  this  data,  we  did  not  receive  and  

responses.    

 

 

 

 

 

Page 23: ESE499 Engineering Capstone Project

  23  

References    [1]  D.  Lindgren,  O.  Wilsson,  F.  Gustafsson  and  H  Habberstad,  "  Shooter    

Localization  in  Wireless  Sensor  Networks,"  Information  Fusion,  vol.  12th,  pp.  404-­‐

411,  2009.  

[2]  G.T.  Whipps,  L.M.  Kaplan,  and  R.  Damarla,  "  Analysis  of  sniper    

localization  for  mobile,  asynchronous  sensors,"  Signal  Processing.  Sensor  Fusion  and  

Target  Recognition,  vol.  7336,  no.  XVIII,  2009.  

[3]  P.  Bestagini,  M.  Compagnoni,  F.  Antonacci,  A.  Sarti,  S.  Tubaro,  "  TDOA-­‐  

based  acoustic  source  localization  in  the  space-­‐range  reference  

frame,"Multidimensional  Systems  and  Signal  Processing,  no.  March  ,  2013.  

[4]  G.L.  Duckworth,  D.C.  Gilbert,  J.E.  Barger,  "  Acoustic  counter-­‐sniper    

system,"  Command,  Control,  Communications  and  Intelligence  Systems  for  Law  

Enforcement,  vol.  2938,  no.  November,  1996.  

[5]  T.  Bokareva,  W.  Hu,  K.  Salil,  B.  Ristic,  N.  Gordon,  "  Wireless  Sensor    

Networks  for  Battlefield  Surveillance,"  Land  Warfare  Conference  (Brisbane),  no.  

October,  2006.  

[6]  Susan  Holmes,  "  Maximum  Likelihood  Estimation  ,"  (Class  Notes  and    

Useful  Defintions),  no.  February,  2009.  

[7] S.  Kay,  Fundamentals  of  Statistical  Signal  Processing,  Volume  I  Estimation  Theory,  :  

  Prentice  Hall,  1993,  p.  .  

 [8]  Yonina  Eldar,  "  MSE  Bounds  With  Affine  Bias  Dominating  the  Cramer-­‐  

Rao  Bound,"  IEEE  Transactions  On  Signal  Processing,  vol.  56,  no.  8,  pp.  3824-­‐3836,  

2008.  

Page 24: ESE499 Engineering Capstone Project

  24  

[9]  Songfeng  Zheng,  "  Fisher  Information  and  Cramer-­‐Rao,"  Statistical    

Theory  II,  vol.  Math  541,  2014.  

[10] C.  Hurvich,    Chapter  7:  Neyman  Pearson  Lemma,  Edition  of  book,  New  York:  NYU,  ,  p.  

1-­‐10.  

[11] J.  Proakis,  D.  Manolakis,  Digital  Signal  Processing,  Edition  of  book,  :  Prentice  Hall,  

2007,  p.  .  

[12] S.  Kay,  Fundamentals  of  Statistical  Signal  Processing,  Volume  II:  Detection  Theory,  :  

Prentice  Hall,  1998,  p.  .  

 

 

       

Page 25: ESE499 Engineering Capstone Project

  25  

Appendix  A  –  mse  location  estimates  and  contour  plots   clc clear all %%% Constants %%% T = 200; %shots c = 343.2; %speed of sound M = 6; %number of sensors mu = 0; sigma = .01; xrange = 50; yrange = 50; %%% Sniper Location %%% x0 = 25; y0 = 25; %%% Sensor Arrangement %%% %circle %r = 10; %theta(1) = 0; %theta(2) = pi/3; %theta(3) = 2*pi/3; %theta(4) = pi; %theta(5) = 4*pi/3; %theta(6) = 5*pi/3; %sensorLocales(:,1) = x0 + r.*sin(theta); %sensorLocales(:,2) = y0 + r.*cos(theta); %random %sensorLocales = randi([0 xrange],M,2); %linear below sensorLocales = [12,10;17,10;22,10;27,10;32,10;37,10]; %linear above %sensorLocales = [12,40;17,40;22,40;27,40;32,40;37,40]; %vertical %sensorLocales = [18,35;18,25;18,15;32,35;32,25;32,15]; sensorDist = sqrt((sensorLocales(1:M,1)-x0).^2 + (sensorLocales(1:M,2)-y0).^2); for i=1:T tau1(1:M,i) = sensorDist(1:M,:)./c + normrnd(mu,sigma,M,1); %toa end for i=2:M delta(i-1,:) = (tau1(i,:) - tau1(1,:)); %tdoa

Page 26: ESE499 Engineering Capstone Project

  26  

end %%% Search %%% minDist = 0; minSSE = 10000; yest = 100; xest = 100; sse = 0; for x = 0:xrange for y = 0:yrange searchDist = sqrt((sensorLocales(1:M,1)-x).^2 + (sensorLocales(1:M,2)-y).^2); estTime = (searchDist)/c; for i=2:M deltaEst(i-1,:) = estTime(i) - estTime(1); end for i=1:T %calculate errors ssMsmts = sum((delta(1:M-1,i) - deltaEst(1:M-1)).^2); sse = ssMsmts + sse; end sseFinal = sse; sseArray(x+1,y+1) = sseFinal; xArray(1:yrange+1,x+1) = x; yArray(y+1,1:xrange+1) = y; if(sseFinal < minSSE) %minimize sum squared error minSSE = sseFinal; minDist = estTime*c; xest = x; yest = y; end sse=0; end end mseArray = (((sseArray)./T)./(M-1)).*c; %convert to meters^2 %%% Plot %%% figure meshc(xArray, yArray, mseArray) xlabel('Y'); ylabel('X'); zlabel('Mean Square Error'); figure scatter(sensorLocales(:,1), sensorLocales(:,2)) hold on scatter(x0,y0,'*','r')

Page 27: ESE499 Engineering Capstone Project

  27  

xlim([0 50]) ylim([0 50]) xlabel('X'); ylabel('Y'); hold off %estimated location xest yest                                                            

Page 28: ESE499 Engineering Capstone Project

  28  

Appendix  B  –  snr,  cramér-­‐rao  bound  vs.  mse  plot    clear all clc %%% Constants %%% T = 200; %sample size c = 343.2; %speed of sound M = 6; %sensors mu = 0; xrange = 50; yrange = 50; %%% Sniper Location %%% x0 = 25; y0 = 25; %%% Sensor locations %%% sensorLocales = randi([0 xrange],M,2); sensorDist = sqrt((sensorLocales(1:M,1)-x0).^2 + (sensorLocales(1:M,2)-y0).^2); %%% Search %%% numTrials = 100; for p = 1:numTrials sigmacounter = 0; for sigma = 0:.01:0.25 sigmacounter = sigmacounter + 1; for i=1:T tau1(1:M,i) = sensorDist(1:M,:)./c + normrnd(mu,sigma,M,1); end for i=2:M delta(i-1,:) = (tau1(i,:) - tau1(1,:)); end minDist = 0; minSSE = 10000; yest = 100; xest = 100; sse = 0; for x = 0:xrange for y = 0:yrange searchDist = sqrt((sensorLocales(1:M,1)-x).^2 + (sensorLocales(1:M,2)-y).^2); estTime = (searchDist)/c;

Page 29: ESE499 Engineering Capstone Project

  29  

for i=2:M deltaEst(i-1,:) = estTime(i) - estTime(1); end for i=1:T ssMsmnts = sum((delta(1:M-1,i) - deltaEst(1:M-1)).^2); sse = ssMsmnts + sse; end sseFinal = sse; sseArray(x+1,y+1) = sseFinal; if(sseFinal < minSSE) minSSE = sseFinal; minDist = estTime*c; xest = x; yest = y; end sse=0; end end minSSE; xest; yest; avgDist = sum(sensorDist(1:M))/M; SNR = 10*log10(((avgDist)/c)/sigma^2); xyMatrix(sigmacounter,1) = xest; xyMatrix(sigmacounter,2) = yest; minSSEMatrix(sigmacounter,:) = minSSE; SNRMatrix(sigmacounter,p) = SNR; cramerRao(sigmacounter,:) = sigma^2/T; end end for j=1:sigmacounter avgSNRMatrix(j,1) = sum(SNRMatrix(j,1:numTrials))/numTrials; end scatter(avgSNRMatrix, minSSEMatrix./T./(M-1)./c, 'r') %seconds hold on scatter(avgSNRMatrix, cramerRao,'*', 'b') xlabel('SNR'); ylabel('Mean Square Error (seconds)'); legend('MSE','CRB');

Page 30: ESE499 Engineering Capstone Project

  30  

Appendix  C  –  detection  with  one  sensor    clear all clc %constants T = 3; %shots c = 343.2; %speed of sound mu = 0; sigma = 0.1; xrange = 50; yrange = 50; %sniper location x0 = 1; y0 = 1; %sensor location xs = 34; ys = 18; %distance d = [x0, y0; xs, ys]; dist = sqrt((xs-x0)^2 + (ys-y0)^2); %theta = theta1 for i=1:T tau1(1,i) = 0 + normrnd(mu,sigma,1,1); end %theta = theta2 for i=1:T tau2(1,i) = dist/c + normrnd(mu,sigma,1,1); end %search minDist = 0; minSSE = 10000; yest = 100; xest = 100; sse = 0; for x=0:xrange for y=0:yrange searchDist = sqrt((x-xs)^2+(y-ys)^2); estTime = searchDist/c; for i=1:T ssMsmnts = sum((tau1(1,i)-estTime).^2); sse = ssMsmnts + sse; end sseFinal = sse;

Page 31: ESE499 Engineering Capstone Project

  31  

sseArray(x+1,y+1) = sseFinal; if(sseFinal < minSSE) minSSE = sseFinal; minDist = estTime*c; xest = x; yest = y; end sse = 0; end end minSSE; xest; yest; %% detection theta1 = 0; %h0 theta2 = dist/c; %h1 alpha = [0.00001,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,0.99999]; y1 = sum(tau1(1:T))/T; y2 = sum(tau2(1:T))/T; l1 = exp((T*(theta1-theta2))*y1); l2 = exp((theta2^2-theta1^2)*(-T/2)); k = l1/l2; ybar = -log(k*exp((-T/2)*theta2^2))/(T*theta2); zval = norminv(1-alpha,theta1,sigma/sqrt(T)); cone = theta1 + zval*(sigma/sqrt(T)); if (ybar >= cone) theta = theta2; h=1; %reject null else theta = theta1; h=0; %accept null end power = normcdf(norminv(alpha,theta2,sigma/sqrt(T)),theta1,sigma/sqrt(T)); beta = 1-power; h %roc curve scatter(alpha,power) xlim([0 1]) ylim([0 1]) xlabel('a','FontName','symbol'); ylabel('Power');