Skip to main content Skip to navigation

MATLAB code

These are some useful MATLAB classes/functions/scripts.

  • I have created a MATLAB class for controlling a RITEC RPR-4000 (a high power pulser receiver). The class simplifies connecting to the unit via a serial port, with connection performed during construction of the class, and disconnection occurring when the class is destructed. Connection and disconnection can also be manually performed once the class has been constructed. The class checks for the over voltage condition whenever any parameter is checked or changed, and powers the unit down if necessary (which stops the unit from beeping). Methods are included to set the unit to safe defaults, and to set and get parameters either individually or in bulk. For example, to change the frequency, you merely need to set obj.Frequency = Value (where obj is whatever you have named the instance of the class). Another example is that to get the number of cycles, you can just write Value = obj.Cycles. There is also a method that returns all the high-pass and low-pass filter values, accessed via Settings = obj.Filters(). This is all explained in the documentation (type "doc RitecRpr4000" or "help RitecRpr4000" at the MATLAB command prompt). The class is licensed under the BSD 2-Clause license, and this is written in the source code comments. Although it is not required, I would appreciate an acknowledgement in any published work that uses this class. To download, right-click on the links below and select save link as....
  • I have created a MATLAB class for controlling a Peak NDT MicroPulse 5 (a phased array controller). The class simplifies connecting to the unit via Ethernet, with connection performed during construction of the class, and disconnection occurring when the class is destructed. Connection and disconnection can also be manually performed once the class has been constructed. The class should be used for sending any commands to the MicroPulse (via the Write method), and for reading messages (via the Read method). The class can also save FMC data to a simple binary format (with extra information in an XML file) and log every message sent to the MicroPulse unit. The main purpose of the class is to set the MicroPulse up for full matrix capture (FMC), and then to capture data. I have also created a total focusing method (TFM) class, which can process the data captured by the MicroPulse during a FMC. In terms of image quality, it will work as well as any other TFM implementation, but in terms of speed, it clearly will not keep up with something more optimised. There is some documentation for the classes (type "doc MicroPulse5" / "help MicroPulse5" or "doc TotalFocusingMethod" / "help TotalFocusingMethod" at the MATLAB command prompt), and there is an example of how to use the classes (MicroPulse5example.m). Clearly, these classes are intended to provide a starting point for further development. The class is licensed under the BSD 2-Clause license, and this is written in the source code comments. Although it is not required, I would appreciate an acknowledgement in any published work that uses this class. To download, right-click on the links below and select save link as....
  • I have created a MATLAB script for producing animated diagrams of compression, shear vertical (SV), and shear horizontal (SH) wave propagation and oscillation. The diagrams are designed to be visually clear, rather than being a literal representation of the crystal lattice, which means that the oscillations are greatly exaggerated. I am posting this code because others in the group expressed an interest in it, but as I had not originally intended to do so, the code is quite messy, and sections that should be functions are just copy-paste repeated. The code will produce a set of three animated GIF files (Compression.gif, ShearVertical.gif, and ShearHorizontal.gif) in the current directory if you set CreateGif = true in the user input section; otherwise it will just display the animations on screen. Although it is not required, I would appreciate an acknowledgement in any published work that uses these diagrams. To download, right-click on the link below and select save link as....

 

Creative Commons License"ePortfolio - Phil Petcher" by Phillip A. Petcher is licensed under a Creative Commons Attribution 3.0 Unported License.