2.3 KiB
infraconv
Infraconv converts accelerometer data to wav files for infrasound analysis.
Usage
infraconv needs an input csv file.
generate this csv by opening the html file accessible with infraconv html on your phone (it will be printed to stdout, you need to use a server like python3 -m http.server 8080 to make use of it). (you may also use https://files.tudbut.de/accel.html)
invocation: infraconv <input csv file> <input samples/s> <output wav file> [<output params>]
output params are any as follows:
speed <number>speed multiplier: outputHz will be n * inputHz. does not add intermediary samples and thus changes pitch by a factor of n.interp <integer>smooth speed multiplier: adds intermediary samples; this means there will be no pitch or time changes. warning: introduces harmonics due to linear interpolation!multiply <number>data multiplier: amplitude is multiplied by n. autoscale is default.channel <x|y|z|multi>specifies which accelerometer channel to covert. z is default. multi mixes channelsintegratesets integration mode, where the input is integrated first to enhance low frequencies that may not be picked up correctly.autoscaleautomatically sets the multiplier based on the input. (this is the default. parameter is still accepted for compatibility)lpf <number>performs a low pass filter with some strength
when using interp, a low pass filter may be useful to remove the harmonics of the sawtooth-like resulting waveform. audacity has one. when using integrate mode, multiply may need to be set to a lower number.
Example
infraconv html > accel.html
python3 -m http.server 8080
# open <ip>:8080 on phone and let it record for a few minutes
# upload somewhere and download:
wget "files.tudbut.de/accel(7).csv"
# my phone does 128.6 Hz, for yours you'll have to read it from the screen
infraconv "accel(7).csv" 128.6 out.wav speed 5 multiply 10
mpv out.wav
Example output
$ infraconv accel\(7\).csv 128.6 out.wav speed 5 multiply 10
infraconv: Samples = 43920
infraconv: Offset = 9.832353324890137
infraconv: Out_Hz = 643
infraconv: done
Input file layout
Input must be a csv. Channels are as follows: x,y,z. Having only x or x,y is possible, and any channel can be accessed. Thus, parsing data from other sources is possible.