cancel
Showing results for 
Search instead for 
Did you mean: 

Phase angle calculation

kvresto
Senior
Posted on April 19, 2016 at 13:32

 

Hi Everyone.

I’ve been trying to calculate the phase angle between two sine waves differing only in phase, and I’ve got it working in MATLAB, using the FFT of each sine wave and then applying MATLAB’s angle function. (as an example I think from the mathworks site??)

 Now I’m trying to do  the same with the STM32F3. I’m using the DSP Lib that can be downloaded from ST, and I’ve gotten as far as the FFT part, but as I’m not at all familiar with the library, I’m hoping someone with more experience can help with some direction as to how to use the Lib and get my phase angle.

Any ideas??

thanks

kvresto
1 REPLY 1
slimen
Senior
Posted on April 19, 2016 at 16:27

Hi,

You can have a look to the provided CMSIS/DSP_Lib examples for STM32CubeF3 available in STM32Cube_FW_F3_V1.4.0\Drivers\CMSIS\DSP_Lib\Examples

There is the DSP library containing example programs for FFT.

I found this

http://stm32f4-discovery.com/2014/10/stm32f4-fft-example/

and this

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/FFT%20in%20STM32F0&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=4839

,it may be helpful for you.

Regards