矿石收音机论坛

 找回密码
 加入会员

QQ登录

只需一步,快速开始

搜索
查看: 2876|回复: 9

各位老师怎样用小学文化理解FFT ?

[复制链接]
     
发表于 2017-11-27 21:41:02 | 显示全部楼层 |阅读模式

FFT如何工作.pdf (408.28 KB, 下载次数: 187)

这本书有没有中文版?看了看根本看不懂里面讲什么啊,基础太差了。发现想做个东西没有基础理论知识根本做不出来,如果只是调用官方库不懂里面代码的原理感觉很发虚。

截图_2017-11-27_21-22-22.png

比如上面这个图是什么意思? 调换采集到的数据有什么作用??
     
发表于 2017-11-29 00:47:40 | 显示全部楼层
fft 快速傅立叶变换

搜  如果看了此文你还不懂傅里叶变换,那就过来掐死我吧【完整版】
回复 支持 反对

使用道具 举报

     
 楼主| 发表于 2017-11-29 21:37:45 | 显示全部楼层
la45088d1 发表于 2017-11-29 08:06
千万不要想自己拿汇编写FFT',你会发现,你的效率可能比官方库更烂。
为了加速,你必须:1,储存足够的三 ...

关键现在一点也不懂,连用库也不会用,本论坛的xjw01老师就很精通算法,他就能自己写FFT的程序。

按照我这个文化程度还不如研究研究怎么种田产量高,这几天浇地、榨油还砌了个锅台外加支了个炉子,这虚拟的东西又放下了,能不能用起来真还难说。我现在最拿手的技术就是盘炕,虽然样子丑但是好烧,我已经掌握了盘炕的核心技术,这写程序什么的农村实在是用不上。
回复 支持 反对

使用道具 举报

     
发表于 2017-12-1 11:41:39 | 显示全部楼层
本帖最后由 scu319hy 于 2017-12-1 11:44 编辑

搞明白傅立叶变换是干什么的就可以了,可以简单理解为坐标系的变换
比如:离散傅立叶变换在数学上就是把一个数列转化成为与它们对应的多项式系数的过程。多项式的每一项都对应着一种特定的周期(频率),它们的系数则是在这一周期上的信号强度。在物理上可以表现为时域到频域的变换。也就是把一个信号随时间变化的强度数据转化成为它随频率变化的强度数据。大致如此。
至于如何写一个好的程序来实现这种换则更多的是计算机问题。
回复 支持 反对

使用道具 举报

     
 楼主| 发表于 2017-12-1 12:09:47 | 显示全部楼层
scu319hy 发表于 2017-12-1 11:41
搞明白傅立叶变换是干什么的就可以了,可以简单理解为坐标系的变换
比如:离散傅立叶变换在数学上就是把一 ...

现在只知道个时域变频域,具体怎么变的还是两眼一抹黑,我数学只有小学水平,初中上了几年都玩了连书都没订,三角函数都没学过,看到公式就头大。
回复 支持 反对

使用道具 举报

     
 楼主| 发表于 2017-12-1 12:12:57 | 显示全部楼层
我在网上找了个简单16点的程序,C语言差看不太懂,懂C语言的老师看看这个是FFT的程序么,如果是具体是怎么变的啊?

  1. #include <stdio.h>
  2. #define SIN_2PI_16 0.38268343236508978
  3. #define SIN_4PI_16 0.707106781186547460
  4. #define SIN_6PI_16 0.923879532511286740
  5. #define C_P_S_2PI_16 1.30656296487637660
  6. #define C_M_S_2PI_16 0.54119610014619690
  7. #define C_P_S_6PI_16 1.3065629648763766
  8. #define C_M_S_6PI_16 -0.54119610014619690

  9. /* INPUT: float input[16], float output[16] */
  10. /* OUTPUT: none */
  11. /* EFFECTS:  Places the 16 point fft of input in output in a strange */
  12. /* order using 10 real multiplies and 79 real adds. */
  13. /* Re{F[0]}= out0 */
  14. /* Im{F[0]}= 0 */
  15. /* Re{F[1]}= out8 */
  16. /* Im{F[1]}= out12 */
  17. /* Re{F[2]}= out4 */
  18. /* Im{F[2]}= -out6 */
  19. /* Re{F[3]}= out11 */
  20. /* Im{F[3]}= -out15 */
  21. /* Re{F[4]}= out2 */
  22. /* Im{F[4]}= -out3 */
  23. /* Re{F[5]}= out10 */
  24. /* Im{F[5]}= out14 */
  25. /* Re{F[6]}= out5 */
  26. /* Im{F[6]}= -out7 */
  27. /* Re{F[7]}= out9 */
  28. /* Im{F[7]}= -out13 */
  29. /* Re{F[8]}= out1 */
  30. /* Im{F[8]}=0 */
  31. /* F[9] through F[15] can be found by using the formula */
  32. /* Re{F[n]}=Re{F[(16-n)mod16]} and Im{F[n]}= -Im{F[(16-n)mod16]} */

  33. /* Note using temporary variables to store intermediate computations */
  34. /* in the butterflies might speed things up.  When the current version */
  35. /* needs to compute a=a+b, and b=a-b, I do a=a+b followed by b=a-b-b.  */
  36. /* So practically everything is done in place, but the number of adds */
  37. /* can be reduced by doinc c=a+b followed by b=a-b. */

  38. /* The algorithm behind this program is to find F[2k] and F[4k+1] */
  39. /* seperately.  To find F[2k] we take the 8 point Real FFT of x[n]+x[n+8] */
  40. /* for n from 0 to 7.  To find F[4k+1] we take the 4 point Complex FFT of */
  41. /* exp(-2*pi*j*n/16)*{x[n] - x[n+8] + j(x[n+12]-x[n+4])} for n from 0 to 3.*/

  42. void R16SRFFT(float input[16],float output[16] ) {
  43.   float temp, out0, out1, out2, out3, out4, out5, out6, out7, out8;
  44.   float out9,out10,out11,out12,out13,out14,out15;

  45.   out0=input[0]+input[8]; /* output[0 through 7] is the data that we */
  46.   out1=input[1]+input[9]; /* take the 8 point real FFT of. */
  47.   out2=input[2]+input[10];
  48.   out3=input[3]+input[11];
  49.   out4=input[4]+input[12];
  50.   out5=input[5]+input[13];
  51.   out6=input[6]+input[14];
  52.   out7=input[7]+input[15];



  53.   out8=input[0]-input[8];   /* inputs 8,9,10,11 are */
  54.   out9=input[1]-input[9];   /* the Real part of the */
  55.   out10=input[2]-input[10]; /* 4 point Complex FFT inputs.*/
  56.   out11=input[3]-input[11];
  57.   out12=input[12]-input[4]; /* outputs 12,13,14,15 are */
  58.   out13=input[13]-input[5]; /* the Imaginary pars of  */
  59.   out14=input[14]-input[6]; /* the 4 point Complex FFT inputs.*/
  60.   out15=input[15]-input[7];

  61.   /*First we do the "twiddle factor" multiplies for the 4 point CFFT */
  62.   /*Note that we use the following handy trick for doing a complex */
  63.   /*multiply:  (e+jf)=(a+jb)*(c+jd) */
  64.   /*   e=(a-b)*d + a*(c-d)   and    f=(a-b)*d + b*(c+d)  */

  65.   /* C_M_S_2PI/16=cos(2pi/16)-sin(2pi/16) when replaced by macroexpansion */
  66.   /* C_P_S_2PI/16=cos(2pi/16)+sin(2pi/16) when replaced by macroexpansion */
  67.   /* (SIN_2PI_16)=sin(2pi/16) when replaced by macroexpansion */
  68.   temp=(out13-out9)*(SIN_2PI_16);
  69.   out9=out9*(C_P_S_2PI_16)+temp;
  70.   out13=out13*(C_M_S_2PI_16)+temp;
  71.   
  72.   out14*=(SIN_4PI_16);
  73.   out10*=(SIN_4PI_16);
  74.   out14=out14-out10;
  75.   out10=out14+out10+out10;
  76.   
  77.   temp=(out15-out11)*(SIN_6PI_16);
  78.   out11=out11*(C_P_S_6PI_16)+temp;
  79.   out15=out15*(C_M_S_6PI_16)+temp;

  80.   /* The following are the first set of two point butterfiles */
  81.   /* for the 4 point CFFT */

  82.   out8+=out10;
  83.   out10=out8-out10-out10;

  84.   out12+=out14;
  85.   out14=out12-out14-out14;

  86.   out9+=out11;
  87.   out11=out9-out11-out11;

  88.   out13+=out15;
  89.   out15=out13-out15-out15;

  90.   /*The followin are the final set of two point butterflies */
  91.   output[1]=out8+out9;
  92.   output[7]=out8-out9;

  93.   output[9]=out12+out13;
  94.   output[15]=out13-out12;
  95.   
  96.   output[5]=out10+out15;        /* implicit multiplies by */
  97.   output[13]=out14-out11;        /* a twiddle factor of -j */                           
  98.   output[3]=out10-out15;  /* implicit multiplies by */
  99.   output[11]=-out14-out11;  /* a twiddle factor of -j */

  100.   
  101.   /* What follows is the 8-point FFT of points output[0-7] */
  102.   /* This 8-point FFT is basically a Decimation in Frequency FFT */
  103.   /* where we take advantage of the fact that the initial data is real*/

  104.   /* First set of 2-point butterflies */
  105.    
  106.   out0=out0+out4;
  107.   out4=out0-out4-out4;
  108.   out1=out1+out5;
  109.   out5=out1-out5-out5;
  110.   out2+=out6;
  111.   out6=out2-out6-out6;
  112.   out3+=out7;
  113.   out7=out3-out7-out7;

  114.   /* Computations to find X[0], X[4], X[6] */
  115.   
  116.   output[0]=out0+out2;
  117.   output[4]=out0-out2;
  118.   out1+=out3;
  119.   output[12]=out3+out3-out1;

  120.   output[0]+=out1;  /* Real Part of X[0] */
  121.   output[8]=output[0]-out1-out1; /*Real Part of X[4] */
  122.   /* out2 = Real Part of X[6] */
  123.   /* out3 = Imag Part of X[6] */
  124.   
  125.   /* Computations to find X[5], X[7] */

  126.   out5*=SIN_4PI_16;
  127.   out7*=SIN_4PI_16;
  128.   out5=out5-out7;
  129.   out7=out5+out7+out7;

  130.   output[14]=out6-out7; /* Imag Part of X[5] */
  131.   output[2]=out5+out4; /* Real Part of X[7] */
  132.   output[6]=out4-out5; /*Real Part of X[5] */
  133.   output[10]=-out7-out6; /* Imag Part of X[7] */

  134. }

  135. void main() {
  136.   float data[16];
  137.   float output[16];
  138.   float zero=0;

  139.   printf("\ntype 16 point input vector\n");
  140.   scanf("%f %f %f %f %f %f %f %f %f %f %f %f %f %f %f %f",&data[0],&data[1],&data[2],&data[3],&data[4],&data[5],&data[6],&data[7],&data[8],&data[9],&data[10],&data[11],&data[12],&data[13],&data[14],&data[15]);
  141.   
  142.   R16SRFFT(data,output);
  143.   printf("\nresult is:\n");
  144.   printf("k,\t\tReal Part\t\tImaginary Part\n");
  145.     printf("0\t\t%.9f\t\t%.9f\n",output[0],zero);
  146.   printf("1\t\t%.9f\t\t%.9f\n",output[1],output[9]);
  147.   printf("2\t\t%.9f\t\t%.9f\n",output[2],output[10]);
  148.   printf("3\t\t%.9f\t\t%.9f\n",output[3],output[11]);
  149.   printf("4\t\t%.9f\t\t%.9f\n",output[4],output[12]);
  150.   printf("5\t\t%.9f\t\t%.9f\n",output[5],output[13]);
  151.   printf("6\t\t%.9f\t\t%.9f\n",output[6],output[14]);
  152.   printf("7\t\t%.9f\t\t%.9f\n",output[7],output[15]);
  153.   printf("8\t\t%.9f\t\t%.9f\n",output[8],zero);
  154.   printf("9\t\t%.9f\t\t%.9f\n",output[7],-output[15]);
  155.   printf("10\t\t%.9f\t\t%.9f\n",output[6],-output[14]);
  156.   printf("11\t\t%.9f\t\t%.9f\n",output[5],-output[13]);
  157.   printf("12\t\t%.9f\t\t%.9f\n",output[4],-output[12]);
  158.   printf("13\t\t%.9f\t\t%.9f\n",output[3],-output[11]);
  159.   printf("14\t\t%.9f\t\t%.9f\n",output[2],-output[9]);
  160.   printf("15\t\t%.9f\t\t%.9f\n",output[1],-output[8]);
  161. }

复制代码
回复 支持 反对

使用道具 举报

     
发表于 2017-12-1 17:13:37 | 显示全部楼层
本帖最后由 scu319hy 于 2017-12-1 17:24 编辑
yjmwxwx 发表于 2017-12-1 12:09
现在只知道个时域变频域,具体怎么变的还是两眼一抹黑,我数学只有小学水平,初中上了几年都玩了连书都没 ...


从物理的角度好理解,一段随时间变化的信号数据,用不同的滤波电路分频并积分后,就得到了它在不同频点的信号强度。这就完成了变换。
把这个过程用数学方法表示出来,就是各种变换算法。离散傅里叶变换的具体实现我没写过。但离散余弦变换我写过,基本上就是和不同的余弦值相乘并求和...

评分

1

查看全部评分

回复 支持 反对

使用道具 举报

     
 楼主| 发表于 2017-12-1 17:48:43 | 显示全部楼层
scu319hy 发表于 2017-12-1 17:13
从物理的角度好理解,一段随时间变化的信号数据,用不同的滤波电路分频并积分后,就得到了它在不同频点 ...

这个比较通俗易懂,等研究研究别人的程序具体代码怎么实现的,一定要自己写个试试
回复 支持 反对

使用道具 举报

     
 楼主| 发表于 2017-12-3 04:42:39 | 显示全部楼层
他这个程序到底是干什么的啊? 输入0-15执行后如下图
fudian.png

小数这么多不好算都改成5位整数后如下图
zhengshu.png

放到单片机后基本能和改成正数后对应起来
0x20000200开始对应output0-output15
截图_2017-12-03_04-29-46.png
回复 支持 反对

使用道具 举报

     
 楼主| 发表于 2017-12-3 04:50:15 | 显示全部楼层
这程序真是看不懂,怎么有正的还有负的,啥意思啊?

直接搬运到单片机,这程序写的效率也太低太差了,看样子还是官方那个好,等再试试官方库那个。

这程序写的太垃圾了。。

  1.         @ stm32f030f4p6 asm
  2.          .thumb                 
  3.          .syntax unified
  4. .section .data       
  5.                .equ STACKINIT,                 0x20001000

  6.         .equ shumaguanma,        0x20000000
  7.         .equ temp,                0x200000fc
  8.         .equ fftshuchu,                0x20000100
  9.         .equ fftshuchu1,        0x20000200
  10. sin_2pi_16:        .long                     38268
  11. sin_4pi_16:        .long                70710
  12. sin_6pi_16:        .long                92387
  13. c_p_s_2pi_16:        .long               130656
  14. c_m_s_2pi_16:        .long                54119
  15. c_p_s_6pi_16:        .long               130656
  16. c_m_s_6pi_16:        .long                0xffff2c98
  17. fftshuru:        .long 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15
  18. shumaguanmabiao:
  19.         .int 0xfc,0x60,0xda,0xf2,0x66,0xb6,0xbe,0xe0,0xfe,0xf6
  20. shumaguanshuaxinbiao:
  21.         .int 0xfe00,0xfd00,0xfb00,0xf700,0xef00,0xdf00,0xbf00,0x7f00,0
  22. .section .text
  23. vectors:        
  24.         .word STACKINIT         
  25.         .word _start + 1        
  26.         .word _nmi_handler + 1  
  27.         .word _hard_fault  + 1  
  28.         .word 0
  29.         .word 0   
  30.         .word 0
  31.         .word 0
  32.         .word 0
  33.         .word 0
  34.         .word 0
  35.         .word _svc_handler +1
  36.         .word 0
  37.         .word 0
  38.         .word _pendsv_handler +1
  39.         .word 0 @_systick +1               @ 15   
  40.         .word 0     @ _wwdg +1          @ 0
  41.         .word 0     @_pvd +1            @ 1
  42.         .word 0     @_rtc +1            @ 2
  43.         .word 0     @_flash +1          @ 3
  44.         .word 0     @ _rcc + 1          @ 4
  45.         .word 0      @_exti0_1  +1      @ 5
  46.         .word 0      @ _exti2_3 +1      @ 6
  47.         .word 0       @_exti4_15 +1     @ 7
  48.         .word 0                         @ 8
  49.         .word 0         @_dma1_1  +1    @ 9
  50.         .word 0    @_dma1_2_3 +1        @ 10
  51.         .word 0       @_dma1_4_5 +1     @ 11
  52.         .word 0 @_adc1 +1          @ 12
  53.         .word 0       @_tim1_brk_up +1  @ 13
  54.         .word 0        @ _tim1_cc +1    @ 14
  55.         .word 0         @_tim2 +1       @ 15
  56.         .word 0          @_tim3 +1      @ 16
  57.         .word 0                         @ 17
  58.         .word 0                                @ 18
  59.         .word @_tim14 +1    @ 19
  60.         .word 0                         @ 20
  61.         .word 0         @_tim16 +1      @ 21
  62.         .word 0         @_tim17 +1      @ 22
  63.         .word 0          @_i2c   +1     @ 23
  64.         .word 0                         @ 24
  65.         .word 0           @_spi   +1    @ 25
  66.         .word 0                         @ 26
  67.         .word 0         @_usart1 +1     @ 27
  68.        
  69. _start:
  70. shizhong:
  71.         ldr r0, = 0x40021000 @ rcc
  72.         ldr r2, = 0x40022000   @FLASH访问控制
  73.         movs r1, # 0x32
  74.         str r1, [r2]           @FLASH缓冲 缓冲开启
  75.         ldr r0, = 0x40021000 @ rcc
  76.         ldr r1, = 0x100002
  77.         str r1, [r0, # 0x04]
  78.         ldr r1, = 0x1000001
  79.         str r1, [r0]
  80. dengrc:
  81.         ldr r1, [r0]
  82.         lsls r1, # 30
  83.         bpl dengrc
  84. dengpll:
  85.         ldr r1, [r0]
  86.         lsls r1, # 6
  87.         bpl dengpll
  88.         @0x34时钟控制寄存器 2 (RCC_CR2)
  89.         movs r1, # 0x01
  90.         str r1, [r0, # 0x34]  @ HSI开14M时钟
  91. dengdai14mshizhongwending:
  92.         ldr r1, [r0, # 0x34]
  93.         lsls r1, r1, # 30     @ 左移30位
  94.         bpl dengdai14mshizhongwending  @ 等待14M时钟稳定

  95. neicunqingling:
  96.         ldr r0, = 0x20000000
  97.         movs r1, # 0
  98.         ldr r3, = 0x1000
  99. neicunqinglingxunhuan:
  100.         subs r3, # 4
  101.         str r1, [r0, r3]
  102.         bne neicunqinglingxunhuan

  103.        
  104.         ldr r0, = fftshuru
  105.         ldr r1, = fftshuchu

  106.         @实
  107.         ldr r2, [r0]
  108.         ldr r3, [r0, # 0x20]
  109.         adds r4, r2, r3
  110.         str r4, [r1]

  111.         ldr r2, [r0, # 0x04]
  112.         ldr r3, [r0, # 0x24]
  113.         adds r4, r2, r3
  114.         str r4, [r1, # 0x04]

  115.         ldr r2, [r0, # 0x08]
  116.         ldr r3, [r0, # 0x28]
  117.         adds r4, r2, r3
  118.         str r4, [r1, # 0x08]

  119.         ldr r2, [r0, # 0x0c]
  120.         ldr r3, [r0, # 0x2c]
  121.         adds r4, r2, r3
  122.         str r4, [r1, # 0x0c]

  123.         ldr r2, [r0, # 0x10]
  124.         ldr r3, [r0, # 0x30]
  125.         adds r4, r2, r3
  126.         str r4, [r1, # 0x10]

  127.         ldr r2, [r0, # 0x14]
  128.         ldr r3, [r0, # 0x34]
  129.         adds r4, r2, r3
  130.         str r4, [r1, # 0x14]

  131.         ldr r2, [r0, # 0x18]
  132.         ldr r3, [r0, # 0x38]
  133.         adds r4, r2, r3
  134.         str r4, [r1, # 0x18]

  135.         ldr r2, [r0, # 0x1c]
  136.         ldr r3, [r0, # 0x3c]
  137.         adds r4, r2, r3
  138.         str r4, [r1, # 0x1c]

  139.         @虚
  140.         ldr r2, [r0]
  141.         ldr r3, [r0, # 0x20]
  142.         subs r4, r2, r3
  143.         str r4, [r1, # 0x20]

  144.         ldr r2, [r0, # 0x04]
  145.         ldr r3, [r0, # 0x24]
  146.         subs r4, r2, r3
  147.         str r4, [r1, # 0x24]

  148.         ldr r2, [r0, # 0x08]
  149.         ldr r3, [r0, # 0x28]
  150.         subs r4, r2, r3
  151.         str r4, [r1, # 0x28]

  152.         ldr r2, [r0, # 0x0c]
  153.         ldr r3, [r0, # 0x2c]
  154.         subs r4, r2, r3
  155.         str r4, [r1, # 0x2c]

  156.         ldr r2, [r0, # 0x30]
  157.         ldr r3, [r0, # 0x10]
  158.         subs r4, r2, r3
  159.         str r4, [r1, # 0x30]

  160.         ldr r2, [r0, # 0x34]
  161.         ldr r3, [r0, # 0x14]
  162.         subs r4, r2, r3
  163.         str r4, [r1, # 0x34]

  164.         ldr r2, [r0, # 0x38]
  165.         ldr r3, [r0, # 0x18]
  166.         subs r4, r2, r3
  167.         str r4, [r1, # 0x38]

  168.         ldr r2, [r0, # 0x3c]
  169.         ldr r3, [r0, # 0x1c]
  170.         subs r4, r2, r3
  171.         str r4, [r1, # 0x3c]

  172.         @@@@@@@@@@@@@@@
  173.        
  174.         ldr r2, [r1, # 0x34]
  175.         ldr r3, [r1, # 0x24]
  176.         ldr r4, = sin_2pi_16
  177.         ldr r4, [r4]
  178.         subs r2, r2, r3
  179.         muls r2, r2, r4
  180.         mov r5, r2                      @
  181.        
  182.         ldr r2, [r1, # 0x24]
  183.         ldr r6, = c_p_s_2pi_16
  184.         ldr r6, [r6]
  185.         muls r2, r2, r6
  186.         adds r2, r2, r5
  187.         str r2, [r1, # 0x24]          @ 0x17c

  188.         ldr r2, [r1, # 0x34]
  189.         ldr r6, = c_m_s_2pi_16
  190.         ldr r6, [r6]
  191.         muls r2, r2, r6
  192.         adds r2, r2, r5
  193.         str r2, [r1, # 0x34]        @ 0x188

  194.         ldr r2, [r1, # 0x38]
  195.         ldr r6, = sin_4pi_16
  196.         ldr r6, [r6]
  197.         muls r2, r2, r6           @ 0x190

  198.         ldr r3, [r1, # 0x28]
  199.         muls r3, r3, r6          @ 0x194

  200.         subs r2, r2, r3
  201.         str r2, [r1, # 0x38]    @ 0x198

  202.         adds r2, r2, r3
  203.         adds r2, r2, r3
  204.         str r2, [r1, # 0x28]  @ 0x19e

  205.         ldr r2, [r1, # 0x3c]
  206.         ldr r3, [r1, # 0x2c]
  207.         ldr r6, = sin_6pi_16
  208.         ldr r6, [r6]
  209.         subs r4, r2, r3
  210.         muls r4, r4, r6         @ 0x1aa

  211.         ldr r6, = c_p_s_6pi_16
  212.         ldr r6, [r6]
  213.         muls r3, r3, r6
  214.         adds r3, r3, r4
  215.         str r3, [r1, # 0x2c]   @ 0x1b4

  216.         ldr r6, = c_m_s_6pi_16
  217.         ldr r6, [r6]
  218.         muls r2, r2, r6
  219.         adds r2, r2, r4
  220.         str r2, [r1, # 0x3c]   @ 0x1be 有点问题

  221.         @@@@@@@@@@@@@@@@@@@@@

  222.         ldr r2, [r1, # 0x20]
  223.         ldr r3, [r1, # 0x28]
  224.         adds r2, r2, r3
  225.         str r2, [r1, # 0x20] @ 0x1c6

  226.         subs r2, r2, r3
  227.         subs r2, r2, r3
  228.         str r2, [r1, # 0x28] @ 0x1cc

  229.         ldr r2, [r1, # 0x38]
  230.         ldr r3, [r1, # 0x30]
  231.         adds r3, r3, r2
  232.         str r3, [r1, # 0x30] @ 0x1d4

  233.         subs r3, r3, r2
  234.         subs r3, r3, r2
  235.         str r3, [r1, # 0x38]  @ 0x1da

  236.         ldr r2, [r1, # 0x24]
  237.         ldr r3, [r1, # 0x2c]
  238.         adds r2, r2, r3
  239.         str r2, [r1, # 0x24]  @ 0x1e2

  240.         subs r2, r2, r3
  241.         subs r2, r2, r3
  242.         str r2, [r1, # 0x2c]  @ 0x1e8

  243.         ldr r2, [r1, # 0x34]
  244.         ldr r3, [r1, # 0x3c]
  245.         adds r2, r2, r3
  246.         str r2, [r1, # 0x34]     @ 0x1f0 结果有点不一样

  247.         subs r2, r2, r3
  248.         subs r2, r2, r3
  249.         str r2, [r1, # 0x3c]    @ 0x1f6
  250. @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
  251.         ldr r7, = fftshuchu1
  252.         ldr r2, [r1, # 0x20]
  253.         ldr r3, [r1, # 0x24]
  254.         adds r4, r2, r3
  255.         str r4, [r7, # 0x04]      @ 0x200

  256.         subs r5, r2, r3
  257.         str r5, [r7, # 0x1c]     @ 0x204

  258.         ldr r2, [r1, # 0x30]
  259.         ldr r3, [r1, # 0x34]
  260.         adds r4, r2, r3
  261.         str r4, [r7, # 0x24]     @0x20c 不一样,差一点

  262.         subs r3, r3, r2
  263.         str r3, [r7, # 0x3c]    @ 0x210

  264.         ldr r2, [r1, # 0x28]
  265.         ldr r3, [r1, # 0x2c]
  266.         ldr r4, [r1, # 0x38]
  267.         ldr r5, [r1, # 0x3c]
  268.         adds r6, r2, r5
  269.         str r6, [r7, # 0x14]   @ 0x21c 不一样
  270.        
  271.         subs r6, r4, r3
  272.         str r6, [r7, # 0x34]   @ 0x220
  273.        
  274.         subs r6, r2, r5
  275.         str r6, [r7, # 0x0c]  @ 0x224 相差8

  276.         movs r2, # 0
  277.         subs r2, r2, r4
  278.         subs r6, r2, r3
  279.         str r6, [r7, # 0x2c]  @ 0x22c

  280.        
  281.         ldr r2, [r1]
  282.         ldr r3, [r1, # 0x10]
  283.         ldr r4, [r1, # 0x14]
  284.         ldr r5, [r1, # 0x18]
  285.         adds r6, r2, r4            @ out0=out0+out4
  286.         str r6, [r1]              @0x238 相差差2
  287.        
  288.         subs r6, r2, r3
  289.         subs r6, r6, r3
  290.         str r6, [r1, # 0x10]
  291.         ldr r6, [r1, # 0x04]
  292.         adds r6, r6, r4
  293.         str r6, [r1, # 0x04]       @ 0x23e
  294.        
  295.         subs r6, r6, r4
  296.         subs r6, r6, r4
  297.         str r6, [r1, # 0x14]              @ 0x24a
  298.        
  299.         ldr r2, [r1, # 0x08]
  300.         adds r2, r2, r5
  301.         str r2, [r1, # 0x08]              @ 0x250
  302.        
  303.         subs r2, r2, r5
  304.         subs r2, r2, r5
  305.         str r2, [r1, # 0x18]      @ 0x256 out6=out2-out6-out6
  306.        
  307.         ldr r2, [r1, # 0x0c]
  308.         ldr r3, [r1, # 0x1c]
  309.         adds r2, r2, r3
  310.         str r2, [r1, # 0x0c]      @ 0x25e
  311.        
  312.         subs r2, r2, r3
  313.         subs r2, r2, r3          @ 0x262
  314.         str r2, [r1, # 0x1c]

  315.         ldr r2, [r1]                @ output[0]=out0+out2
  316.         ldr r3, [r1, # 0x08]
  317.         adds r6, r2, r3
  318.         str r6, [r7]            @ 0x26a 差了2

  319.         subs r6, r2, r3
  320.         str r6, [r7, # 0x10]   @ 0x26e
  321.        
  322.         ldr r2, [r1, # 0x04]
  323.         ldr r3, [r1, # 0x0c]
  324.         adds r2, r2, r3
  325.         str r2, [r1, # 0x04]  @  0x270
  326.        
  327.         adds r3, r3, r3
  328.         subs r3, r3, r2
  329.         str r3, [r7, # 0x30]
  330.        
  331.         ldr r3, [r7]
  332.         adds r3, r3, r2
  333.         str r3, [r7]              @output[0] +=out1
  334.         subs r3, r3, r2
  335.         subs r3, r3, r2
  336.         str r3, [r7, # 0x20]     @ 0x288

  337.         ldr r2, = sin_4pi_16
  338.         ldr r2, [r2]
  339.         ldr r4, [r1, # 0x14]
  340.         ldr r5, [r1, # 0x1c]
  341.         muls r4, r4, r2
  342.         str r4, [r1, # 0x14]      @ 0x294
  343.        
  344.         muls r5, r5, r2
  345.         str r5, [r1, # 0x1c]         @ 0x29a
  346.        
  347.         subs r4, r4, r5
  348.         str r4, [r1, # 0x14]        @0x29e
  349.        
  350.         adds r4, r4, r5
  351.         adds r4, r4, r5
  352.         str r4, [r1, # 0x1c]         @ 0x2a4

  353.         ldr r2, [r1, # 0x18]
  354.         ldr r3, [r1, # 0x1c]
  355.         subs r2, r2, r3
  356.         str r2, [r7, # 0x38]        @ 0x2ac

  357.         ldr r2, [r1, # 0x14]
  358.         ldr r3, [r1, # 0x10]
  359.         adds r6, r2, r3
  360.         str r6, [r7, # 0x08]

  361.         subs r3, r3, r2
  362.         str r3, [r7, # 0x18]

  363.         movs r4, # 0
  364.         ldr r2, [r1, # 0x1c]
  365.         ldr r3, [r1, # 0x18]
  366.         subs r4, r4, r2
  367.         subs r4, r4, r3
  368.         str r4, [r7, # 0x28]

  369.        
  370. _tingting:
  371.         b _tingting
  372.        
  373. _nmi_handler:
  374.         bx lr
  375. _hard_fault:
  376.         bx lr
  377. _svc_handler:
  378.         bx lr
  379. _pendsv_handler:
  380.         bx lr
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 加入会员

本版积分规则

小黑屋|手机版|矿石收音机 ( 蒙ICP备05000029号-1 )

蒙公网安备 15040402000005号

GMT+8, 2025-4-30 13:24

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表