(1 votes, average: 5.00 out of 5)

Approximate Vector Magnitude Computation

by on February 8, 2009

In this post, let us discuss a simple implementation friendly scheme for computing the absolute value of a complex number $Z = X+jY$. The technique called $\alpha Max + \beta Min$(alpha Max + beta Min) algorithm is discussed in Chapter 13.2 of Understanding Digital Signal Processing, Richard Lyons and is also available online at Digital Signal Processing Tricks – High-speed vector magnitude approximation

The magnitude of a complex number $Z = X+jY$is

$|Z| = \sqrt{X^2 + Y^2}$.

The simplified computation of the absolute value is

$|Z| \approx \alpha Max + \beta Min$ where

$Max = \max \left( |X|, |Y| \right)$

$Min = \min \left( |X|, |Y| \right)$.

The values of $\alpha$ and $\beta$ can be tried out to understand the performance. For analysis we can use a complex number with magnitude 1 and phase from 0 to 180 degrees.

Option#1

$\alpha$ = 1, $\beta$ = 1/2,

$|Z| \approx Max + \frac{Min}{2}$

Option#2

$\alpha$ = 1, $\beta$ = 1/4,

$|Z| \approx Max + \frac{Min}{4}$

Option#3

$\alpha$ = 1, $\beta$ = 3/8

$|Z| \approx Max + \frac{3Min}{8}$

Option#4

$\alpha$ = 7/8, $\beta$ = 7/16

$|Z| \approx \frac{7Max}{8} + \frac{7Min}{16}$

Option#5

$\alpha$ = 15/16, $\beta$ = 15/32

$|Z| \approx \frac{15Max}{16} + \frac{15Min}{32}$

Simulation Model

The script performs the following.

(a) Generate a complex number with phase varying from 0 to 180 degrees.

(b) Find the absolute value using the above 5 options

(c) For each option, find the maximum error, average error and root mean square error

Figure: Plot of approximate value of magnitude of a complex number

 Option alpha beta Maximum Error % Average Error % RMS error % 1 1 1/2 11.80340 8.67667 9.21159 2 1 1/4 -11.60134 -0.64520 4.15450 3 1 3/8 6.80005 4.01573 4.76143 4 7/8 7/16 -12.50000 -4.90792 5.60480 5 15/16 15/32 -6.25000 1.88438 3.45847

Table: Error in the approximate value computation with various values of $\alpha$, $\beta$

Observations

1. The chosen values of $\alpha$, $\beta$facilitates simple multiplier-less implementation of approximate computation (can be implemented using only bit shift and addition).

2. For Options (1),  (3) the maximum error is more than the expected value. Hence we need to allocate extra bits for the output to prevent overflow.

3. The error in the approximate magnitude computation repeats every 90 degrees.

Reference

Chapter 13.2 of Understanding Digital Signal Processing, Richard Lyons

D id you like this article? Make sure that you do not miss a new article by subscribing to RSS feed OR subscribing to e-mail newsletter. Note: Subscribing via e-mail entitles you to download the free e-Book on BER of BPSK/QPSK/16QAM/16PSK in AWGN.

robin July 18, 2009 at 12:14 pm

nice,thanks a lot.

Firdaus April 15, 2009 at 1:04 pm

Hi krishna…
I am Firdaus from Indonesia. I have read your book “array signal processing” and i am interested about ESPRIT algorithm…But I have a problem how to change TLS esprit algoritm for Uniform linier array to Uniform Circular Array. Would you please help me to solve the problem???

best regard

Firdaus

Krishna Sankar April 17, 2009 at 5:56 am

@Firdaus: Are you sure, its me? I have never written a book on Array Signal Processing. Hopefully, I write a book some day….
Anyhow, I am not familiar with the ESPRIT algorithm.

DAI February 9, 2009 at 12:26 pm

Good, thanks!

Umesh Bhaskar February 9, 2009 at 8:22 am

Thanks a lot Krishna !! Could not find info related to this topic anywhere else.

Sudeep KP February 8, 2009 at 10:34 am

Good post.
Noticed a typo – in description of Option #3, Beta has to be 3/8, and not 1/4.