Stone-Soup icon indicating copy to clipboard operation
Stone-Soup copied to clipboard

Add sonar beamformers

Open PhilClemson opened this issue 4 years ago • 5 comments

This PR adds two new detectors for application to sonar tracking problems. Both take hydrophone data and convert these signals to a set of detections using a windowing method.

capon is a standard Capon beamformer. rjmcmc is a novel beamforming algorithm based on reversible-jump Markov chain Monte Carlo. The latter algorithm is designed for multiple target tracking, but the Metropolis-Hastings algorithm currently used does not perform well in these situations. I've therefore disabled the multiple target detection for now by forcing the update type in proposal_func(). The current algorithm has since been replaced with a more effective no-u-turn sampler (NUTS) but this is still undergoing testing (I'll include this in another PR at a later date).

The usage is demonstrated in the corresponding test file test_beamformers.py, where I've included a small simulated dataset fixed_target_example.csv.

PhilClemson avatar Aug 25 '21 18:08 PhilClemson

Codecov Report

Merging #490 (4a6b60e) into main (1ec7db2) will increase coverage by 1.80%. The diff coverage is 72.53%.

:exclamation: Current head 4a6b60e differs from pull request most recent head 6535754. Consider uploading reports for the commit 6535754 to get more accurate results Impacted file tree graph

@@            Coverage Diff             @@
##             main     #490      +/-   ##
==========================================
+ Coverage   91.42%   93.23%   +1.80%     
==========================================
  Files         144      145       +1     
  Lines        7009     7344     +335     
  Branches     1034     1110      +76     
==========================================
+ Hits         6408     6847     +439     
+ Misses        484      389      -95     
+ Partials      117      108       -9     
Flag Coverage Δ
integration 65.66% <14.32%> (?)
unittests 90.56% <72.53%> (-0.87%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
stonesoup/detector/beamformers.py 72.53% <72.53%> (ø)
stonesoup/metricgenerator/ospametric.py 86.39% <0.00%> (+0.59%) :arrow_up:
stonesoup/simulator/simple.py 97.76% <0.00%> (+1.49%) :arrow_up:
stonesoup/base.py 94.65% <0.00%> (+1.52%) :arrow_up:
stonesoup/initiator/simple.py 97.32% <0.00%> (+1.78%) :arrow_up:
stonesoup/sensor/radar/radar.py 97.23% <0.00%> (+2.20%) :arrow_up:
stonesoup/types/particle.py 96.22% <0.00%> (+3.77%) :arrow_up:
stonesoup/feeder/geo.py 93.61% <0.00%> (+4.25%) :arrow_up:
stonesoup/metricgenerator/manager.py 100.00% <0.00%> (+4.87%) :arrow_up:
stonesoup/metricgenerator/plotter.py 95.00% <0.00%> (+5.00%) :arrow_up:
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 1ec7db2...6535754. Read the comment docs.

codecov[bot] avatar Sep 03 '21 11:09 codecov[bot]

I have now added some descriptions / references above the beamformer classes. I also added a user-set random seed so that the RJMCMC algorithm will give reproducible output (for testing).

PhilClemson avatar Sep 28 '21 12:09 PhilClemson

Thanks for the comments @sdhiscocks. I've commited some changes but it's not ready for review yet.

PhilClemson avatar Oct 26 '21 12:10 PhilClemson

Okay, I think I've made all the requested changes but let me know if I missed anything!

PhilClemson avatar Nov 13 '21 14:11 PhilClemson

Thanks again for looking at this @sdhiscocks and apologies for taking so long to get back to you with the changes (unfortunately Christmas got in the way and then I was busy with other work in January).

I think I've fixed all the issues that were mentioned but it might be worth checking the new reader implementation with itertools is usable for streaming data.

PhilClemson avatar Feb 01 '22 19:02 PhilClemson