FAQ
- M051 Base Series(95)
- M0518 Series(97)
- M0519 Series(43)
- M0564 Series(1)
- Mini51 Base Series(90)
- Nano100/102 Base Series(101)
- Nano103 Base Series(10)
- Nano110/112 LCD Series(100)
- Nano120 USB Series(111)
- Nano130 Advanced Series(110)
- NUC029 Series(94)
- NUC100/200 Advanced Series(102)
- NUC120/122/123/220 USB Series(116)
- NUC121/125 Series(1)
- NUC126 USB Series(2)
- NUC130/230 CAN Series(103)
- NUC131/NUC1311 CAN Series(98)
- NUC140/240 Connectivity Series(114)
- M451 Base Series(118)
- M451M Series(117)
- M452 USB Series(130)
- M4521 USB Series(1)
- M453 CAN Series(128)
- M463 CAN FD/USB HS Series(1)
- M467 Ethernet/Crypto Series(1)
- M471 Series(1)
- M479 Motor Control Series(1)
- M481 Base Series(4)
- M482 USB FS OTG Series(4)
- M483 CAN Series(4)
- M484 USB HS OTG Series(4)
- M485 Crypto Series(4)
- M487 Ethernet Series(4)
- M4TK Touch Key Series(25)
- NUC442/472 Series(130)
- NUC472 Series(1)
- NUC505 Series(138)
Products
Applications
Function
+
FAQ
How to use the DSP function in the NuMicro® M4 series for spectrum analysis? Issue Date:2017-02-02
- For detailed example samples, refer to the following link: http://www.nuvoton.com/hq/resource-download.jsp?tp_GUID=EC0120160922110158
- Enable the DSP function:
1. In Keil, select Target Options, switch to the C/C ++ window and then enter ARM_MATH_CM4 = 1 in the Define text field.
2. In the Library section, add arm_cortexM4lf_math.lib at \Library\CMSIS\Lib\ARM.
3. Include arm_math.h to the main function. After that, the DSP library can be called in the main function.
- First, the even-numbers in the data format to be calculated are real numbers and the odd-numbers are imaginary numbers, e.g. 1+0.5i, 2+4i, 3+2i=>testinput={1, 0.5, 2, 4, 3, 2}, FFTsize=3.
- Then, call the function arm_cfft_radix4_init_f32(&S, fftSize, ifftFlag, doBitReverse) to do the initial settings for Fast Fourier operation, including the number of operations, the need for fast Fourier or inverse fast Fourier transform.
- Call the function arm_cfft_radix4_f32(&S, testinput) for fast Fourier transform operations, and the results are stored in the array testinput, where the results are complex.
- Take the absolute value of the complex number to get the frequency intensity, and output the results to Output. Since the result is left-right symmetry, the amount of computation is fftSize/2, arm_cmplx_mag_f32(testinput, Output, fftSize/2).
- Get the frequency intensity as y-axis data, and then calculate the x-axis for each frequency mode as
The calculation results are shown as follows. The strongest frequency of the signal can be about 1 kHz.
Products: | Microcontrollers ,Arm Cortex-M4 MCUs ,M451 Base Series ,M451M Series ,M452 USB Series ,M453 CAN Series ,M4TK Touch Key Series ,NUC442/472 Series ,NUC505 Series |
---|---|
Applications: | |
Function: | Peripherals,ARM,DSP,FPU,Connectivity,I2C |