Streamlining Digital Signal Processing

Richard G. Lyons

Mentioned 1

This book presents recent advances in DSP to simplify, or increase the computational speed of, common signal processing operations. The topics describe clever DSP tricks of the trade not covered in conventional DSP textbooks. This material is practical, real-world, DSP tips and tricks as opposed to the traditional highly-specialized, math-intensive, research subjects directed at industry researchers and university professors. This book goes well beyond the standard DSP fundamentals textbook and presents new, but tried-and-true, clever implementations of digital filter design, spectrum analysis, signal generation, high-speed function approximation, and various other DSP functions.

More on

Mentioned in questions and answers.

I'm working on this embedded project where I have to resonate the transducer by calculating the phase difference between its Voltage and Current waveform and making it zero by changing its frequency. Where I(current) & V(Voltage) are the same frequency signals at any instant but not the fixed frequency signals approx.(47Khz - 52kHz). All I have to do is to calculate phase difference between these two signals. Which method will be most effective.

FFT of Two signals and then phase difference between the specific components Or cross-correlation of two signals? Or another if any ? Which method will give me most accurate result ? and with what resolution? Does sampling rate affects phase difference's resolution (minimum phase difference which can be sensed) ? I'm new to Digital signal processing, in case of any mistake, correct me.


  • Noise In my system can be white/Gaussian Noise(Not significant) & Harmonics of Fundamental (Which might be significant one in resonant mismatch case).

  • Yes 4046 can be a good alternative with switching regulators. I'm working with (NCO/DDS) where I can scale/ reshape sinusoidal on ongoing basis.

  • Implementation of Analog filter will be very complex as I will require higher order filter with high roll-off rate for harmonic removal , so I'm choosing DSP based filter and its easy to work with MATLAB DSP Processors.

  • What sampling rate would you suggest for a ~50 KHz (47Khz-52KHz) system for achieving result in FFT or Goertzel with phase resolution of preferably =<0.1 degrees or less and frequency steps will vary from as small as ~1 to 2Hz . to 50 Hz-200Hz.

  • My frequency is variable 45KHz - 55Khz ... But will be known to my system... Knowing phase error for the last fed frequency is more desirable. After FFT AND DIGITAL FILTERING , IFFT can be performed for more noise free samples which can be used for further processing. So i guess FFT do both the tasks ...

But I'm wondering about the Phase difference accuracy cause thats the crucial part.

The Goertzel algorithm is a fairly efficient tone detection method which resolves the signal into real and imaginary components. I'll assume you can do the numerics to get the phase difference or just polarity, as you require.

Resolution verses time constant is a design tradeoff which this article highlights issues.


"What accuracy can be obtained"

It depends...upon what you are faced with (ie signal levels, external noise etc), what hardware you have (ie adc, processor etc) and how you implement your solution (sample rate, numerical precision etc) Without the complete picture, I'll be guessing what you could achieve as the Goertzel approach is far from easy.

But I imagine for a high school project with good signal levels and low noise, an easier method of using the phase comparator (2 as it locks at zero degrees) of a 4046 PLL likely get you down to a few degrees.

One other issue if you have a high Q transducer is generating a high resolution frequency. There is a method but that's another avenue.

Yet more

"Harmonics of Fundamental (Which might be significant"... humm hence the digital filtering but too lower sampling rate and there might be a problem with aliasing. Also miss-matched anti-aliasing filters likely to take your whole error budget. A rule of thumb of ten times sampling frequency seems a bit low, and it being higher it will make the filter design easier.

Spacial windowing addresses off frequency issue along with higher rolloff and attenuation and is described in this article. Sliding Spectrum Analysis by Eric Jacobsen and Richard Lyons in Streamlining Digital Signal Processing

In my previous project after detecting either carrier, I then was interested in the timing of the frequency changes in immense noise. With carrier phase generation inconstancies, the phase error was never quiescent to be quantified, so I can't guess better than you what you might get with your project conditions.