<< Chapter < Page Chapter >> Page >

Hard-coded four-step

This section presents an implementation of the four-step algorithm  [link] that leverages hard-coded sub-transforms to compute larger transforms. The implementation uses an implicit memory transpose (along with vector register transposes) and scales particularly well with VL. In contrast to the fully hard-coded implementation in theprevious section, the four-step implementation requires no new leaf primitives as VL increases, i.e., the code is much the same when V L > 1 as it is when V L = 1 .

The four-step algorithm

A transform of size N is decomposed into a two-dimensional array of size n 1 × n 2 where N = n 1 n 2 . Selecting n 1 = n 2 = N (or close) often obtains the best performance results  [link] . When either of the factors is larger than the other, it is the larger of the two factors that will determine performance, because the larger factor effectively brings the memory wall closer. The four steps of the algorithm are:

  1. Compute n 1 FFTs of length n 2 along the columns of the array;
  2. Multiply each element of the array with ω N i j , where i and j are the array coordinates;
  3. Transpose the array;
  4. Compute n 2 FFTs of length n 1 along the columns of the array.

For this out-of-place implementation, steps 2 and 3 are performed as part of step 1. Step 1 reads data from the input array and computes the FFTs, but before storing the data in the final pass, it is multiplied by the twiddle factors from step 2. After this, the data is stored to rows in the output array, and thus the transpose of step 3 is performed implicitly. Step 4 is then computed as usual: FFTs are computed along the columns of the output array.

This method of computing the four-step algorithm in two steps requires only minor modifications in order to support multiple vector lengths: with V L > 1 , multiple columns are read and computed in parallel without modification of the code, but before storing multiple columns of data to rows, a register transpose is required.

Vector length 1

When V L = 1 , three hard-coded FFTs are elaborated.

  1. FFT of length n 2 with stride n 1 × 2 for the first column of step 1;
  2. FFT of length n 2 with stride n 1 × 2 and twiddle multiplications on outputs – for all other columns of step 1;
  3. FFT of length n 1 with stride n 2 × 2 for columns in step 4.

In order to generate the code for the four-step sub-transforms, some minor modifications are made to the fully hard-coded code generator that was presented in the previous section.

The first FFT is used to handle the first column of step 1, where there are no twiddle factor multiplications because one of the array coordinates for step 2 is zero, and thus ω N 0 is unity. This FFT may be elaborated as in "Vector length 1" with the addition of a stride factor for the input address calculation. The second FFT is elaborated as per the first FFT, but with the addition of twiddle factor multiplications oneach register prior to the store operations. The third FFT is elaborated as per the first FFT, but with strided input and output addresses.

const SFFT_D __attribute__ ((aligned(32))) *LUT; const SFFT_D *pLUT;void sfft_dcf64_fs_x1_0(sfft_plan_t *p, const void *vin, void *vout){   const SFFT_D *in = vin;  SFFT_D *out = vout;   SFFT_R r0,r1,r2,r3,r4,r5,r6,r7;  L_4(in+0,in+64,in+32,in+96,&r0,&r1,&r2,&r3);   L_2(in+16,in+80,in+112,in+48,&r4,&r5,&r6,&r7);   K_0(&r0,&r2,&r4,&r6);   S_4(r0,r2,r4,r6,out+0,out+4,out+8,out+12);  K_N(VLIT2(0.7071,0.7071),VLIT2(0.7071,-0.7071),&r1,&r3,&r5,&r7);   S_4(r1,r3,r5,r7,out+2,out+6,out+10,out+14);} void sfft_dcf64_fs_x1_n(sfft_plan_t *p, const void *vin, void *vout){  const SFFT_D *in = vin;   SFFT_D *out = vout;  SFFT_R r0,r1,r2,r3,r4,r5,r6,r7;   L_4(in+0,in+64,in+32,in+96,&r0,&r1,&r2,&r3);   L_2(in+16,in+80,in+112,in+48,&r4,&r5,&r6,&r7);   K_0(&r0,&r2,&r4,&r6);   r2 = MUL(r2,LOAD(pLUT+4),LOAD(pLUT+6));  r4 = MUL(r4,LOAD(pLUT+12),LOAD(pLUT+14));   r6 = MUL(r6,LOAD(pLUT+20),LOAD(pLUT+22));  S_4(r0,r2,r4,r6,out+0,out+4,out+8,out+12);   K_N(VLIT2(0.7071,0.7071),VLIT2(0.7071,-0.7071),&r1,&r3,&r5,&r7);   r1 = MUL(r1,LOAD(pLUT+0),LOAD(pLUT+2));  r3 = MUL(r3,LOAD(pLUT+8),LOAD(pLUT+10));  r5 = MUL(r5,LOAD(pLUT+16),LOAD(pLUT+18));   r7 = MUL(r7,LOAD(pLUT+24),LOAD(pLUT+26));  S_4(r1,r3,r5,r7,out+2,out+6,out+10,out+14);   pLUT += 28;} void sfft_dcf64_fs_x2(sfft_plan_t *p, const void *vin, void *vout){  const SFFT_D *in = vin;   SFFT_D *out = vout;  SFFT_R r0,r1,r2,r3,r4,r5,r6,r7;   L_4(in+0,in+64,in+32,in+96,&r0,&r1,&r2,&r3);   L_2(in+16,in+80,in+112,in+48,&r4,&r5,&r6,&r7);   K_0(&r0,&r2,&r4,&r6);   S_4(r0,r2,r4,r6,out+0,out+32,out+64,out+96);  K_N(VLIT2(0.7071,0.7071),VLIT2(0.7071,-0.7071),&r1,&r3,&r5,&r7);   S_4(r1,r3,r5,r7,out+16,out+48,out+80,out+112);} void sfft_dcf64_fs(sfft_plan_t *p, const void *vin, void *vout) {  const SFFT_D *in = vin;   SFFT_D *out = vout;  pLUT =  LUT;   int i;  sfft_dcf64_fs_x1_0(p, in, out);   for(i=1;i<8;i++) sfft_dcf64_fs_x1_n(p, in+(i*2), out+(i*16));   for(i=0;i<8;i++) sfft_dcf64_fs_x2(p, out+(i*2), out+(i*2)); }
Hard-coded four-step VL-1 size-64 FFT

Questions & Answers

A golfer on a fairway is 70 m away from the green, which sits below the level of the fairway by 20 m. If the golfer hits the ball at an angle of 40° with an initial speed of 20 m/s, how close to the green does she come?
Aislinn Reply
cm
tijani
what is titration
John Reply
what is physics
Siyaka Reply
A mouse of mass 200 g falls 100 m down a vertical mine shaft and lands at the bottom with a speed of 8.0 m/s. During its fall, how much work is done on the mouse by air resistance
Jude Reply
Can you compute that for me. Ty
Jude
what is the dimension formula of energy?
David Reply
what is viscosity?
David
what is inorganic
emma Reply
what is chemistry
Youesf Reply
what is inorganic
emma
Chemistry is a branch of science that deals with the study of matter,it composition,it structure and the changes it undergoes
Adjei
please, I'm a physics student and I need help in physics
Adjanou
chemistry could also be understood like the sexual attraction/repulsion of the male and female elements. the reaction varies depending on the energy differences of each given gender. + masculine -female.
Pedro
A ball is thrown straight up.it passes a 2.0m high window 7.50 m off the ground on it path up and takes 1.30 s to go past the window.what was the ball initial velocity
Krampah Reply
2. A sled plus passenger with total mass 50 kg is pulled 20 m across the snow (0.20) at constant velocity by a force directed 25° above the horizontal. Calculate (a) the work of the applied force, (b) the work of friction, and (c) the total work.
Sahid Reply
you have been hired as an espert witness in a court case involving an automobile accident. the accident involved car A of mass 1500kg which crashed into stationary car B of mass 1100kg. the driver of car A applied his brakes 15 m before he skidded and crashed into car B. after the collision, car A s
Samuel Reply
can someone explain to me, an ignorant high school student, why the trend of the graph doesn't follow the fact that the higher frequency a sound wave is, the more power it is, hence, making me think the phons output would follow this general trend?
Joseph Reply
Nevermind i just realied that the graph is the phons output for a person with normal hearing and not just the phons output of the sound waves power, I should read the entire thing next time
Joseph
Follow up question, does anyone know where I can find a graph that accuretly depicts the actual relative "power" output of sound over its frequency instead of just humans hearing
Joseph
"Generation of electrical energy from sound energy | IEEE Conference Publication | IEEE Xplore" ***ieeexplore.ieee.org/document/7150687?reload=true
Ryan
what's motion
Maurice Reply
what are the types of wave
Maurice
answer
Magreth
progressive wave
Magreth
hello friend how are you
Muhammad Reply
fine, how about you?
Mohammed
hi
Mujahid
A string is 3.00 m long with a mass of 5.00 g. The string is held taut with a tension of 500.00 N applied to the string. A pulse is sent down the string. How long does it take the pulse to travel the 3.00 m of the string?
yasuo Reply
Who can show me the full solution in this problem?
Reofrir Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Computing the fast fourier transform on simd microprocessors. OpenStax CNX. Jul 15, 2012 Download for free at http://cnx.org/content/col11438/1.2
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Computing the fast fourier transform on simd microprocessors' conversation and receive update notifications?

Ask