graph_noise
Overview
graph_noise converts binary stacked floating-point noise files generated by mr1_noise (containing 20,000-sample port and starboard amplitude and phase arrays) into formatted ASCII plot files or 2-column ASCII tables (-list) with spike interpolation.
Usage
graph_noise (-verbose) (-len 12) (-port | -stbd | -both | -list) (-phase) (-packet) \
bin_noise_filename ASCII_filename
CLI Options
| Flag | Arguments | Default | Description |
|---|---|---|---|
<bin_noise_filename> | <path> | required | First positional argument: input binary stacked noise file from mr1_noise. |
<ASCII_filename> | <path> | required | Second positional argument: output ASCII plot or list file. |
-both | none | default | Output a 2-parameter plot file (20000 points of sample_index port_ampl stbd_ampl). |
-port | none | 0 | Output a 10-panel stacked plot of port array noise (10 segments of 1833 samples each). |
-stbd | none | 0 | Output a 10-panel stacked plot of starboard array noise (10 segments of 2000 samples each). |
-list | none | 0 | Output a 2-column integer table (port_ampl stbd_ampl) of tot_samples rows after interpolating out-of-range spikes (< 0 or > 999) from neighboring samples. |
-len | <seconds> | 20 (20000 samples) | Ping listen length in seconds (tot_samples = seconds * 1000 at 1 kHz sample rate). |
-phase | none | 0 (amplitude) | Read the second pair of tot_samples float arrays in the noise file (port and starboard phase in [-180, 180] degrees) instead of amplitude. |
-packet | none | 0 | Insert synthetic tick marks (1 and 649) every 64 samples (i % 64 == 0) to mark MR1 64-sample telemetry packet boundaries. |
-verbose | none | 0 | Enable verbose flag. |
How It Works
- Binary Array Reading: Reads
tot_samples * sizeof(float)bytes forport_amplandstbd_amplfrom<bin_noise_filename>. If-phaseis specified, reads a second pair oftot_samplesfloat arrays to overwriteport_amplandstbd_amplwith the stacked phase arrays. - Packet Boundary Marking & Spike Despiking: If
-packetis set, marks every 64th sample. In-listmode, replaces any sample outside[0, 999]with the average of its immediate neighbors(x[i-1] + x[i+1]) / 2(ori-2andi+2) before writingport_ampl stbd_ampl. - Plot Formatting: In
-both,-port, or-stbdmodes, writes page dimensions (22.0 29.0), parameter counts, X/Y axis limits, and multi-column sample rows for plotting.
Practical Examples
Export a cleaned 12-second port/starboard noise table for plotmr1 -load
graph_noise -len 12 -list noise_data.file noise_12s.txt