The reference @Stan gives is a good one, but there's still the question of what measure to use.
Previously, I've seen kurtosis work well. However, it doesn't seem to be that good on this data set.
The two things I'd look at for this are:
- The energy in the signal, and
- The distribution of the sample values (PDF estimate).
Below are several plots analysing a small segment of the left channel of your data. They are:
- The time domain signal.
- The frequency domain signal.
- The frequency domain signal after bandpass filtering the area between 0.4 and 0.8 of $f_s/2$.
- The PDF estimate from the raw data.
- The PDF estimate from the band pass filtered data.
- The 100 sample energy for the whole signal.
Perhaps the easiest one is the last: while there is overlap between the energy values, there isn't much and they seem well split.
The second one is probably the raw PDF estimate: check which one is closest to a uniform distribution. You can see in the time domain plot that the vibes
signal is generally further away from the origin that the clean
signal.
The second plot shows the same as the last on the 3 x 2, but is the 100 sample energy of the bandpass filtered signal. That looks better still.
R Code Only Below
#Q42498
library('tuneR')
library(e1071)
clean <- readWave('3500-clean.wav')
vibes <- readWave('3500-vibes.wav')
t_index <- seq(10000,11000)
par(mfrow=c(2,3))
plot(clean@left[t_index], type='l', col='blue', lwd=3)
lines(vibes@left[t_index], col='red')
title('Time doman 10000:11000')
plot(log(abs(fft(clean@left[t_index]))[1:500]), type='l', col='blue', ylim = c(8,15))
lines(log(abs(fft(vibes@left[t_index]))[1:500]), col='red')
title('Frequency domain 10000:11000')
library(signal)
bpf <- butter(10,c(0.4,0.8), type='pass')
clean_f <- filter(bpf, clean@left[t_index])
vibes_f <- filter(bpf, vibes@left[t_index])
plot(abs(fft(clean_f))[1:500], type='l', col='blue', lwd=3)
lines(abs(fft(vibes_f))[1:500], col='red')
title('Band Pass Filtered 10000:11000')
vibes_pdf <- density(vibes@left[t_index])
clean_pdf <- density(clean@left[t_index])
plot(clean_pdf$y/sum(clean_pdf$y), type='l', col='blue', lwd=3)
lines(vibes_pdf$y/sum(vibes_pdf$y), col='red')
title('PDF Estimate (Original)')
vibes_f_pdf <- density(vibes_f)
clean_f_pdf <- density(clean_f)
plot(clean_f_pdf$y/sum(clean_f_pdf$y), type='l', col='blue', lwd=3)
lines(vibes_f_pdf$y/sum(vibes_f_pdf$y), col='red')
title('PDF Estimate (filtered)')
maf <- rep(1,100)
clean_e <- filter(maf, 1, (clean@left[t_index])^2)
vibes_e <- filter(maf, 1, (vibes@left[t_index])^2)
plot(clean_e, type='l', col='blue', lwd=3, ylim=c(min(clean_e,vibes_e), max(clean_e,vibes_e)))
lines(vibes_e, col='red')
title('100 sample energy')