matlab fir stm32,求一个完整的STM32运算FIR滤波程序
#define ORDER? ? ? ? (27)? ? ? ? ? ? ? ? ? ? ? ? //階數
extern double Buffer[ORDER];? ? ? ? //采樣歷史數據
extern double Gains[ORDER+1];? ? ? ? //增益數據
double Fir(double Input)
{
double ? ? ? ? ? ? ? ? Output=0.0;? ? ? ? //數據輸出
unsigned int Index;? ? ? ? ? ? ? ? //下標索引
//采樣數據移位
for(Index=ORDER;Index>0;Index--) Buffers[Index]=Buffers[Index-1];
Buffers[0]=Input;
//計算輸出
for(Index=0;Index
{
Output+=Gains[Index]*Buffers[Index];
}
return Output;
}
double Buffer[ORDER+1];
//27階FIR橢圓低通濾波系數
//Fsample=1M,Fpass=10K, Gpass=1; Stop=100K, Gstop=0.001
double Gains[ORDER+1]=
{
0.00059697504964033668,? ?? ?? ?? ???/* Expression: 0.00059697504964033668
* Referenced by: '/b(1)'
*/
0.0015403196387599274,? ?? ?? ?? ?? ?/* Expression: 0.0015403196387599274
* Referenced by: '/b(2)'
*/
0.0033064320276585081,? ?? ?? ?? ?? ?/* Expression: 0.0033064320276585081
* Referenced by: '/b(3)'
*/
0.0061113563487949557,? ?? ?? ?? ?? ?/* Expression: 0.0061113563487949557
* Referenced by: '/b(4)'
*/
0.010163018665706843,? ?? ?? ?? ?? ? /* Expression: 0.010163018665706843
* Referenced by: '/b(5)'
*/
0.01556871821436694,? ?? ?? ?? ?? ???/* Expression: 0.01556871821436694
* Referenced by: '/b(6)'
*/
0.022287913896844945,? ?? ?? ?? ?? ? /* Expression: 0.022287913896844945
* Referenced by: '/b(7)'
*/
0.030101200648240893,? ?? ?? ?? ?? ? /* Expression: 0.030101200648240893
* Referenced by: '/b(8)'
*/
0.038603810412670289,? ?? ?? ?? ?? ? /* Expression: 0.038603810412670289
* Referenced by: '/b(9)'
*/
0.047231317739074019,? ?? ?? ?? ?? ? /* Expression: 0.047231317739074019
* Referenced by: '/b(10)'
*/
0.055313182265383343,? ?? ?? ?? ?? ? /* Expression: 0.055313182265383343
* Referenced by: '/b(11)'
*/
0.062153319101224389,? ?? ?? ?? ?? ? /* Expression: 0.062153319101224389
* Referenced by: '/b(12)'
*/
0.067119721211364419,? ?? ?? ?? ?? ? /* Expression: 0.067119721211364419
* Referenced by: '/b(13)'
*/
0.069732498345159072,? ?? ?? ?? ?? ? /* Expression: 0.069732498345159072
* Referenced by: '/b(14)'
*/
0.069732498345159072,? ?? ?? ?? ?? ? /* Expression: 0.069732498345159072
* Referenced by: '/b(15)'
*/
0.067119721211364419,? ?? ?? ?? ?? ? /* Expression: 0.067119721211364419
* Referenced by: '/b(16)'
*/
0.062153319101224389,? ?? ?? ?? ?? ? /* Expression: 0.062153319101224389
* Referenced by: '/b(17)'
*/
0.055313182265383343,? ?? ?? ?? ?? ? /* Expression: 0.055313182265383343
* Referenced by: '/b(18)'
*/
0.047231317739074019,? ?? ?? ?? ?? ? /* Expression: 0.047231317739074019
* Referenced by: '/b(19)'
*/
0.038603810412670289,? ?? ?? ?? ?? ? /* Expression: 0.038603810412670289
* Referenced by: '/b(20)'
*/
0.030101200648240893,? ?? ?? ?? ?? ? /* Expression: 0.030101200648240893
* Referenced by: '/b(21)'
*/
0.022287913896844945,? ?? ?? ?? ?? ? /* Expression: 0.022287913896844945
* Referenced by: '/b(22)'
*/
0.01556871821436694,? ?? ?? ?? ?? ???/* Expression: 0.01556871821436694
* Referenced by: '/b(23)'
*/
0.010163018665706843,? ?? ?? ?? ?? ? /* Expression: 0.010163018665706843
* Referenced by: '/b(24)'
*/
0.0061113563487949557,? ?? ?? ?? ?? ?/* Expression: 0.0061113563487949557
* Referenced by: '/b(25)'
*/
0.0033064320276585081,? ?? ?? ?? ?? ?/* Expression: 0.0033064320276585081
* Referenced by: '/b(26)'
*/
0.0015403196387599274,? ?? ?? ?? ?? ?/* Expression: 0.0015403196387599274
* Referenced by: '/b(27)'
*/
0.00059697504964033668? ?? ?? ?? ?? ?/* Expression: 0.00059697504964033668
* Referenced by: '/b(28)'
*/
};
總結
以上是生活随笔為你收集整理的matlab fir stm32,求一个完整的STM32运算FIR滤波程序的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 使用世界银行的GDP数据进行可视化(Py
- 下一篇: 【论文阅读】Attention 机制在脱