필터 지우기
필터 지우기

Can we filter an int16 signal using filters FIR?

조회 수: 2 (최근 30일)
Sangroku
Sangroku 2014년 1월 1일
댓글: Wayne King 2014년 1월 1일
The coefficients resulted in the design of the filter FIR are float, and when I try to filter the signal it just can't. I tried with "conv", is there a way?
Best regards, Marcelo
  댓글 수: 1
Jan
Jan 2014년 1월 1일
What does "it just can't" explicitly mean? Pleas post the error message and define the input arguments exactly. The less we have to guess, the easier is an answer.

댓글을 달려면 로그인하십시오.

답변 (3개)

Wayne King
Wayne King 2014년 1월 1일
Jan is correct about making your post clear.
If you are using conv(), the help for conv() states that the only supported data types are:
float: double, single
So why not cast your input to double()?
conv(double(x),B)
where B are the filter coefficients.
Or better yet, use filter()
y = filter(B,1,double(x));

Jan
Jan 2014년 1월 1일
편집: Jan 2014년 1월 1일
What about converting the signal to a double temporarily?
y = int16(filter(B, A, double(YourINT16Signal)));
Another idea would to use an M-version of FILTER, see e.g. Answers: Hard coded filter parameters
A C-Mex version of FILTER can be found in the file exchange and it can be adjusted to integer types. But the conversion to double seems to be the most elegant way, if it is not impeded by the memory consumption.

Sangroku
Sangroku 2014년 1월 1일
편집: Sangroku 2014년 1월 1일
Sorry for not explaining well, and thank you for your help. And how do I get int16 samples from a file .wav? I tried:
>> [s1,fs] = wavread('C:\Users\user\Desktop\ex.wav');
>> s=int16(s1);
>> wavplay(s, fs)
t just noise this way
  댓글 수: 1
Wayne King
Wayne King 2014년 1월 1일
How is this at all related to your original post about filtering?
Have you tried reading the file with the 'native' option.
[s1,fs] = wavread('C:\Users\user\Desktop\ex.wav','native');
What datatype does that give s1?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by