Electronics > Projects, Designs, and Technical Stuff
Signal processing - getting exact frequency from short ADC sample
ogden:
--- Quote from: Berni on December 17, 2019, 05:00:23 pm ---Im saying that doing it using downconversion offers a lot of advantages like being computationally cheap
--- End quote ---
Wrong. Other methods requires just single filter. IQ downmixer requires not only two mixers but two decimating filters as well.
--- Quote ---resilient to noise
--- End quote ---
Compared to unfiltered signal - yes. As I said - other methods can and shall use filter as well.
--- Quote ---offering a lot of measurements per second
--- End quote ---
Much less measurements per second than direct phase estimator I mentioned in my first post.
--- Quote ---able to work on very short captures of the signal (few ms rather than needing a full second of data)
--- End quote ---
Nonsense argument. There is no other method which would need/require full second of data.
--- Quote ---able to continuously pipeline data trough it rather than process it as one by one 1 second long recordings.
--- End quote ---
Nonsense again. Phasor angle estimator and even zero crossings counter can be run continuously. As I said - my proposal is the same, just do not need two mixers and two filters, needs just one filter. Dont you see.
--- Quote ---The point of down-mixing here is as Marco said is to easily convert the real input signal into a pair of quadrature I/Q signals. Advantage of these quadrature signals being that its possible to compute the phase by looking at just 1 sample.
--- End quote ---
Looking at 1 sample (angle difference between two actually) do not achieve meaningful resolution.
--- Quote ---No need to see a zero crossing, pick any random point on the sinewave and just look at that one sample and you will know the exact phase of it by using trigonometry.
--- End quote ---
I do not see this as an argument. If filtering, counting zero crossings, calculating phase shift for sine waveform appears problem for someone then I doubt that he will succeed implementing IQ downmixer with two decimator filters, then doing essentially the same - estimating phase shift between two or more IQ samples. Complexity while doing math with single sine compared to two (IQ) is not much different. You just propose to add completely superflous step - downmixing.
Your method have huge drawback - it's frequency range is kinda limited.
[edit] Paper that compares many methods mentioned in this thread: https://www.researchgate.net/publication/321255243_Power_System_Frequency_Measurement_for_Frequency_Relaying
Following are mentioned:
Modified zero-crossing methods [4], [3], [44], [52], [53]
DFT with compensation [23], [28], [65], [68]
Orthogonal decomposition [40], [55], [59]
Signal demodulation [2], [11]
Phase locked loop [12], [16], [27]
Least square optimization [7], [34], [49], [62]
Artificial intelligence [8], [13], [30], [32], [45], [58]
Wavelet transform [9], [36], [35], [31], [64]
Quadratic forms [29], [30]
Prony method [38], [42]
Taylor approximation [51]
Numerical analysis [67]
Berni:
--- Quote from: ogden on December 17, 2019, 05:43:07 pm ---
--- Quote ---No need to see a zero crossing, pick any random point on the sinewave and just look at that one sample and you will know the exact phase of it by using trigonometry.
--- End quote ---
I do not see this as an argument. If filtering, counting zero crossings, calculating phase shift for sine waveform appears problem for someone then I doubt that he will succeed implementing IQ downmixer with two decimator filters, then doing essentially the same - estimating phase shift between two or more IQ samples. Complexity while doing math with single sine compared to two (IQ) is not much different. You just propose to add completely superflous step - downmixing.
Your method have huge drawback - it's frequency range is kinda limited.
[edit] Paper that compares many methods mentioned in this thread: https://www.researchgate.net/publication/321255243_Power_System_Frequency_Measurement_for_Frequency_Relaying
Following are mentioned:
Modified zero-crossing methods [4], [3], [44], [52], [53]
DFT with compensation [23], [28], [65], [68]
Orthogonal decomposition [40], [55], [59]
Signal demodulation [2], [11]
Phase locked loop [12], [16], [27]
Least square optimization [7], [34], [49], [62]
Artificial intelligence [8], [13], [30], [32], [45], [58]
Wavelet transform [9], [36], [35], [31], [64]
Quadratic forms [29], [30]
Prony method [38], [42]
Taylor approximation [51]
Numerical analysis [67]
--- End quote ---
That paper is an excellent find.
It shows these methods being fed sinewaves with various types of noise and distortion applied to them. One of them being my proposal that is here named as "Signal demodulation". On page 13 and on you will find figures 9 to 17 showing graphs of the results, notice how graph D (showing the demodulation method) is always rock solid on the right frequency no matter what kind of noise is injected into the signal, nor does it show any quantization steps.
Using a FIR bandpass filter is more computationally expensive than the entire quadrature mixing process. Yes you do need to compute the mixers for every input sample to get all of the noise rejection benifits, but this cost is 2 MAC operations for the I and Q mix, and 2 additions with 2 sine table lookups for generating the mixers local oscillator. Downsampling only costs one bitshift every 1024 samples, turning this into a phase angle does require annoyingly slow division along with another trigonometry table lookup, but this is done at the slow rate so it all costs the equivalent computing power of about 0.05 of a MAC operation per input sample. So what sort of FIR filter can you build out of about 3 MAC and 2 sum and 2 lookup operations per sample?
Yes with downsampling you are looking at a narrow window, but this is a good thing because it rejects any frequencies out of this band so its an advantage not a hindrance, you can still not downsample and then get the full 500KHz of bandwith with the reduced noise immunity and higher computing cost that comes with that, but you do get 1 000 000 frequency measurements per second(Noise free too as long as your phase window is large enugh). Whats even better is that the band of interest can be moved around by simply changing the rate of incrementing trough the sine table (a FIR filter needs new coefficients for this) and multiple sets of mixers can be used to track two or more doppler targets in the same signal (Other methods require FFT of filters to separate multiple sinewaves before measurement).
As for the Phasor angle estimator, i agree. If you convert the signal into a phasor you know its exact frequency and job done. However can you recommend a simple and reliable algorithm for turning ADC samples into a phasor?
I'm sorry if i am being annoying with this, not trying to argue or anything but just trying to get on the same page with this phasor approach.
ogden:
--- Quote from: Berni on December 17, 2019, 07:32:44 pm ---As for the Phasor angle estimator, i agree. If you convert the signal into a phasor you know its exact frequency and job done. However can you recommend a simple and reliable algorithm for turning ADC samples into a phasor?
--- End quote ---
Cartesian to polar coordinate transform. I think paper in the link below may answer this question as well.
--- Quote ---I'm sorry if i am being annoying with this, not trying to argue or anything but just trying to get on the same page with this phasor approach.
--- End quote ---
Don't be sorry at all. This is interesting topic, thank you for arguing. I believe that there is no single "ultimate" solution, every approach may have it's strong and weak points. I think following paper will give some insight into phasor approach. https://www.researchgate.net/publication/323628162_Implementation_Techniques_for_Frequency_Phasor_Estimation_in_Phasor_Measurement_Units_PMUs
KE5FX:
--- Quote from: ogden on December 17, 2019, 03:22:00 pm ---
--- Quote from: Marco on December 17, 2019, 03:03:04 pm ---He isn't suggesting just downmixing it, he's suggesting downmixing it by sines in quadrature.
I think after low pass filtering, the phase of the quadrature results treated as a complex vector will give you the frequency shift (side effect of the PM/FM equivalence).
--- End quote ---
Downmixing, then measuring phase do not make any sense - if you can use same (phase) math on carrier directly. To avoid gigantic phase numbers that multiple times exceeds 2*PI you do not need to use downmixing. Just use your head.
--- End quote ---
Optimizing the SNR performance of this sort of measurement usually comes down to reducing the measurement bandwidth, given that the target signal is a narrowband signal embedded in noise whose spectrum is potentially (DC-daylight]. It's easy to implement a narrowband filter near DC, not so easy to implement it at any arbitrary RF carrier frequency.
This is as true nowadays as it was for Major Armstrong in 1918.
ogden:
--- Quote from: KE5FX on December 17, 2019, 08:36:15 pm ---Optimizing the SNR performance of this sort of measurement usually comes down to reducing the measurement bandwidth, given that the target signal is a narrowband signal embedded in noise whose spectrum is potentially (DC-daylight]. It's easy to implement a narrowband filter near DC, not so easy to implement it at any arbitrary RF carrier frequency.
This is is true nowadays as it was for Major Armstrong in 1918.
--- End quote ---
Near DC means very limited (narrow) range of input frequencies, big group delays of filters, thus long sampling/processing periods. If this method is so good for RF, then why all frequency counters uses zero crossing count method instead? ;)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version