Frequency would be an indirect calculation.
You collect sample data at regular intervals.
The acceleration readings at each sample allows you to calculate change in speed for each axis, which can be used to determine overall velocity changes.
Plot those (store a number of samples in an continuously updated array) and eg. look for changes in sign, as reversals of direction. The number of samples between those (time) gives you period; the reciprocal of period is frequency.
You could do a similar thing for each axis rather than combining them.