• 已解决 73482 个问题
  • 已帮助 5993 位优秀工程师

求助,谁会用28335来做FIR低通语音滤波

神情飒爽 2017-04-06 浏览量:2612
求助,谁会用28335来做FIR低通语音滤波
0 0 收起

我来回答

上传资料:
选择文件 文件大小不超过15M(格式支持:doc、ppt、xls、pdf、zip、rar、txt)
最佳答案
  • 您好,這顆MCU本身就有帶FIR相關範例了,可參考

    相關程式碼節錄

    #include "DSP28x_Project.h"     // Device Headerfile and Examples Include File
    
    #include "FPU.h"
    
    #include "math.h"
    
    #include "float.h"
    
     
    
    /* Filter Symbolic Constants                        */
    
    #define FIR_ORDER    63 /* ORDER = NUM_TAPS - 1 */     
    
    #define SIGNAL_LENGTH (FIR_ORDER+1)* 4 
    
                                         
    
                                            
    
    /* Create an Instance of FIRFILT_GEN module and place the object in "firfilt" section       */ 
    
    #pragma DATA_SECTION(firFP, "firfilt")
    
    //#pragma DATA_SECTION(firFP_c, "firfilt")
    
    FIR_FP  firFP = FIR_FP_DEFAULTS;
    
                                                
    
    /* Define the Delay buffer for the 50th order filterfilter and place it in "firldb" section */  
    
    #pragma DATA_SECTION(dbuffer, "firldb")
    
    float dbuffer[FIR_ORDER+1];
    
    #pragma DATA_SECTION(sigIn, "sigIn");
    
    #pragma DATA_SECTION(sigOut, "sigOut");  
    
    float sigIn[SIGNAL_LENGTH];
    
    float sigOut[SIGNAL_LENGTH];
    
             
    
    /* Define Constant Co-efficient Array  and place the
    
    .constant section in ROM memory                */
    
    #pragma DATA_SECTION(coeff, "coefffilt");
    
    float const coeff[FIR_ORDER+1]= FIR_FP_LPF64;
    
    /*
    
     * Calculating a digital frequency
    
     * Let sampling frequency = 1MHz
    
     * primary signal @ 10KHz and a secondary signal @ 40KHz
    
     * Therefore k1 = 1K/100k = 0.01
    
     *           k2 = 33K/100k = 0.33
    
     * composite signal = 1/2(sin(2*pi*i*k1) + sin(2*pi*i*k2))
    
     *                  = 1/2(sin(0.062831853071 * i) + sin(2.073451151*i))
    
     */
    
    float RadStep = 0.062831853071f;  
    
    float   RadStep2 = 2.073451151f;
    
    float Rad = 0.0f;
    
    float  Rad2 = 0.0f;
    
    /* Filter Input and Output Variables                */   
    
    float xn,yn;
    
    int count = 0;
    
    void main()
    
    {
    
     unsigned int i;
    
     //Initalize sys clocks and PIE table
    
     InitSysCtrl();
    
     DINT;
    
     InitPieCtrl();
    
     IER = 0x0000;
    
     IFR = 0x0000;
    
     InitPieVectTable();
    
     EINT;   // Enable Global interrupt INTM
    
     ERTM;   // Enable Global realtime interrupt DBGM   
    
     // Generate sample waveforms:
    
     Rad = 0.0f;
    
       
    
     for(i=0; i < SIGNAL_LENGTH; i++)
    
        {
    
     sigIn[i]=0;
    
            sigOut[i]=0;
    
        }   
    
     /* FIR Generic Filter Initialisation    */ 
    
     firFP.order=FIR_ORDER; 
    
     firFP.dbuffer_ptr=dbuffer;
    
     firFP.coeff_ptr=(float *)coeff; 
    
     firFP.init(&firFP);
    
        for(i=0; i < SIGNAL_LENGTH; i++)
    
       {
    
       xn=0.5*sin(Rad) + 0.5*sin(Rad2); //Q15
    
     sigIn[i]=xn;
    
            firFP.input= xn;
    
            firFP.calc(&firFP);
    
            yn = firFP.output;
    
            sigOut[i]=yn;
    
     Rad = Rad + RadStep;
    
     Rad2 = Rad2 + RadStep2;
    
        }
    
     while(1) 
    
     {
    
     }       
    
    } /* End: main() */
    思路是您首先要先使用ADC將輸入的語音訊號做轉換後,再給MCU做FIR運算,然後將結果進行輸出

    以上供參考

    • 发布于 2017-04-06
    • 举报
    • 评论 0
    • 0
    • 0

其他答案 数量:3
  • 请参考这篇帖子

    http://bbs.eeworld.com.cn/thread-470070-1-1.html​

    • 发布于2017-04-06
    • 举报
    • 评论 0
    • 0
    • 0

  • 可以看一下这篇文章http://www.cnki.com.cn/Article/CJFDTotal-DSJS201405010.htm
    • 发布于2017-04-06
    • 举报
    • 评论 0
    • 0
    • 0

  • MOP这代码都给你贴了,你自己好好研究吧
    • 发布于2017-04-09
    • 举报
    • 评论 0
    • 0
    • 0

相关问题

问题达人换一批

求助,谁会用28335来做FIR低通语音滤波