2358 views|5 replies

290

Posts

5

Resources
The OP

Application of FFT Fast Fourier Transform on MM32F013 Single Chip [Copy link]

Hello everyone, I am now using FFT fast Fourier transform on MM32F013 to perform frequency division processing on the mixed data read by ADC. The following is the FFT code written by other colleagues before. Because it is a long time ago and the handover is not clear, and the comments are garbled, I wonder if there are any netizens who can understand this part of the code?

#ifdef FAST_FFT

for (i = 0; i < 5; i++) //first, clear all
{
dft_temp1[i] = 0;
dft_temp2[i] = 0;
}

for (i = t_start; i < t_end; i++)
{
p = data + (i * TN); //μ??·??ò?
dft_temp1[0] += (*(p + 1) + *(p + 9) - *(p + 11) - *(p + 19));
dft_temp1[1] += (*(p + 2) + *(p + 8) - *(p + 12) - *(p + 18));
dft_temp1[2] += (*(p + 3) + *(p + 7) - *(p + 13) - *(p + 17));
dft_temp1[3] += (*( p + 4) + *(p + 6) - *(p + 14) - *(p + 16));
dft_temp1[4] += (*(p + 5) - *(p + 15)); //sin

dft_temp2[0] += (*(p + 4) + *(p + 16) - *(p + 6) - *(p + 14));
dft_temp2[1] += (*(p + 3) + *(p + 17) - *(p + 7) - *(p + 13));
dft_temp2[2] += (*(p + 2) + *(p + 18) - *(p + 8) - *(p + 12));
dft_temp2[3] += (*(p + 1) + *(p + 19) - *(p + 9) - *(p + 11));
dft_temp2[4] += (*(p + 0) - *(p + 10)); //cos
//dft_temp2[5] += *(p+15);
}
//sumim = 3164*dft_temp1[0]+6019*dft_temp1[1]+8284*dft_temp1[2]+9739*dft_temp1[3]+10240*dft_temp1[4];
//sumre = 3164*dft_temp2[0]+6019*dft_temp2[ 1]+8284*dft_temp2[2]+9739*dft_temp2[3]+10240*dft_temp2[4];//-dft_temp2[5];

sumim = 316 * dft_temp1[0] + 602 * dft_temp1[1] + 828 * dft_temp1[2] + 974 * dft_temp1[3] + 1024 * dft_temp1[4];
sumre = 316 * dft_temp2[0] + 602 * dft_temp2[ 1] + 828 * dft_temp2[2] + 974 * dft_temp2[3] + 1024 * dft_temp2[4]; //-dft_temp2[5];

#else
p = data; //+ (s16)(t_start*TN); //×¢òaμ??·??ò?
for (i = t_start * TN; i < t_end * TN; i++)
{
sumre += *(p + i) * costab[i % TN];
sumim += *(p + i) * sintab[i % TN];
}
#endif

My problem now is to figure out the Fourier series of this part of the code, and then get the data processing effect I want by modifying the appropriate series. I hope someone familiar with FFT fast Fourier transform can help analyze and solve this problem. Of course, you can also pay for consultation. Thank you!

This post is from MCU

Latest reply

Directly use the routines in DMK. Different functions correspond to different depths. Just pick one for yourself, it's easy. Pay attention to the correspondence between the operation cycle and sampling. Many "computer enthusiasts" do not understand this, which leads to strange calculation results!   Details Published on 2023-3-27 10:05

4002

Posts

0

Resources
2

This section has no beginning or end, and even the data type is unknown. It is part of the function and is useless.

You should check if there is any library available on the official website. If that doesn't work, you can modify the DSP of stm32

This post is from MCU

9264

Posts

9

Resources
3

Is it a bit difficult for a single-chip microcomputer to perform Fourier transform?

This post is from MCU

Comments

Same, now TI is embarrassed to be called DSP  Details Published on 2023-3-23 10:58
Personal signature

在爱好的道路上不断前进,在生活的迷雾中播撒光引


4002

Posts

0

Resources
4
Qintianqintian0303 posted on 2023-3-22 16:44 Is it a bit difficult to use a single-chip microcomputer to perform Fourier transform?

Same, now TI is embarrassed to be called DSP

This post is from MCU

8199

Posts

2

Resources
5

I don't understand and can't help you.

This post is from MCU
Personal signature

默认摸鱼,再摸鱼。2022、9、28


1285

Posts

0

Resources
6

Directly use the routines in DMK. Different functions correspond to different depths.

Just pick one for yourself, it's easy.

Pay attention to the correspondence between the operation cycle and sampling. Many "computer enthusiasts" do not understand this, which leads to strange calculation results!

This post is from MCU
Personal signature

چوآن شـين


Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

    EEWorld
    subscription
    account

    EEWorld
    service
    account

    Automotive
    development
    circle

    Robot
    development
    community

    Copyright © 2005-2025 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
    快速回复 返回顶部 Return list