choosing appropriate algorithm for signal extraction

Status
Not open for further replies.

gary36

Full Member level 4
Joined
Mar 31, 2018
Messages
232
Helped
0
Reputation
0
Reaction score
0
Trophy points
16
Activity points
1,995
Hi

I have an application , where I am receiving a signal consisting of harmonics (upto 10 KHz)and we need to measure the magnitude of 50hz signal only. Can we use just single point DFT instead of N-point FFT because the frequency is known?
 

FFT is always N-point. I don't quite know your situation. Are you lack of signal processing capacity or want to speed up the detection?
 

Hi cariban

I was just thinking as why N point FFT is required if I am only interested in single frequency? Of course it will decrease my execution time as well.
 

If working with real-time processing having limited resources and interested to measure just a given frequency, I would also consider implementing a highly selective 50Hz band pass IIR digital filter, one sample in, one sample out.
 

Hi
Several books and papers on power system protection recommends using FFT for signal extraction and none of them talk about Goertzel. Just curious, are there any serious limitations with Goertzel? Not enough sample codes available on web
 

Hi,

first decide what
* sampling rate you use
* bandwidth of the result you want.

****

you may do two correlations:
* one with a calculated cosine of 50Hz, amplitude = sqrt(2)
* the other with a calculated sine of 50Hz, amplitude = sqrt(2)

This give the real part and the imaginary part of the 50Hz in your measurement signal.
Total amplitude = sqrt(sine_corr^2 + cosine_corr^2)

Maybe DFT algorithms do it the same or similar way.

Klaus
 

Hi Klaus

I am still looking for the answer to the question as to why FFT supersedes goertzel in power system protection? Serious limitations of Goertzel can be explained (if any)
 

Hi,

You ask me about Goertzel...
but unfortunately I´m not familiar with Goertzel...

I just tried to give an answer about your initial question: choosing the right algorithm.

Klaus
 

You did not specify what platform you are working with (e.g: 8 bit CPU, 32bit, etc...) as well as which resources are available, and what resolution you are expecting to reach, realtime or post processed, etc...The choice of the 'appropriate' algorithm depends on several factors to decide.
 

Hi Andre

I am planning to choose arduino due and external ADC to implement this algorithm. My accuracy requirement is around 2 %. Which is better FFT or Goertzel?
 

I fear none of them if working with a CPU having so few resources, particularly the amount of RAM needed to store the result; A good point to start is making mathematical simulations in MATLAB or any other numerical analysis tool in order to define the hardware requirements; as said, you could consider another approach, not on the frequency domain, but rather in the time domain, such as a HQ pass filter.
 

Hi
arduino due has 96 KB of RAM and 512 KB Flash. Runs as 84MHz. I guess for Goertzel, would these resources not be sufficient? External ADC chosen is AD7606 , 16 bit and easy interface with arduino
 

arduino due has 96 KB of RAM and 512 KB Flash. Runs as 84MHz. I guess for Goertzel, would these resources not be sufficient?
You're right, Arduino Due is not so weak in term of resources as his 8 bit Arduino's relatives. Perhaps even would be able to deal with an FFT function.
 

Hi
I just tried implementing 512 point FFT with recently procured Ti DSP Kit. Works great, but when inputs are in mV range, the FFT magnitude for fundamental freq ( 50 Hz) is unsteady. What could be the workaround? ( input is in the range 10mv p-p to 1Vp-p)
 

Did you try scaling the input to a higher magnitude value before computing the FFT, and descaling its result ?
 

Yes I did give it a try. here are my observations

1. Without scaling using a internal 12 bit ADC of TI DSP ( 0-3.3V range) yields results from 50mV p-p to 2V p-p. In accuracy is introduced below 50mV p-p. The results do fluctuate even in this range, for example 1v p-p yields FFT mag as 41 to 43. I am unable to co-relate this value to the incoming signal. Any unit conversion possible? Secondly did scaling for incoming counts to 10 and 100 also, but results are erratic and not linear
 

Hi

An FFT algorithm calculates with integer (but, LSB) values.
Thus the "mV" values need to be calculated as bit values.
--> I recommend to the bit values for discussion.

--> As already said you need to choose sampling_rate and filter_bandwidth first.

You say ADC input range is 0....3.3V. This lets me assume you use VCC as voltage reference. If so, don't be surprised of varying results. All the drift and noise of VCC will be "copied" to the measurement signal.
--> if you want a stable and accurate measurement result, then use a clean and stable voltage_reference.

--> Be sure the ADC timing is free of jitter (not software controlled). All the timing_jitter will result in voltage noise.

--> FFT window width, sampling rate: Be sure that in the measurement window exactly fits an integer count of 50Hz fullwaves. Else it should be obvious that the 50Hz result will vary.In this case you may consider to use a windowing function (like "Hanning"), but then you need to take the result bins both sides next to the 50Hz bin into account. This will improve stability of the result, but not perfectly.

Klaus
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…