I hope this question is not too trivial, and I welcome any pointers to good resources for this problem. I am not familiar with quaternions and have never had to use them before--all my learning about them has been my reading tonight. But most of the resources I've found haven't been too helpful, and I suspect I'm missing vocabulary that I might need to get to the information I need.
Suppose I have sensor which provides the quaternion coefficients for its relative rotation to some "primary" frame of reference. These coefficients are available in a vector, $\langle w,x,y,z\rangle$, corresponding to the quaternion $w + xi + yj + zk$. I have a second vector, provided by the same sensor, which indicates acceleration, and is provided in the form $\langle X,Y,Z\rangle$. This second vector provides the data from the sensor's frame of reference, not with respect to the "primary" frame of reference.
My goal is to transform the acceleration vector to the primary reference frame, so I can find the components of that vector with respect to my primary reference frame. This way I can determine the acceleration in each direction in the primary frame of reference.
From terms I've encountered, and a handful of other posts on similar issues, it seems that I would need to use some sort of rotation matrix, or possibly--since I have the quaternion already--use its inverse to return to the primary frame. But I am unsure of this, and wouldn't know how to do that without a better understanding of the methods involved.
I am hoping someone could point me to clear resources on this sort of problem, or explain the procedure (ideally with a simple example), and would be deeply grateful for any assistance.
I have found a useful, sufficiently clear document on the subject:
quaternion-tutorial.pdf
This source has provided everything I needed.
To summarize the solution, for an acceleration vector a, and a quaternion vector q, we have:
$$\text{a}' = \text{qaq}^{-1}$$
A quaternion rotation can be undone by simply taking the inverse of the quaternion vector and applying it to the acceleration vector. Such that:
$$\text{a} = \text{q}^{-1}\text{a}'\text{q}$$
For the link I supplied, this is as simple as taking the multiplication on page 16, and adjusting the sign of the elements of the quaternion vector such that $\text{q}_1$ through $\text{q}_3$ are of the opposite sign.