Dear reader
Does any one have a algorithm that functions as a second order Low Pass Filter LPF which specifies the parameters in terms of Cutoff frequencies and phase shifts?.
===============================
I ask this question for the following reason, commends are welcome if I make a mistake
I want to analyses a line voltage and line current with FFT by sampling them at the same time in two FFT sample arrays.
I have done some experiments with FFT in excel en saw interesting phenomenons which are
- FFT Bin one generates amplitude and phase of a zero harmonic sinusoidal under the condition that the FFT Bin frequency spacing is close to or exactly the sinusoidal frequency of the signal.
- If the signal is not zero harmonic sinusoidal but constant the other bins generate the harmonics which allow to calculate the THD of the signal.
- By measuring the current and voltage at the same time, also the phase difference between the two is calculated from the difference between the FFT signals.
- For FFT no peak detection or other synchronizations mechanisms are needed to calculate the peak current and voltage phase and THD. The only thing needed is a accurate frequency of the first harmonic and sampling both signal at the same time
.
Consider the frequency of the first Bin/harmonic unknown but between 40 ... 70 Hz. By starting the sample rate corresponding with the 40Hz FFT bin we can scan the 40..70Hz band for a maximum amplitude signal which ones found corresponds with the net frequency of the signal we measure. Scanning is done by adjusting the timer interrupt of a 16bit timer of a controller which runs on 16Mhz with a timer prescaler equal to 1. This timer interrupt service routine reads the voltage and current signals and the scan resolution must be high.
Assuming this method is correct(i think i am) we can 1) measure accurate the frequency of a net signal and following 2) compute the FFT and the corresponding amplitudes, phase and THD of a signal without the need for peak detectors and or synchronization mechanisms.
To do a scan of the input between 40..70 Hz preferably is done on a clean sinusoidal without harmonics. For that reason I need a second order filter. Preferably is done means that its nice to have but not a must.
i hope some can help me with a filter algorithm and confirm whether or not i'm correct with my description.
Thanks Oscar Goos