Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 1.55 KB

File metadata and controls

21 lines (15 loc) · 1.55 KB

Using An Ultrasound Transducer As A Sensor Example

Open In Colab

Running the example

Please have a look at the example_na_controlling_the_pml.ipynb notebook file to see the example in action.

Preparing the Matlab reference files

We can verify the correctness of Python implementation by saving intermediate/final variable states from the Matlab script and comparing them against Pyton version. Saving the variable states can be done manually by running the Matlab script, pausing it in appropriate places and saving the variables using save(...) method. However, this is very involved process. To automate the process a bit, we followed the steps below.

  1. Grab the original example file from K-wave repository (link: example_na_controlling_the_PML.m)
  2. Modify the file such that we are running for all scenarios (4 different simulation cases) and saving the output sensor data + visualized figures each time. We saved the modified script in the modified_matlab_example.m file.
  3. Run the modified file from the step above. Now we should have 4x .mat and .png files for the captured sensor data and visualized figure, respectively.
  4. We check against these files in the example_na_controlling_the_pml.ipynb notebook.