16-point-based 4dit-fft implementation

Source: Internet
Author: User

The idea of the C program is roughly to clarify, usually not programming, a lot of minor issues, but fortunately accompanied by a mother-in-law, quickly resolved. Draw a 16-point FFT. This is not an optimized program, but it should be the case for a clear idea. The next step is FPGA. Japanese words are not backed up yet. This week is messy, and every week is messy.

Similar to the previous program, the four-point data input is divided into eight equations in the real imaginary part.

 

About the rotation factor, WNP = e ^ (-J * 2 * pI * P/N) = cos (-J * 2 * pI * P/N) + J * sin (-J * 2 * pI * P/N), cos [p] = cos (-J * 2 * pI * P/N) using the lookup method ), sin [p] = J * sin (-J * 2 * pI * P/N ). Because the base 4fft of 16 points has two levels of operations, the second level uses the most types of rotation factors, which are 4 ^ (2-1) = 4, so four WNP types need to be calculated, each type contains WNP and wn2p
, Wn3p. Therefore, a total of 3x4 = 12 WNP records need to be calculated. Each part contains the sin value and cos value. There are 12 groups of values.

 

DATAR [k] is the real part of the first input data, and DATAR [K + B] is the real part of the second input data, which is separated by B data, and so on.

The part of the FFT operation is as follows. Is there any ~~ :

 

Tr = DATAR [k]; TBR = DATAR [K + B]; t2br = DATAR [K + 2 * B]; t3br = DATAR [K + 3 * B];
Ti = datai [k]; Trauma = datai [K + B]; t2bi = datai [K + 2 * B]; t3bi = datai [K + 3 * B];

DATAR [k] = tr + TBR * Cos [p]-trauma * sin [p] + t2br * Cos [2 * p]-t2bi * sin [2 * p] + t3br * Cos [3 * p]-t3bi * sin [3 * p];
Datai [k] = Ti + TBR * sin [p] + trauma * Cos [p] + t2br * sin [2 * p] + t2bi * Cos [2 * p] + t3br * sin [3 * p] + t2bi * Cos [3 * p];

DATAR [K + B] = tr + TBR * sin [p] + trauma * Cos [p]-t2br * Cos [2 * p] + t2bi * sin [2 * p] -t3br * sin [3 * p]-t3bi * Cos [3 * p];
Datai [K + B] = Ti-TBR * Cos [p] + trauma * sin [p]-t2br * sin [2 * p]-t2bi * Cos [2 * p] + t3br * Cos [3 * p]-t3bi * sin [3 * p];

DATAR [K + 2 * B] = tr-TBR * Cos [p] + trauma * sin [p] + t2br * Cos [2 * p]-t2bi * sin [2 * p]-t3br * Cos [3 * p] + t3bi * sin [3 * p];
Datai [K + 2 * B] = Ti-TBR * sin [p]-trauma * Cos [p] + t2br * sin [2 * p] + t2bi * Cos [2 * p]-t3br * sin [3 * p]-t3bi * Cos [3 * p];

DATAR [K + 3 * B] = tr-TBR * sin [p]-trauma * Cos [p]-t2br * Cos [2 * p] + t2bi * sin [2 * p] + t3br * sin [3 * p] + t3bi * Cos [3 * p];
Datai [K + 3 * B] = Ti + TBR * Cos [p]-trauma * sin [p]-t2br * sin [2 * p]-t2bi * Cos [2 * p]-t3br * Cos [3 * p] + t3bi * sin [3 * p];

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.