⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windowcalc.lst

📁 基于8051F单片机,实现1024点的FFT 用C 语言实现的.效果与FPGA实现相同.
💻 LST
字号:
C51 COMPILER V8.02   WINDOWCALC                                                            05/09/2008 16:27:08 PAGE 1   


C51 COMPILER V8.02, COMPILATION OF MODULE WINDOWCALC
OBJECT MODULE PLACED IN WindowCalc.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE WindowCalc.c BROWSE DEBUG OBJECTEXTEND

line level    source

   1          
   2          
   3          #include "FFT_Code_Tables.h"
   4          
   5          typedef union IBALONG {                // Integer or Byte-addressable LONG
   6             long l;                             // long: Var.l
   7             unsigned int i[2];                  // u int: Var.i[0]:Var.i[1]
   8             unsigned char b[4];                 // u char: Var.b[0]:Var.b[1]:
   9                                                 //          Var.b[2]:Var.b[3]
  10          } IBALONG;
  11          
  12          
  13          
  14          //-----------------------------------------------------------------------------
  15          // WindowCalc
  16          //-----------------------------------------------------------------------------
  17          //
  18          // Uses the values in WindowFunc[] to window the stored data.
  19          //
  20          // The WindowFunc[] Array contains window coefficients between samples
  21          // 0 and (NUM_FFT/2)-1, and samples from NUM_FFT/2 to NUM_FFT-1 are the mirror
  22          // image of the other side.
  23          // Window values are interpreted as a fraction of 1 (WindowFunc[x]/65536).
  24          // The value at NUM_FFT/2 is assumed to be 1.0 (65536).
  25          //
  26          // If SE_data = 1, the input data is assumed to be single-ended, and is
  27          // converted to a 2's complement, differential representation, to cancel the DC
  28          // offset.
  29          //
  30          void WindowCalc(int Win_Array[], unsigned char SE_data)
  31          {
  32   1      
  33   1      #if (WINDOW_TYPE != 0)  // Use this section if a window has been specified
  34   1        
  35   1          IBALONG NewVal;
  36   1      
  37   1         if (SE_data)                              // If data is single-ended,
  38   1            Win_Array[0] ^= 0x8000;                // convert it to differential
  39   1         NewVal.l = (long)Win_Array[0] * WindowFunc[0];
  40   1        
  41   1         if ((NewVal.l < 0)&&(NewVal.i[1]))
  42   1           Win_Array[0] = NewVal.i[0] + 1;
  43   1         else Win_Array[0] = NewVal.i[0];
  44   1      
  45   1         if (SE_data)                              // If data is single-ended,
  46   1            Win_Array[NUM_FFT/2] ^= 0x8000;        // convert it to differential
  47   1      
  48   1        for (index = 1; index < NUM_FFT/2; index++)
*** ERROR C202 IN LINE 48 OF WINDOWCALC.C: 'index': undefined identifier
  49   1        {
  50   2            // Array positions 1 to (NUM_FFT/2 - 1)
  51   2            if (SE_data)                           // If data is single-ended,
  52   2               Win_Array[index] ^= 0x8000;         // convert it to differential
*** ERROR C202 IN LINE 52 OF WINDOWCALC.C: 'index': undefined identifier
  53   2            NewVal.l = (long)Win_Array[index] * WindowFunc[index];
C51 COMPILER V8.02   WINDOWCALC                                                            05/09/2008 16:27:08 PAGE 2   

*** ERROR C202 IN LINE 53 OF WINDOWCALC.C: 'index': undefined identifier
  54   2            if ((NewVal.l < 0)&&(NewVal.i[1]))
  55   2              Win_Array[index] = NewVal.i[0] + 1;
*** ERROR C202 IN LINE 55 OF WINDOWCALC.C: 'index': undefined identifier
  56   2      
  57   2       else Win_Array[index] = NewVal.i[0];
*** ERROR C202 IN LINE 57 OF WINDOWCALC.C: 'index': undefined identifier
  58   2      
  59   2            // Array positions (NUM_FFT/2 + 1) to (NUM_FFT - 1)
  60   2            if (SE_data)                           // If data is single-ended,
  61   2               Win_Array[NUM_FFT-index] ^= 0x8000; // convert it to differential
*** ERROR C202 IN LINE 61 OF WINDOWCALC.C: 'index': undefined identifier
  62   2            NewVal.l = (long)Win_Array[NUM_FFT-index] * WindowFunc[index];
*** ERROR C202 IN LINE 62 OF WINDOWCALC.C: 'index': undefined identifier
  63   2          
  64   2                if ((NewVal.l < 0)&&(NewVal.i[1]))
  65   2               Win_Array[NUM_FFT-index] = NewVal.i[0] + 1;
*** ERROR C202 IN LINE 65 OF WINDOWCALC.C: 'index': undefined identifier
  66   2            else Win_Array[NUM_FFT-index] = NewVal.i[0];
*** ERROR C202 IN LINE 66 OF WINDOWCALC.C: 'index': undefined identifier
  67   2      
  68   2         }
  69   1      
  70   1      #endif
  71   1      
  72   1      #if (WINDOW_TYPE == 0)  // Compile this if no window has been specified
              
                 if (SE_data)                              // If data is single-ended,
                 {                                         // convert it to differential
              
                    for (index = 0; index < NUM_FFT; index++)
                    {
                       Win_Array[index] ^= 0x8000;         // XOR MSB with '1' to invert
                    }
                 }
              
              #endif
  84   1      
  85   1      }  // END WindowCalc

C51 COMPILATION COMPLETE.  0 WARNING(S),  9 ERROR(S)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -