Reply by gold January 2, 20052005-01-02
> Do you know this book has an electronic version? Unfortunatly it is
not
> available here, for me to get one. >
I don't think so, it has an electronic version. you can check the following link for C++ implementation of FIR and Biquad (IIR) filters under the section "Selected C++ Implementations" http://www-ccrma.stanford.edu/~jos/filters/Welcome.html and do a reverse engineering to understand and modify for your own requirements. Hope this will be helpful for you gold
Reply by Sreeram January 1, 20052005-01-01
> > The following book can help you to understand how to write a FIR or IIR > > filter routine in C++ (real time processing). > > C++ Algorithms for Digital Signal Processing, > By Paul Embree, Damon Danieli. > Published by Prentice Hall PTR. > > good luck > gold >
Do you know this book has an electronic version? Unfortunatly it is not available here, for me to get one. Thank you, Sreeram.
Reply by robert bristow-johnson December 31, 20042004-12-31
in article 33ivssF3vnhtlU1@individual.net, Jon Harris at
goldentully@hotmail.com wrote on 12/30/2004 13:32:

> I was thinking of a software tool to show the magnitude vs. frequency graph of > the filter itself, but you probably can use this method too. Put in a white > noise signal and look at the output spectrum. I want you to see what a biquad > IIR bandpass filter really does and doesn't do to get a better feel for this > process.
if what you want is code to display the mag (usually in dB) vs. freq (usually log freq) given the filter parameters or coefficients, that is very doable. i have math/code that can do it for a fixed-point or single-precision floating-point (bad things happen to cos(w) when w gets close to zero, which are many octaves, especially if Fs = 96 kHz or higher) but it ain't public domain. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by Jon Harris December 30, 20042004-12-30
<sreeram0425@gmail.com> wrote in message
news:1104389793.368700.234820@c13g2000cwb.googlegroups.com...
> Yes. I am using a spectrum analyzer tool. I have a loopback driver > which can route the sound output to sound input. And using a third > party spectrum analyser tool I am seeing the response.
I was thinking of a software tool to show the magnitude vs. frequency graph of the filter itself, but you probably can use this method too. Put in a white noise signal and look at the output spectrum. I want you to see what a biquad IIR bandpass filter really does and doesn't do to get a better feel for this process.
> The main problem I am facing is with lower frequencies. Say, I am doing > a filtering 5000 to 10000Hz, after filtering few times with the same > biquad coefficients the frequencies out side the highband ie; >10000Hz > (in this case) are filtered out. But in below lowerband edges ie; > <5000Hz, I am still seeing the signal with the analyser tool. I tried > lowpass, highpass and bandpass and also with various combinations.
Is the low-frequency signal attenuated at least somewhat? Compare the input to the output and see how much attenuation it is receiving. Also, knowing how much below 5000Hz this signal is would be important information. A signal at 4000Hz would not be attenuated nearly as much as one at say 40 Hz.
> Could you please provide me little more help? > > "Another thing you could try is to design a filter that is somewhat > wider then you have now. " > > Could you explain the meaning of this? Thanks. > Thank you for your time, > Sreeram.
If your current filter is for example one octave wide, then when you use multiple filters, I have found it useful to make each one be say 1.5 octaves wide. This keeps the pass band more flat. Having a filter design tool that lets you quickly see the effects of this change is very useful.
Reply by gold December 30, 20042004-12-30
Jon Harris wrote:
> <sreeram@spymac.com> wrote in message > news:1104374614.777745.135800@c13g2000cwb.googlegroups.com... > > Thank you, Jon, for your patience. > > > >> > >>>Are you saying, after a bandpass filtering I need to run the same > >>>through a low pass and high pass filter to get the correct output? > >> > >> > >> No, I'm saying you might get better results by running the signal > > through the > >> biquad multiple times, i.e. feed the filtered output back into the > > biquad input. > >> > >> > > > > Now I have generated coefficients for 1 biquad. I cannot use same > > biquad coeffcients for further filtering. right? How I should
calculate
> > further biquad coefficients for further filtering? > > Actually, you can. It may not be the optimal filter, but will
certainly provide
> additional filtering. Another thing you could try is to design a
filter that is
> somewhat wider then you have now. Applying that multiple times may
give better
> results. > Do you have a way a viewing the frequency response of the biquad
filter? Using
> that is a good way to see what is going on and design the appropriate
filters.
> Matlab or one of it's clones is a good tool. Or I have used Excel,
deriving the
> magnitude response of the filter from the s-domain equations in the
cookbook:
> substitute s = jw, and find the magnitude of the (complex) function.
Maybe
> there are on-line tools as well? > > > Also, could you please recomend me some book which describes about > > filters in audio programming(with some C/C++ code if it is
available)?
> > It would be better if that book is available in asian countries.
Many
> > good foreign technical books will not get in India. (normally) > > Maybe someone else can help with this.
The following book can help you to understand how to write a FIR or IIR filter routine in C++ (real time processing). C++ Algorithms for Digital Signal Processing, By Paul Embree, Damon Danieli. Published by Prentice Hall PTR. good luck gold
Reply by December 30, 20042004-12-30
Yes. I am using a spectrum analyzer tool. I have a loopback driver
which can route the sound output to sound input. And using a third
party spectrum analyser tool I am seeing the response.

The main problem I am facing is with lower frequencies. Say, I am doing
a filtering 5000 to 10000Hz, after filtering few times with the same
biquad coefficients the frequencies out side the highband ie;  >10000Hz
(in this case) are filtered out. But in below lowerband edges  ie;
<5000Hz, I am still seeing the signal with the analyser tool.  I tried
lowpass, highpass and bandpass and also with various combinations.

Could you please provide me little more help?

"Another thing you could try is to design a filter that is somewhat
wider then you have now. "

Could you explain the meaning of this? Thanks.
Thank you for your time,
Sreeram.

Reply by December 30, 20042004-12-30
Yes. I am using a spectrum analyzer tool. I have a loopback driver
which can route the sound output to sound input. And using a third
party spectrum analyser tool I am seeing the response.

The main problem I am facing is with lower frequencies. Say, I am doing
a filtering 5000 to 10000Hz, after filtering few times with the same
biquad coefficients the frequencies out side the highband ie;  >10000Hz
(in this case) are filtered out. But in below lowerband edges  ie;
<5000Hz, I am still seeing the signal with the analyser tool.  I tried
lowpass, highpass and bandpass and also with various combinations.

Could you please provide me little more help?

"Another thing you could try is to design a filter that is somewhat
wider then you have now. "

Could you explain the meaning of this? Thanks.
Thank you for your time,
Sreeram.

Reply by Jon Harris December 30, 20042004-12-30
<sreeram@spymac.com> wrote in message 
news:1104374614.777745.135800@c13g2000cwb.googlegroups.com...
> Thank you, Jon, for your patience. > >> >>>Are you saying, after a bandpass filtering I need to run the same >>>through a low pass and high pass filter to get the correct output? >> >> >> No, I'm saying you might get better results by running the signal > through the >> biquad multiple times, i.e. feed the filtered output back into the > biquad input. >> >> > > Now I have generated coefficients for 1 biquad. I cannot use same > biquad coeffcients for further filtering. right? How I should calculate > further biquad coefficients for further filtering?
Actually, you can. It may not be the optimal filter, but will certainly provide additional filtering. Another thing you could try is to design a filter that is somewhat wider then you have now. Applying that multiple times may give better results. Do you have a way a viewing the frequency response of the biquad filter? Using that is a good way to see what is going on and design the appropriate filters. Matlab or one of it's clones is a good tool. Or I have used Excel, deriving the magnitude response of the filter from the s-domain equations in the cookbook: substitute s = jw, and find the magnitude of the (complex) function. Maybe there are on-line tools as well?
> Also, could you please recomend me some book which describes about > filters in audio programming(with some C/C++ code if it is available)? > It would be better if that book is available in asian countries. Many > good foreign technical books will not get in India. (normally)
Maybe someone else can help with this.
Reply by December 29, 20042004-12-29
Thank you, Jon, for your patience.

> >>Are you saying, after a bandpass filtering I need to run the same >>through a low pass and high pass filter to get the correct output? > > > No, I'm saying you might get better results by running the signal
through the
> biquad multiple times, i.e. feed the filtered output back into the
biquad input.
> >
Now I have generated coefficients for 1 biquad. I cannot use same biquad coeffcients for further filtering. right? How I should calculate further biquad coefficients for further filtering? Also, could you please recomend me some book which describes about filters in audio programming(with some C/C++ code if it is available)? It would be better if that book is available in asian countries. Many good foreign technical books will not get in India. (normally) Thank you, Sreeram.
Reply by Jon Harris December 28, 20042004-12-28
"Sreeram" <sreeram@spymac.com> wrote in message
news:1104255027.7a2f0acb86687b028e1a5f692bf01cf7@teranews...
> Thank you. I have few more doubts. > > Jon Harris wrote: > > > > Are you using the peaking filter or the bandpass filter? If you are > using the > > "(constant 0 dB peak gain)" bandpass filter, you can ignore the dB gain. > > I am doing a bandpass filter. > > > > > Keep in mind that if you use a single biquad filter, your attenuation > at the > > band edges will only be 3dB (increasing as you get farther from the > band edge). > > You may want to use several biquads in series to get additional > attenuation. > > The optimal solution probably involves using different settings for > each biquad > > so that the composite result is as flat and sharp as possible. > > > > I didn't understand this portion correctly. I calculated the values for > center frequency & bandwidth in octaves. I am doing a bandpass filter in > the range 10000 to 15000Hz. But after filtering I am getting signals > even in other areas. The data after filter is not proper as expected. > And it plays full.
What I am trying to say is that a biquad bandpass filter is nowhere near an "ideal" band pass filter which has 0 attenuation in the center pass-band and infinite attenuation outside of it. Have you ever seen the graph of the frequency response of a biquad band-pass filter? If not, take a look at some of these links: http://www.iitk.ac.in/eclub/ee381/Expt1_Biquad_Active_Filter.pdf http://www-k.ext.ti.com/SRVS/Data/ti/KnowledgeBases/analog/document/faqs/bp.htm In your case, if you bandpass filter is from 10000 to 15000 Hz, a signal at 9999 Hz is only going to be attenuated by 3dB, not completely eliminated. Components further from the edges, such as 100 Hz will be much more strongly attenuated.
> Are you saying, after a bandpass filtering I need to run the same > through a low pass and high pass filter to get the correct output?
No, I'm saying you might get better results by running the signal through the biquad multiple times, i.e. feed the filtered output back into the biquad input.
> Please correct me if I am wrong and a possible solution. An explanation > with a simple example would be really helpful.
Hope the above is helpful to you. I think the main problem is your expectation of what a single biquad bandpass filter is capable of. Have a look at the above links and adjust your expectations accordingly. -Jon