Code in

Google Colaboratory

To run the code, you have to download the files from discord to your Google Drive and change the path to which the google colab code connects.

The idea was to use the short files from vaccuum, elephant2 and drums2 that have defined input signals to make sure the analysis is working at its best. And then run that on the ambient file. And other files.

I would like to make a report on the analysis containing: the histogram of timestamps which shows the uneven sampling rate problem, a comparison of using different time intervals to resample datax and data y, a comparison between the results of interpolating (v2) and averaging (v3) the bins, different spectrogram thresholds. And having defined the parameters, the spectrogram, time traces and spectrum of each signal (input and output).

The spectrogram looks very raw, we should try windowing. Figure out what resolution we should be able to get in the spectrogram. X or Y signal? Or a combination?

Why is there a drift in the baseline of X or Y vs time graphs? Try filtering or averaging to even out baseline.

I found two methods to run spectrographic analyisis on uneven sampled data: Nonuniform fast Fourier transform and Lomb-Scargle periodogram (called nufft and plomb in Matlab), it might help if we don't want to do any conversions just know the frequencies in the whole file.

Also: Subir said he cannot get the mouse to record at less than 10ms intervals. Assuming wavelengthx10 samples are needed for correctly recreating the signal, this will let us analyse signals of up to 100ms wavelength (10Hz). Elephant rumbles fundamental frequency is around 10-20Hz. This might be a problem since to cover that range up to 20Hs at x10 we need a 5ms sampling frequency. Is the x10 for correct recreation a hard limit? Or can some processing be done for avaraging or sth?

Analysis of Drum2 using Matlab

Drum2 online data (python scripts using data in X):

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/af2f0800-4353-491c-835f-bfd0a2c9b3d0/drum2.png

The non-uniform sampling rate problem

We resampled the data (both X and Y) using a linear interpolation and a period of 5ms (200Hz). We see some edge effects since resample assumes the samples at times before and after the given samples in X are equal to zero. Thus large deviations from zero at the end points of the sequence X can cause inaccuracies in Y at its end points.

The histograms show that the sample rate is uniform after the resampling. The zoom in shows the difference between the original and resampled signals is not too large using this method.

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/7cb73bca-d824-4ba5-b750-fcd579c464cd/histograms_datay_drum2.png

Original uneven sampling in blue circles. Resampled in red asterisks.

Original uneven sampling in blue circles. Resampled in red asterisks.