Sunday 30 August 2015

DSP Tech Brief : Why Use A High Level Language For DSP ?

The field of Digital Signal Processing is constantly pushing the price / performance envelope of technology and traditionally this has required systems developers to use assembly language for the majority of the time critical signal processing routines. Today's commercial pressures have moved the "goal-posts" dramatically and typical project development timescales require a larger part of the application to be developed using a high level language. Another benefit to using a high level language for the system development is that a system can be rapidly prototyped to prove the algorithms and then hand optimised using assembly code for the time critical areas.


Primary Reasons For Using High Level Languages


  • High productivity
  • Portability
  • Maintainability
  • Code reuse
  • Optimising system cost / performance
  • Rapid prototyping and algorithm proving
  • Integration with real-time kernels and operating systems
  • Ease of debug
  • Availability of algorithms


The latest generation of compilers allows high level code to be compiled to a quality of assembly code that is very close to that which would be generated by hand. The development process is therefore very much easier than writing the algorithm in assembly code from scratch. An increasingly common development route is to develop the algorithms on a PC or Workstation and then rewrite the application for the target processor. Using the same language for development and deployment often allows the same code to be used for both, with the different I/O requirements handled through the use of conditional compilation of the source.


Modern high performance DSPs are also changing the way we view algorithmic efficiency and an increasing number of projects are written in a high level language because the savings at development time are far greater than the extra cost overhead of using faster processors at deployment.The architectures of the latest DSPs are also becoming more complex, for example with the integration of parallel execution units. This means that it is increasingly difficult for programmers to learn how to fully optimise their algorithms. When the complexity issue is coupled with the fact that the majority of DSP algorithms are block oriented vector processing algorithms and it is now becoming possible for high level language compilers to produce code that is 100% optimised.


If you have found this solution useful then please do hit the Google (+1) button so that others may be able to find it as well.
Numerix-DSP Libraries : http://www.numerix-dsp.com/eval/

DSP Tech Brief : The Zoom-FFT

The Zoom-FFT is a process where an input signal is mixed down to baseband and then decimated, prior to passing it into a standard FFT. The advantage is for example that if you have a sample rate of 10 MHz and require at least 10Hz resolution over a small frequency band (say 1 KHz) then you do not need a 1 Mega point FFT, just decimate by a factor of 4096 and use a 256 point FFT which is obviously quicker.

 Advantages of the Zoom FFT are :

  • Increased frequency domain resolution
  • Reduced hardware cost and complexity
  • Wider spectral range

Applications of the Zoom FFT include :

  • Ultrasonic blood flow analysis
  • R.F. communications
  • Mechanical stress analysis
  • Doppler radar

The following diagram shows the zoom process :



While the following diagram shows the basic architecture of the Zoom-FFT :



One common question is : Is the zoom FFT the same as the chirp z-transform.

The answer is : Absolutely not. The FFT calculates the FFT at N equally spaced points around the unit circle in the z-plane, the chirp z-transform modifies the locations of these points along a contour that can lie anywhere on the z-plane. In contrast, the zoom-FFT uses digital down conversion techniques to localise the standard FFT to a narrow band of frequencies that are centered on a higher frequency. The chirp z-transform is often used to analyze signals such as speech, that have certain frequency domain charactgeristics. The zoom-FFT is used to reduce the sample rate required when analysing narrowband signals - E.G. in HF communications.

These functions, and more, are available in the SigLib DSP Library.

If you have found this solution useful then please do hit the Google (+1) button so that others may be able to find it as well.
Numerix-DSP Libraries : http://www.numerix-dsp.com/eval/

DSP Tech Brief : Signal Scrambling And Linear Feedback Shift Registers (LFSRs)

Modulated signals are often scrambled when they are modulated. There are many reasons for scrambling the signal, including : spreading the spectrum and reducing the correlation between separate channels. Most scramblers utilise a Maximum Length Pseudo-Random Binary Sequence (MLPRBS or MLS), this uses a shift register an exclusive-or gates to randomise the data, as shown in the following diagrams. There are two general arrangements for implementing a scrambler, the non-synchronising and the self-synchronising types, each has its own benefits and draw backs, the non-synchronising type requires that the transmitter and receiver are synchronised before data transmission starts however once synchronised an input bit error to the receive scrambler will cause a single bit error in the output. The self-synchronising scrambler(shown below), as the name suggests will automatically synchronise to the received bit stream but a single receive bit error will cause N+1 bit errors in the output stream, where N is the length of the shift register.



This algorithm is included in the SigLib DSP Library.

If you have found this solution useful then please do hit the Google (+1) button so that others may be able to find it as well.
Numerix-DSP Libraries : http://www.numerix-dsp.com/eval/

DSP Tech Brief : One-Pole Filters

One-pole filters are very useful and efficient techniques for filtering signals. The feedback a value can also be used to design efficient peak-hold filters in the time-domain and are also used in power spectrum analysers and can help extract features of the signals that we are analyzing.



The following equation defines the one-pole filter :

y(n) = x(n) - a * y(n-1), 0 < a < 1.0

The single coefficient defines the gain and time-constant of the filter as follows :

Time constant :



Gain :



This algorithm is included in the SigLib DSP Library.

If you have found this solution useful then please do hit the Google (+1) button so that others may be able to find it as well.
Numerix-DSP Libraries : http://www.numerix-dsp.com/eval/

DSP Tech Brief : Adaptive Filters

The most common adaptive filters are of the FIR type, particularly the Least Mean Square (LMS) adaptive filter.

The LMS filter configuration and adaptation equations are shown in the following diagrams :



The following diagram shows a plot of X^2 gainst Y^2 i.e. the adaptation surface of a 2 tap filter :



This algorithm is included in the SigLib DSP Library.

If you have found this solution useful then please do hit the Google (+1) button so that others may be able to find it as well.
Numerix-DSP Libraries : http://www.numerix-dsp.com/eval/

DSP Tech Brief : The Goertzel Algorithm

Many applications require the detection of a few discrete sinusoids. The Goertzel filter is an IIR filter that uses the feedback to generate a very high Q bandpass filter where the coefficients are easily generated from the required centre frequency, according to the following equations. The most common configuration for using this technique is to measure the signal energy before and after the filter and to compare the two. If the energies are similar then the input signal is centred in the pass-band, if the output energy is significantly lower than the input energy then the signal is outside the pass band. The Goertzel algorithm is most commonly implemented as a second order recursive IIR filter, as shown below.



This algorithm is included in the SigLib DSP Library.

If you have found this solution useful then please do hit the Google (+1) button so that others may be able to find it as well.

Numerix-DSP Libraries : http://www.numerix-dsp.com/eval/

DSP Tech Brief : Envelope Detection

A common and very efficient technique for envelope detection is based on the Hilbert Transform, (a 90 degree phase shifter) and summing the phase shifted and original signals. The Hilbert transform is typically implemented as an FIR filter so the original signal must be delayed to match the group delay of the Hilbert transform. This process can be followed by absolute and then peak hold functions, the latter is often implemented as a one pole IIR filter.



The following diagrams give an idea of how this envelope approximation process works.



The following equation shows how the coefficients of the FIR filter implementation of the Hilbert transform are calculated.



The one pole IIR filter is defined by the following equation :

y(n) = x(n) + a * y(n-1), where 0 < a < 1.0

Another option for detecting the envelope is to use the square root of the energies of the original and the Hilbert transformed signals, as follows :

Envelope = sqrt(Hilbert^2 + signal^2)

In general, this will give similar results to the absolute value technique but can be more run-time efficient.

This algorithm is included in the SigLib DSP Library.

If you have found this solution useful then please do hit the Google (+1) button so that others may be able to find it as well.
Numerix-DSP Libraries : http://www.numerix-dsp.com/eval/