[Portaudio] FIR filter coefficients
David Wallace
davidwallace712@yahoo.com
Mon, 21 Oct 2002 15:47:19 -0700 (PDT)
--0-1149346053-1035240439=:3999
Content-Type: text/plain; charset=us-ascii
I want to use portaudio to write a real time FIR filter program. I got pa_wire.c working. The sound card (soundmax) did turn out to be working in full duplex. Thanks for the help.
I'm a little confused about the format of the incoming data and the format my filter coefficients should be in. In the starting of pa_wire.c, I saw the following:
#if 1
#define PA_SAMPLE_TYPE paFloat32
typedef float SAMPLE;
#else
#define PA_SAMPLE_TYPE paInt16
typedef short SAMPLE;
#endif
I didn't exactly get this but I am assuming that the incoming samples are 16 bit samples since the soundcard is 16 bit. Is this correct? The coefficients of the filter that I want to use are in a 16 bit signed format. They have values between around -6500 to 6500. Do I need to normalize these coefficients before using them for convolution. If so, should I divide them by 2^15, 6500, or something else? Do I need to use Q formats over here?
Also, the filters that I want to use have 128 coefficients each (one for the left channel an one for the right channel). Is it is possible for this kind of filter to work real time in a Portaudio callback? How many frames should I set per buffer in this program?
Thanks
---------------------------------
Do you Yahoo!?
Y! Web Hosting - Let the expert host your web site
--0-1149346053-1035240439=:3999
Content-Type: text/html; charset=us-ascii
<P>I want to use portaudio to write a real time FIR filter program. I got pa_wire.c working. The sound card (soundmax) did turn out to be working in full duplex. Thanks for the help.</P>
<P>I'm a little confused about the format of the incoming data and the format my filter coefficients should be in. In the starting of pa_wire.c, I saw the following:</P>
<P>#if 1<BR>#define PA_SAMPLE_TYPE paFloat32<BR>typedef float SAMPLE;<BR>#else<BR>#define PA_SAMPLE_TYPE paInt16<BR>typedef short SAMPLE;<BR>#endif<BR></P>
<P>I didn't exactly get this but I am assuming that the incoming samples are 16 bit samples since the soundcard is 16 bit. Is this correct? The coefficients of the filter that I want to use are in a 16 bit signed format. They have values between around -6500 to 6500. Do I need to normalize these coefficients before using them for convolution. If so, should I divide them by 2^15, 6500, or something else? Do I need to use Q formats over here? </P>
<P>Also, the filters that I want to use have 128 coefficients each (one for the left channel an one for the right channel). Is it is possible for this kind of filter to work real time in a Portaudio callback? How many frames should I set per buffer in this program? </P>
<P>Thanks</P>
<P> </P><p><br><hr size=1>Do you Yahoo!?<br>
<a href="http://webhosting.yahoo.com/ ">Y! Web Hosting</a> - Let the expert host your web site
--0-1149346053-1035240439=:3999--