1.7 KiB
1.7 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.multiply <number>data multiplier: amplitude is multiplied by n. 5 is default.channel <x|y|z>specifies which accelerometer channel to covert. z is default.integratesets 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.
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.