discrete sine transform and its inverse—realization through recursive algorithms

9
INTERNATIONAL JOURNAL OF CIRCUIT THEORY AND APPLICATIONS Int. J. Circ. Theor. Appl. 2008; 36:441–449 Published online 14 September 2007 in Wiley InterScience (www.interscience.wiley.com). DOI: 10.1002/cta.447 Discrete sine transform and its inverse—realization through recursive algorithms Priyanka Jain 1, , , Balbir Kumar 2 and Shail Bala Jain 1 1 Department of Electronics and Communication Engineering, Indira Gandhi Institute of Technology, Kashmere Gate, Delhi 110006, India 2 Department of Electronics and Communication Engineering, Maharaja Surajmal Institute of Technology, Delhi 110058, India SUMMARY In this paper, the implementation of the discrete sine transform (DST) and its inverse (IDST) are developed. General length structure of the DST and IDST, which can be implemented by using the recursive structures, has been proposed. Necessary formulas required for the recursive structures have been derived using mathematical manipulations. Copyright 2007 John Wiley & Sons, Ltd. Received 1 June 2006; Revised 22 May 2007; Accepted 3 June 2007 KEY WORDS: DCT; DST; DFT; recursive structures 1. INTRODUCTION Discrete sine transforms (DSTs), which was originally developed by Jain [1] (type I) and Kekra and Solanka [2] (type II), belong to the family of unitary transforms [3]. This family includes the DST, discrete cosine transforms (DCT), and the discrete Fourier transform (DFT). DST finds application in many practical situations including the modeling of random processes, such as the Karhunen–Loeve transform (KLT), which is the optimum transform [1, 3]. DST has also been used in fast solutions of sparse Toeplitz or nearly Toeplitz systems of equations. Both these applications are related to many signal-processing problems such as data compression and digital filtering of signals. DST is widely used in image reconstruction [4] as well as in image coding [5]. DCT and DST for 2D cases can also be efficiently computed [6]. Since both DCT and DST use sinusoidal functions as their basis vectors, there exists a fast algorithm involving only real arithmetic operations for the DCT and DST [7, 12] based on sparse matrix factorization. Jain Correspondence to: Priyanka Jain, Department of Electronics and Communication Engineering, Indira Gandhi Institute of Technology, Kashmere Gate, Delhi 110006, India. E-mail: [email protected] Copyright 2007 John Wiley & Sons, Ltd.

Upload: priyanka-jain

Post on 11-Jun-2016

224 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Discrete sine transform and its inverse—realization through recursive algorithms

INTERNATIONAL JOURNAL OF CIRCUIT THEORY AND APPLICATIONSInt. J. Circ. Theor. Appl. 2008; 36:441–449Published online 14 September 2007 in Wiley InterScience (www.interscience.wiley.com). DOI: 10.1002/cta.447

Discrete sine transform and its inverse—realization throughrecursive algorithms

Priyanka Jain1,∗,†, Balbir Kumar2 and Shail Bala Jain1

1Department of Electronics and Communication Engineering, Indira Gandhi Institute of Technology,Kashmere Gate, Delhi 110006, India

2Department of Electronics and Communication Engineering, Maharaja Surajmal Institute of Technology,Delhi 110058, India

SUMMARY

In this paper, the implementation of the discrete sine transform (DST) and its inverse (IDST) are developed.General length structure of the DST and IDST, which can be implemented by using the recursive structures,has been proposed. Necessary formulas required for the recursive structures have been derived usingmathematical manipulations. Copyright q 2007 John Wiley & Sons, Ltd.

Received 1 June 2006; Revised 22 May 2007; Accepted 3 June 2007

KEY WORDS: DCT; DST; DFT; recursive structures

1. INTRODUCTION

Discrete sine transforms (DSTs), which was originally developed by Jain [1] (type I) and Kekraand Solanka [2] (type II), belong to the family of unitary transforms [3]. This family includesthe DST, discrete cosine transforms (DCT), and the discrete Fourier transform (DFT). DST findsapplication in many practical situations including the modeling of random processes, such as theKarhunen–Loeve transform (KLT), which is the optimum transform [1, 3]. DST has also beenused in fast solutions of sparse Toeplitz or nearly Toeplitz systems of equations. Both theseapplications are related to many signal-processing problems such as data compression and digitalfiltering of signals. DST is widely used in image reconstruction [4] as well as in image coding[5]. DCT and DST for 2D cases can also be efficiently computed [6]. Since both DCT and DSTuse sinusoidal functions as their basis vectors, there exists a fast algorithm involving only realarithmetic operations for the DCT and DST [7, 12] based on sparse matrix factorization. Jain

∗Correspondence to: Priyanka Jain, Department of Electronics and Communication Engineering, Indira GandhiInstitute of Technology, Kashmere Gate, Delhi 110006, India.

†E-mail: [email protected]

Copyright q 2007 John Wiley & Sons, Ltd.

Page 2: Discrete sine transform and its inverse—realization through recursive algorithms

442 P. JAIN, B. KUMAR AND S. B. JAIN

[1] has shown that for a first-order Markov sequence with certain boundary conditions, the KLT,reduces to DST. For signal with the correlation coefficients near to unity, the DCT provides a betterapproximation of the KLT than DST. It is well known that DST performs better than DCT whenthe correlation coefficient lies in the interval (−0.5, 0.5) [7]. Unlike KLT, DCT and DST are notdata dependent and many fast algorithms were proposed by Kober [7]. Wang et al. [9] suggesteda fast recursive algorithm for DCT. This paper is aimed at developing a similar algorithm for theDST. The algorithm proposed in this paper forms a complementary to the one suggested in [9]. Aswith Wang’s method, the suggested algorithm requires fewer multipliers and adders, and is equallyefficient as the DCT [9] algorithm. It has been shown in this paper that the recursive structures forDCT proposed by Wang et al. [9] can also be adopted for computation of DST/IDST with minormodification. This aspect can be usefully exploited for computation of discrete Hartley transform(DHT). As is well known, Hou [10], DHT can yield DFT, hence, the proposed structure becomespotential for computation of DCT, DST, DHT as well as DFT.

2. DERIVATION OF RECURSIVE FORMULA FOR COMPUTATION OF DST

DST (type II) of a sequence with length N‡ is defined by

X [k] = akN∑

n=1x[n] sin (2n − 1)�k

2, k = 1, 2, . . . , N (1a)

where

ak =√

2

N�k (1b)

�k =⎧⎨⎩

√12 , k = N

1, k = 1, 2, 3, . . . , N − 1 (1c)

and

�k = k�

N(1d)

2.1. Input folding recursive (IFR) transform algorithm

If we fold the input sequence, Equation (1) can be rewritten as

X [k] = akN/2∑n=1

wk[n] sin (2n − 1)�k2

, k = 1, 2, . . . , N (2a)

where

wk[n] = {x[n] + (−1)k−1x[N − n + 1]} (2b)

‡It is customary to take N as even, and we have followed this assumption in this paper.

Copyright q 2007 John Wiley & Sons, Ltd. Int. J. Circ. Theor. Appl. 2008; 36:441–449DOI: 10.1002/cta

Page 3: Discrete sine transform and its inverse—realization through recursive algorithms

DISCRETE SINE TRANSFORM AND ITS INVERSE 443

Replacing n by (N/2 − n) in Equation (2a), we obtain

X [k] = akN/2∑n=1

wk

[N

2− n

] [sin

k�

2cos

(2n + 1)�k2

− cosk�

2sin

(2n + 1)�k2

], k = 1, 2, . . . , N (3)

Kernels for even and odd values of k are developed as follows.

(i) IFR kernel, k even: When k is even, after some simple mathematical manipulationsEquation (3) may be written as

X [k] = ak(−1)(k/2−1)GN/2(k), k = 2, 4, . . . , N (4a)

where

Gi (k) =i−1∑n=0

wk[i − n] sin(n + 1

2

)�k, k even (4b)

We shall use the following trigonometric identities:

cos(r�) = 2 cos[(r − 1)�] cos � − cos[(r − 2)�] (5a)

sin(r�) = 2 sin[(r − 1)�] cos � − sin[(r − 2)�] (5b)

By algebraic manipulations and by using Equations (5a) and (5b), Equation (4b) can beexpressed in the following recursive form:

Gi (k) = sin�k2

{wk[i] + wk[i − 1]} + 2 cos �kGi−1(k) − Gi−2(k), k even (6)

Thus, GN/2(k) is available when switch SW1 shown in Figure 1 is closed at n = N/2.For one specific value of k = k1, say, the computation of DST coefficient X (k1) takes N/2clock cycles. In other words, the full vector X (k) is computed in (N/2) · (N/2) clockcycles.

(ii) IFR kernel, k odd: when k is odd Equation (3) is expressed as

X [k] = ak(−1)((k−1)/2)HN/2(k), k = 1, 3, . . . , N − 1 (7a)

where

Hi (k) =i−1∑n=0

wk[i − n] cos(n + 1

2

)�k, k odd (7b)

Again from Equation (7b), we can obtain the recursive relation as follows:

Hi (k) = cos�k2

{wk[i] − wk[i − 1]} + 2 cos �k Hi−1(k) − Hi−2(k), k odd (8)

Copyright q 2007 John Wiley & Sons, Ltd. Int. J. Circ. Theor. Appl. 2008; 36:441–449DOI: 10.1002/cta

Page 4: Discrete sine transform and its inverse—realization through recursive algorithms

444 P. JAIN, B. KUMAR AND S. B. JAIN

Figure 1. Recursive structure for computation of DST coefficients X (k) for k = 2, 4, . . . , N ; �k = k�/N .

Figure 2. Recursive structure for computation of DST coefficients X (k) for k = 1, 3, . . . , N−1; �k = k�/N .

Switch SW2 shown in Figure 2 closes at n = N/2. Computation time for X (k) computingwhen k is odd is again the same (i.e. (N/2) · (N/2) clock cycles) as for k even case.

Copyright q 2007 John Wiley & Sons, Ltd. Int. J. Circ. Theor. Appl. 2008; 36:441–449DOI: 10.1002/cta

Page 5: Discrete sine transform and its inverse—realization through recursive algorithms

DISCRETE SINE TRANSFORM AND ITS INVERSE 445

2.2. Recursive output folding algorithms (OFR) for inverse DST

The IDST of the N -point input is given by [2]

x[n]=√

2

N

N∑k=1

�k X [k] sin (2n − 1)�k2

, n = 1, 2, . . . , N (9)

For computing IDST of X [k], i.e. to compute the sequence x(n)= 1, 2, . . . , N , we first obtainthe value of [x(n) − x(N + 1 − n)] from X [k], k even and then obtain [x(n) + x(N + 1 − n)]from X [k], k odd. From Equation (9) expressions for x(n) will be computed for n = 1, 2, . . . , Nas clarified in the sequel.

By folding the data from Equation (9), two formulations are obtained

x[n] − x[N + 1 − n] =√

2

N

N∑k=1

�k X (k)

{sin

(2n−1)�k2

− sin[2N−(2n−1)]�k

2

}

n = 1, 2, . . . ,N

2(10)

x[n] + x[N + 1 − n] =√

2

N

N∑k=1

�k X (k)

{sin

(2n−1)�k2

+ sin[2N−(2n−1)]�k

2

}

n = 1, 2, . . . ,N

2(11)

(i) OFR kernel for the even index sequence X [k]: Applying the trigonometric identities ofEquation (5), Equation (10) can be expressed as

x[n] − x[N + 1 − n] =√

2

N2

N/2∑�=1

�2�X [2�] sin (2n − 1)��

N, n = 1, 2, . . . ,

N

2(12)

It may be observed from Equation (10) that we have used X [k] with k as even, since thevalue of [x(n) − x(N + 1 − n)] becomes zero for odd values of k in X [k].By defining a new sequence V1[�] = �2�X [2�] and replacing � by (N/2−n) in Equation

(12), the following can be easily obtained:

x[n] − x[N + 1 − n]= (−1)n−12

√2

NPN/2(n), n = 1, 2, . . . ,

N

2(13a)

where

Pi (n)=i−1∑�=0

V1[i − 1] cos(��n), n = 1, 2, . . . ,N

2(13b)

and

�n = 2n − 1

N�, n = 1, 2, . . . ,

N

2(13c)

The OFR kernel for even index sequence X [k] is then obtained by following a proceduresimilar to the one used for Equation (7b) to obtain Equation (8). We finally obtain

Pi (n)= V1[i] − V1[i − 1] cos�n + 2 cos�n Pi−1(n) − Pi−2(n), n = 1, 2, . . . ,N

2(14)

Copyright q 2007 John Wiley & Sons, Ltd. Int. J. Circ. Theor. Appl. 2008; 36:441–449DOI: 10.1002/cta

Page 6: Discrete sine transform and its inverse—realization through recursive algorithms

446 P. JAIN, B. KUMAR AND S. B. JAIN

-

Figure 3. Recursive structure for computation of sequence x(n) (i.e. IDST) from the DSTcoefficients X (k); �n = ((2n − 1)/N )�.

(ii) OFR kernel for the odd index sequence X [k]: It may be seen from Equation (11) thatRHS= 0 for k even, and for k odd, putting k = 2� − 1, we arrive at

x[n] + x[N + 1 − n] = 2

√2

N

N/2∑�=0

�2�−1X [2� − 1]

× sin

[(2n − 1)(2� − 1)�

2N

], n = 1, 2, . . . ,

N

2 (15)

The number of summation terms in Equation (15) is half of that in Equation (11). Defining anew sequence V2(�) = �2�−1X2�−1, replacing � by N/2 in Equation (15) and following somewhatlengthy but simple algebraic manipulation, we arrive at

x[n] + x[N + 1 − n] = (−1)n−1 2

√2

NQN/2(n) (16a)

where

Qi (n) =i−1∑�=0

V2(i − �) cos

(� + 1

2

)�n, n = 1, 2, . . . ,

N

2(16b)

Copyright q 2007 John Wiley & Sons, Ltd. Int. J. Circ. Theor. Appl. 2008; 36:441–449DOI: 10.1002/cta

Page 7: Discrete sine transform and its inverse—realization through recursive algorithms

DISCRETE SINE TRANSFORM AND ITS INVERSE 447

Adopting the methodology used for Equation (7b) to obtain Equation (8), we finally obtain

Qi [n]= cos�n

2{V2[i] − V2[i − 1]} + 2 cos�nQi−1(n) − Qi−2(n), n = 1, 2, . . . ,

N

2(17)

Combining Equations (13a) and (16a), we can readily obtain

x[n] =√

2

N(−1)n−1[PN/2(n) + QN/2(n)], n = 1, 2, . . . ,

N

2(18)

x[N + 1 − n] =√

2

N(−1)n−1[QN/2(n) − PN/2(n)], n = 1, 2, . . . ,

N

2 (19)

By multiplying PN/2(n) and QN/2(n) by√

(2/N )(−1)n−1 we obtain 12 [x(n) − x(N + 1 − n)] and

12 [x(n) + x(N + 1 − n)], respectively.Obtaining x(n) and x(N + 1 − n) from Equations (13a) and (16a) is simple, as shown in

Figure 3.We have taken an example of a sequence of length N = 12. The results of various steps as

proposed in this short paper are shown in the Appendix to elucidate the steps followed in theproposed algorithm.

3. DISCUSSION AND CONCLUSION

In this paper efficient recursive algorithms for computation of discrete sine transform X [k] for asequence x(n) and computation of x(n) given X [k] (i.e. IDST) have been proposed. It is seenfrom Figures 1–3 that the structures constitute resonators with poles at ±ej�k , i.e. the poles arelying on the unit circle. These resonators are having resonance frequency of �k and sharperpeak at resonance [13]. The suggested structures are highly suitable for parallel very large-scaleintegration implementation and the proposed structures for computation of DST and IDST haveall the advantages those offered by DCT/IDCT algorithms suggested by Wang et al. [9]. Itis seen from Figures 1–3 that the multiplications needed (assuming parallel processing) in theproposed methodology of computation of X [k] from x(n) or vice versa is N 2/4. No complexmultiplication is an added attraction of the design. It is well known that the wiring scheme forhardware implementation of butterfly-type connections (as in conventional FFT, etc.) is quiteinvolved. Since there are no butterfly/cross-connections in the proposed structures, these are,therefore, highly suitable for hardware implementation.

APPENDIX A

A.1. Computation for DST (i.e. X (k)) from a given sequence of x(n) using MATLAB 6.5 version

Given a sequence for N = 12, we obtain

x(n)=[12 3 14 12 4 35 60 7 8 12 13 15], n = 1, 2, . . . , 12 (A1)

Copyright q 2007 John Wiley & Sons, Ltd. Int. J. Circ. Theor. Appl. 2008; 36:441–449DOI: 10.1002/cta

Page 8: Discrete sine transform and its inverse—realization through recursive algorithms

448 P. JAIN, B. KUMAR AND S. B. JAIN

The desired X (k) computed using Equation (1) is

X (k)=[59.47 −4.34 −14.36 1.22 32.31 −13.56 −17.67 8.48 21.85 −6.65 5.00 7.79]k = 1, 2, . . . , 12 (A2)

k even. By using Equation (6) we obtain G(k) for even value of k:

G(k) =[−10.64 − 3.00 − 33.23 − 20.78 − 16.30 − 27.00], k = 2, 4, 6 (A3)

From Equation (4a) by using the above sequence G(k), we obtain X (k) for even values of k:

X (k) =[−4.34 1.22 − 13.56 8.48 − 6.65 7.79], k = 2, 4, 6 (A4)

k odd. Using Equation (8), for odd value of k, we obtain

H(k) =[145.69 35.18 79.15 43.29 53.54 − 12.24], k = 1, 3, 5 (A5)

From Equation (7a), for odd value of k, using above H(k), we obtain

X (k) =[59.47 − 14.36 32.31 − 17.67 21.85 5.00], k = 1, 3, 5 (A6)

It is seen that from combining the sequences obtained in (A4) and (A6), we get the DST coefficientsas given in (A2).

A.2. Computation of IDST (i.e. x(n)) for the given sequence of X (k) using MATLAB 6.5 version

Given X (k) as in Equation (A2)Using Equations (14) and (17), we first obtain

P(n)=[−3.67 12.24 2.44 − 4.89 − 3.67 30.61], n = 1, 2, . . . , 6 (A7)

and

Q(n) =[33.06 − 19.59 31.84 − 24.49 13.47 − 116.35], n = 1, 2, . . . , 6 (A8)

From Equations (A7), (A8) and (18), we obtain

x(n)=[12.00 3.00 14.00 12.00 4.00 35.00], n = 1, 2, . . . , 6 (A9)

Again using Equations (19), (A7) and (A8) yields

x(N + 1 − n) =[60.00 7.00 8.00 12.00 13.00 15.00], n = 1, 2, . . . , 6, N = 12 (A10)

Clearly, the results from Equation (A9) and (A10) yield the desired IDST, i.e. sequence x(n).It has been confirmed by the authors that the algorithm holds for any even value of N .

ACKNOWLEDGEMENTS

The authors are grateful to the reviewers for their valuable suggestions.

Copyright q 2007 John Wiley & Sons, Ltd. Int. J. Circ. Theor. Appl. 2008; 36:441–449DOI: 10.1002/cta

Page 9: Discrete sine transform and its inverse—realization through recursive algorithms

DISCRETE SINE TRANSFORM AND ITS INVERSE 449

REFERENCES

1. Jain AK. Fast Karhunen–Loeve transform for a class of stochastic processes. IEEE Transactions onCommunications 1976; COM-24:1023–1029.

2. Kekra HB, Solanka JK. Comparative performance of various trigonometric unitary transforms for transform imagecoding. International Journal of Electronics 1978; 44:305–315.

3. Jain AK. A sinusoidal family of unitary transforms. IEEE Transactions on Pattern Analysis and MachineIntelligence 1979; PAMI-I:356–365.

4. Cheng S. Application of the sine-transform method in time-of-flight positron-emission image reconstructionalgorithms. IEEE Transactions on Biomedical Engineering 1985; BME-32:185–192.

5. Rose K, Heiman A, Dinstein I. DCT/DST alternate-transform image coding. GLOBECOM 98, Tokyo, Japan,15–18 November 1987.

6. Chen C-H, Liu B-D, Yang JF. Direct recursive structures for computing Radix—r two dimensionalDCT/IDCT/DST/IDST. IEEE Transactions on CAS 2004; 51(10):2017–2030.

7. Lui KJR, Chiu CT, Kolagotla RK. Optimal unified architectures for the real time computation for time-recursivediscrete sinusoidal transforms. IEEE Transactions on CSVT 1994; 4:168–180.

8. Xi J, Chicharo JF. Computing running DCTs and DSTs base on their second order shift properties. IEEETransactions on CAS-I 2000; 47:779–783.

9. Wang JL, Wu CB, Liu BD, Yang JF. Implementation of the discrete cosine transform and its inverse by recursivestructures. In Proceedings of the IEEE Workshop on Signal Processing System, SiPS 99, vol. 1, 20th–22ndOctober 1999, Taipei, Taiwan, 1999; 120–130.

10. Hou HS. The fast Hartley Transform algorithm. IEEE Transactions on Computers 1987; C-36(2):147–156.11. Rao LR, Yip P. Discrete Cosine Transform Algorithm, Advantage Application. Academic Press: New York, 1990.12. Wang Z, Jullien GA, Miller WC. Recursive algorithms for the forward and inverse discrete cosine transform

with arbitrary length. IEEE Signal Processing letters 1994; 1(7):101–102.13. Proakis JG, Manolakis DG. Digital Signal Processing (3rd edn). Prentice-Hall: Englewood Cliffs, NJ, U.S.A.,

1996.

Copyright q 2007 John Wiley & Sons, Ltd. Int. J. Circ. Theor. Appl. 2008; 36:441–449DOI: 10.1002/cta