I'm trying to create a beat detection function of a machine producing in the language R. I hosted the audio file on dropbox. It was recorded with 16 bit and 16kHz. I started with some filtering. The frequencies can be seen here. Most backgroundnoise is around 100Hz and I don't really have information above 4000Hz, so i used a bandpassfilter from 300Hz to 4000Hz. The filtered audiofile is also hosted on dropbox and the frequencies now look like this.
I then downsampled to 4000Hz to save data and computation time. Finally I used the hilbert function in combination with autocorrelation to get something like this. With the peak I can calculate that the machine cycle is 70/min, which is correct. This is the first time I'm doing something like this, so how can I improve the preprocessing? Should I downsample even more to save recources?
This method only looks at the loudness of the signal, disregards the frequency completly. Do you think thats good enough for something like this or can you recommend a method that also includes the frequency of the signal?
Calculation of start time
I also have to detect where the machine begins its production. I cut the signals into 1.5 second packets and labeled them. I used some simple metrics like mean and max of the loundness to cluster them like this. My idea was to check wheter its running or not, then use the packets of the running machine to calculate the cycle time. Then I can loop back the amount of the cycle time and check, if the machine is running at that point or not.
I don't really like that approach though. Do you have a better idea? Are there some better features than mean and max?