You are not going to be able to distinguish potholes clearly from other short peak events apart from being able to distinguish between a rising bump in the road and a hole (the intial direction will be opposite) but you can certainly capture them quite easily.
Determine an initial direction (e.g. negative/positive XYZ depending on how your device is mounted), a threshold level, and a maximum time the reading should be over this level (determined by width of pothole) Then time the peak height/width and see if it fits your pothole characteristic.
The device already contains an internal 1kHz LPF, so you could add a HPF of say 50-200Hz for the potholes, since they will have a fast risetime. I'm not an expert on car vibration frequencies, but you will probably get some noise from vibration however you filter. However that's not an issue as long as the pot hole event is large in comparison with the noise - it looks like the data is okay as it is, I would just sample a bit faster to prevent aliasing (e.g. >2kHz) or add a LPF to the existing internal one as described in the datasheet. Since you are trying to capture fast risetime events, I'd go with the former (faster sampling, possibly with HPF)
To compensate for a change in inclination, you can have a running average value which can be used to zero the axis out (one for each axis). Also, note that a HPF will ignore the DC level, so (as long as it doesn't go off the end of the scale) a slow gradient will make no difference.
According to the datasheet (bottom of page 7 in the link above), the formula for the external capacitance is:
\$ C2 = C3 = C4 = \dfrac{4.97 \times 10^{-6}}{f_{BW}} \$
so your calculation of:
\$ \dfrac{4.97 \times 10^{-6}}{10Hz} = 497nF \$ is correct.
Edit:
I found the cause of the spikes.
The BMI055 chip is internally flawed, I am sure of it now.
If you read out the FIFO in Bypass mode (that means only one frame is kept) then you have to expect data errors.
If you read it faster than the sampling rate you receive 10% 0x8000 (smallest possible number) in the mix. Not zero, not the last value .. a MAXIMUM value!
If you read the data a bit slower than the sampling rate, you receive valid data with 1-8 spikes per second.
This happens if you use the FIFO register in 6 or 8 byte burst mode.
Now I got curious, I read the 0x02 register in 6 byte burst and this gives the same data (x,y,z) and I changed absolutely nothing else.
The spikes are reliable gone.
previous text:
It seems that the gyroscope itself is flawed and it is not just that one.
I first expected an error in I2C communication, turned down the speed and exchanged the voltage shifting circuit without any change in results.
Now as I identified the problem to come from random high spikes I could also find many other people with similar issues or reports.
Surprising fact is that there are rarely any answers.
My first test was a moving exponential average filter, but as I expected that ruins many subsequent readings and only dampens the spikes.
The best solution I can think about is to use two gyroscopes, that is what I will do longterm.
They will likely both have spikes and by comparing both frames with each other it should be possible to get a very good result and no spikes.
The simple solution is to filter spikes based on a hardcoded max-change value.
I first considered capturing data at twice the current rate and then always lagging behind one frame.
That way I would know the 'future' and the past, if the 'current' data is way off from future and past it is a spike (or someone hit a hammer on the sensor).
But for gyros with high degree/s resolution and pratical use outside of 2000deg/sec the filtering can be easier.
I played around and was shaking the gyro heavily, the raw values rarely exceeded +10k and no matter what I did they did not have any such sudden changes, even during a drop on the table.
I use this now:
if (abs(old-current)>0x3000) use_value();
So if the result is off by more than 12,000 raw values in comparison to the previous value than the previous value will stay in the variable. Otherwise the variable is updated with the new value.
Now I have a quite low drift which even works for many minutes.
Sidenotes about the used gyro:
a) The BMI055 gyroscope is specified to return ZERO if you sample it too fast, in reality it returns random values.
b) The BMI055 gyroscope crashes the I2C bus if you send a soft_reset to it (the onchip ACC doesn't do that)
c) Sudden spikes are not described in the datasheets of the gyros and still many people notice them. That's quite strange.
I would appreciate a better answer, maybe I am wrong.
However, the spike filtration made my program work quite reliable compared to the unusable results earlier.
Best Answer
The Z axis should show about 1m/s2 when level because it is measuring the force of gravity. The noise could be vibration due to nearby fans, machinery, wind, even people walking in the area. It will pickup very subtle vibrations.
To reduce the noise, if you do not need high sensitivity, reduce the scale of the LIS3DH. Alternatively, you could handle this is in software through averaging, moving averages, etc. You could also consider implementing a software low pass filter.