How to use arm_rfft_q15 properly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2022-01-11 2:47 AM
- I created a 10Hz sine function with phase of pi/4, amplitude of 1000, bias of 2000, a sampling rate of 1kHz, and 2048 samples (20 periods in total) and saved it into q15_t input[2048].
- I created a fft stract by arm_rfft_init_q15(&S, 2048, 0, 0)
- I entered the input into arm_rfft_q15: arm_rfft_q15(&S, input, output), while output define as q15_t output[4096]
I took the input and output and copied them to Python.
I used fft in Python on the input data.
In addition, I arranged in Python the output of arm_rfft_q15 by calculating the magnitude of the numbers (where each pair of consecutive indexes represents the real and imaginary parts of a number) and then I applied fftshift on the data.
The input, and the fft from python and arm_fft_q15 are attached.
I don't understand why I do not get the same result from python and from arm_fft. Python's result seems logical (one peak at the oscillation frequency) and arm_fft's result are not make sense. Why do I get a lot of peaks and how do I convert the indexes to frequency?
- Labels:
-
DSP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2024-09-04 8:39 PM
I am also stock by this problem, if you find answer, please tell me~ thanks~
