Вы находитесь на странице: 1из 3
ELECTRONOTES APPLICATION NOTE NO, 359 1016 Hanshaw Rd Ithaca, NY 14850 July 2004 (607)-279-4261 DFT LENGTH CONVERSION Recently released hand-held calculators may offer a FFT function, but often only for lengths that are powers of 2. When lengths that are not powers of 2 are required, itis ‘sometimes suggested that one need only “pad” the original sequence by appending zeros up to an available length. There is some validity to this suggestion, in that if we are only looking for a dense sampling of the DTFT, we will get this. However, it is not true that the correct DFT is obtained directly, nor is it the case that a simple procedure yields the correct DFT. The method below gives the correct DFT, but it would likely be impractical on a calculator ‘Suppose It is desired to obtain the 7-point DFT, X(k), of a 7-point time sequence x(n) by using the &-point DFT, Y(K), of an 8-point time sequence y(n) wher yin) = x(n) n=0;1,...6 (ta) y(7)=0 (1b) Thus y(n) Is simply x(n) with a zero added at the end. That it should be possible to do this is suggested by the fact that both x(n) and y(n) have the exact same DTFT, the DTFT being defined as: Wee) = E win) oF @ ne and 8-point That is, w(a) yields W(e" for all w, so we certainly can obtain 7-pol samplings, the DFT’s of interest, from W(e!). It is useful to employ an example, which will also serve as a counter-example to any notion that X(k) might simply be Y(k) for k=0,1,...6. Suppose x(n) =[1 3 -2 1 -1 3 -3] sothaty(n)=[1 3 -2 1 +1 8 -8 0]. Inthis case we find X(k) and ¥(k) as: ks 0 1 2 3 4 5 6 z XQ) 200 07780889) 00uDs.AB) 162-845} 1624048) OODNEAG O77EOGRG = — Yu)+ 200 1208-471 500-504 2711028) 4200 271-0255) S0O+S 00] 1209874} With the exception of k=0 (the sum of the time sequence) these are different. AN-359 (1) In general we might hope to obtain a matrix A that is 7 rows by 8 columns such that: X= AY (Ba) where we might expect the elements of the matrix A to be complex exponential factors. This is difficult to calculate, so instead, we will approach the problem through the time domain by using first a 7x8 matrix B such that: x= By (8b) is a ‘time limiting” matrix: 10000000 01000000 00100000 B= |00010000 : 4) 00001000 00000100 00000010 We note as well that X = D;x and Y = Dey where Dy and Ds are forward DFT matrices, Applying these matrices to equation (3b) we have: Dr*X=BDstY (6) Or X=D,BDs"Y ® So that using equation (3a) we have: A=D; BDs" ” In our example case we find A as: fos7s -0088:0.083 0.125) o.osss008s] 0.12 —0es-008e] -0.1285) -0.088-0088), (0805-0284) -0.116+0 241) 0.05740 164) 0.12540 060) 0.190-0.088) 0.041-0.084) -0.021-0081) Ooge0011) 0.617-0.400) -0.04740.415} 0.12540 157] 0.13140018] 0070-0058) 0608-0050) 0.05040 09%} 0.1620.037) 0.967-0.504) 0,12640.549| 0.16940 106] 0 102-0.023) 0026-004%), 0.026+0.04%} 0 102+0. 02%; 0.1600.108 01260548) 036740584) 0.16240057) 0050-0031) 0.00610.050,. 0.070+0.056) 0.131-0015) 0.1250.157) 0047-0415) 0.61710.4931 0098-0.011)| 002140081} 0.04140.054) 010810.028) 0125-0080} D087-0.164) -0116-0241) 0.90540.262) ‘This is essentially the solution to our problem. We note immediately that the matrix multiply of equation (a) is going to be more complicated than just doing a DFT. AN-359 (2) ‘An example program using Matlab™ shows the procedure and the example: D?sexp(~j*2*pi* (a7 *n7)/7); Sfoxward T-point DFT Dar= (1/8) *exp(j*2"pi* (n8/*n8)/8); Ginverse 8-point DFT Stime-limiting matrix AsD7*B*DBT; ADFT conversion matrix % test example xe{1 3-2 1-13 -3); yele 01; Kaffe (x); Yat et (y) xtrysAAY. @ note: ¥.’ is NON-conjugate transpose Esabs(X-Xtry.') @ exror The code is straightforward, with the exception that some confusion may result from the fact that the "transpose" operation (necessary to implement the matrix multiply) also conjugates: Accordingly, the ordinary transpose (.) is used rather than the transpose (’. ‘The effect of taking the inverse transform of a conjugate is seen to be a time reversal in the case of a real time function. This is because, by definition of the inverse DFT, Ned win) = (1N) E Wik) eins @ k=0 If we conjugate both sides and also plug in —n for n we have: Ne wen)" =(4/N) EZ Wik)" @ nine o) keo 80 in the case of a real w(n), we get w(-n). This in itself is curious because at first, there seems to be no meaning to negative n, except for n=O, since we usually write 0,1,...N-1.. However, both the DFT and the inverse DFT are periodic with period N, so wCn)=w(Nen). For example, if w(n) is the eight point sequence [0 1 23.4 56 7], the inverse DFT of the conjugate of W(k) is the time sequence [0765432 1]. If w(n) were complex, for example [0 12 +7) 456 7], the inverse DFT of the conjugate of W(k) would be [07654 3-7) 21). ln conclusion, converting DFT size in the circumstances suggested is possible and practical (although probably unnecessary since arbitrary DFT length would likely be available) with a computer-based math program. In the case of the hand-held calculator, the conversion would likely be much more trouble than simply computing the DFT directly without the FFT. As such, perhaps the principle use of these ideas relates to the understanding of the DFT that these exercises offer. EFERENCE: B. Hutchins, “Time-Domain Zero-Padding and the DFT, “ Electronotes, 1. 19, No. 189, August 1997, pp 12-19 AN-359 (3)

Вам также может понравиться