I am new in programming, I am using 12 bit Ad7352 SAR ADC from analog devices. By using that I want to measure Phase angle between two voltage signals. The amplitude of both signals can be different but the frequency of both signals is the same and that is line frequency 50Hz, I get the accuracy of +-0.45 degrees by zero-crossing interpolation method, what should I do next to get +-0.05 degrees of accuracy? The application of this project is in energy metering. I tried autocorrelation and FFT in MatLab, but I need a c-language code for the same because my platform is MSP430 from TI. and I also welcome any new algorithm to try, Thanks all in advance.
Asked
Active
Viewed 209 times
0
-
I think comparing two FFTs is still your best bet. It should not be too hard to find a working C implementation of the algorithm. This should give a better resolution than any interpolation methods applied to the transient signals – Mouse On Mars Oct 04 '19 at 19:43
-
Hey, Mouse on Mars, Thanks for your answer, It's Lil bit hard to find working C implementation of FFT as I am new to programming and digital signal processing, I have an idea of what to do with FFT result to get phase angle but can't find C algorithm for FFT on MSP430 board. help me with the same. – Dhruvi Patel Oct 17 '19 at 08:37
-
The way how it works on SO is that people present their code within their question and describe their problem with respect to the code. Asking for code is usually not well received since people will help you with a problem but not write code for you from scratch – Mouse On Mars Oct 17 '19 at 19:07
-
FFT c code is done, did FFT on Samples which I got from ADC in MatLab, I want to measure the frequency of sine wave signal from that FFT result, got to know one formula Fpeak=(Data_sample_rate * binNum)/Length_of_FFT; but how to plot FFT result in MatLab because I don't know frequency intervals between samples(because it is at irregular interval). How to find the peak value to compute the fundamental frequency? 12 bit ADC is there so I get sample values between 0 to 4096. and then perform FFT on that. Thanks in Advance!! – Dhruvi Patel Nov 06 '19 at 05:43
-
I’m not sure what you mean when talking about an irregular sample interval. The difference in frequency between two adjacent FFT bins should equal your ADC sampling frequency when using a plain vanilla FFT algorithm. Looking at the data sheet of your ADC it shows a sampling rate of 3MSPS. – Mouse On Mars Nov 07 '19 at 06:31