oldbeams
Description
oldbeams is a utility designed to calculate GLORIAβs beam directivity functions, or beam patterns. It is functionally very similar to beams.c but appears to be an older or alternative implementation, potentially used for historical analysis or specific GLORIA configurations. It can compute either horizontal or vertical beam patterns based on physical parameters of the GLORIA sonar system, outputting values in linear power, linear pressure, or decibel (dB) scale.
Usage
oldbeams [-l] [-p] [-h] [-s] [-i <increment>] [-m <max_angle>]
Arguments
| Option | Description |
|---|---|
-l | Output in dB scale (logarithmic power). |
-p | Output in linear pressure scale. |
-h | Calculate the horizontal beam pattern. By default, it calculates the vertical beam pattern. |
-s | Use starboard side frequency (6287.5 Hz). By default, it uses port side frequency (6762.5 Hz). |
-i <increment> | Specifies the angular increment (in degrees) for the calculation. |
-m <max_angle> | Specifies the maximum angle (in degrees) up to which the beam pattern is calculated. |
How It Works
- Parameter Initialization: The program initializes physical parameters of the GLORIA array, such as
array_length(5.33m),array_width(0.31m),radius(0.057m),spacing(0.17m), andfreq(6762.5 Hz for port, 6287.5 Hz for starboard). - Argument Parsing: Command-line arguments modify these parameters and select the output scale and beam pattern type (horizontal or vertical).
- Wavenumber Calculation: It calculates the wavenumber
k = 2. * M_PI * freq / 1500., where 1500 m/s is assumed to be the speed of sound in water. - Horizontal Beam Pattern (
-h):- If
-his specified, it iteratesthi(angle) from 0 tomax_anglewithincrement. - The directivity
Dis calculated using the formulasin(const * sin(thi)) / (const * sin(thi)), whereconst = k * array_length / 2..
- If
- Vertical Beam Pattern (Default):
- If
-his not specified, it iteratestheta(angle) from 0 tomax_anglewithincrement. - The directivity
Dis calculated as a product of two terms:- One term from
sin(2. * values) / (2. * sin(values))usingvalues = spacing * k * sin(theta) / 2.. This models a two-element array pattern. - Another term
2. * j1(x) / xusingx = k * radius * sin(theta). This models the directivity of a circular transducer (assumingj1is a defined Bessel function).
- One term from
- Note the explicit use of
array_widthin the vertical beam pattern formulaβsconstdefinition inoldbeams.c, which differs frombeams.c.
- If
- Output Scaling:
- Linear Power (Default): Prints
D * D. - Linear Pressure (
-p): PrintsD. - dB Scale (
-l): Prints10. * log10(D * D).
- Linear Power (Default): Prints
- Loop: The calculations and output are performed for each angular step up to
max_angle.