您好!
我在一个项目中使用 MSP430和 BMI160。 我正在使用 BMI160加速计来测量振动。 想法是使用 DSPLib 的 FFT 函数来确定振动事件中的主要频率。 根据我当前对 FFT 分析的理解、我意识到我需要的样本数应为2^n 个数据点、我还需要采样频率。 当我使用此函数时:
msp_status msp_fft_fixed_q15 ( const msp_fft_q15_params * params, int16_t * src )
我传递"params"和"src"参数(源):
参数:指向实数 FFT 参数结构的指针。
src:指向要对其执行 FFT 的实数组的指针。
我认为这是参数结构(源: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;
当我发送"SCR"参数时、我将发送实际数据点及其振幅。 例如、如果我从加速计的 z 轴获取1024个样本、我将在该数组中存储1024个连续样本的振幅。
但我不确定如何将样本的采样频率传递到 FFT 函数。 如果有人能解释 FFT 函数如何进行 FFT 分析、我将不胜感激。
谢谢你。