[問題] FIR Filter

作者: totemist (totem)   2015-05-21 01:44:50
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Code::Blocks
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
問題(Question):
如何使用matlab fdatool所產生的FIR filter - fdacoefs.h和讀進的3200筆data做運算。
餵入的資料(Input):
3200筆data,已存成array。
預期的正確結果(Expected Output):
fdacoefs.h和讀進的3200筆data做運算,得到新的3200筆data。
錯誤結果(Wrong Output):
程式碼(Code):(請善用置底文網頁, 記得排版)
目前就是單純的把檔案讀進來,存成矩陣。
#include <stdlib.h>
#include <stdio.h>
#include "fdacoefs.h"
int main (void)
{
float x[3600];
float y;
int i;
FILE *fptr;
char ch;
if((fptr=fopen("C:\\test.txt","r"))!=NULL)
{
for (i=0;i<3200;i++){
fscanf(fptr,"%f",&y);
x[i] = y;
// printf("%f\n",y);
}
for (i=0;i<3200;i++){
printf("%f\n",x[i]);
}
}
else
printf("Failed!");
fclose(fptr);
system("pause");
return 0;
}
補充說明(Supplement):
對於fdacoefs.h完全沒概念,不知道該從哪裡下手才好
想要查資料也不知道該往哪一方向進行
希望大大們能提點一下
謝謝

Links booklink

Contact Us: admin [ a t ] ucptt.com