Part Number: MSP430FR6889
Hello,
I am using MSP430 and BMI160 in a project. I am using the BMI160 accelerometer to measure vibration. The idea is to use the DSPLib's FFT function to determine the dominant frequency in a vibration event. Based on my current understanding of FFT analysis, I realized that I need the number of samples, which should be 2^n data points, and I will also need the sampling frequency. When I am using this function:
msp_status msp_fft_fixed_q15 ( const msp_fft_q15_params * params, int16_t * src )
I am passing the "params" and "src" parameters (source):
params: Pointer to the real FFT parameter structure.
src: Pointer to the real data array to perform the FFT on.
And I think this is the parameter structure (source: DSPLib_transform.h):
typedef struct msp_fft_q15_params {
//! \details
//! Length of the source data, must be a power of two.
uint16_t length;
//! \details
//! Perform bit-reversal of the input before transformation. This step is
//! mandatory, this parameter only exists for applications that might handle
//! bit reversal when storing the data samples to memory. If not this needs
//! to be set to true.
bool bitReverse;
//! \details
//! Pointer to the twiddle coefficient table with size greater than or equal
//! to the source length. When using LEA this can be a NULL pointer.
const _q15 *twiddleTable;
} msp_fft_q15_params;
When I am sending the "scr" parameter, I am sending the actual data points and their amplitude. So, for example, if I am taking 1024 samples from the z-axis of the accelerometer, I am storing the amplitudes of 1024 consecutive samples in that array.
But I am not sure how I am passing the sampling frequency of the samples to the FFT function. I would really appreciate it if someone could explain how this FFT function is doing the FFT analysis.
Thank you.