I'm trying to write (in C++) a low-pass filter for audio frequencies. I used this: H[i]= sin(2*PI*FC * (i-M/2)) / (i-M/2) * * 0.54 - 0.46*cos(2*PI*i/M) where M= 100 points and FC is the cutoff frequency (0 to 0.5), but I guess I don't know how to use it because the filtered music is really bad. I have the real and the imaginary part of the transformed input signal. Could anybody tell me how to convolve the input signal and the filter kernel H[]? Thanks Cristiano
Low-pass filter algorithm
Started by ●August 5, 2004
Reply by ●August 5, 20042004-08-05
In article <D3wQc.76974$OR2.4340761@news3.tin.it>, Cristiano <cristiano.pi@NSquipo.it> wrote:>I'm trying to write (in C++) a low-pass filter for audio frequencies.This may help: http://unicorn.us.com/alex/buttercrit.html -A
Reply by ●August 6, 20042004-08-06
axlq wrote:> In article <D3wQc.76974$OR2.4340761@news3.tin.it>, > Cristiano <cristiano.pi@NSquipo.it> wrote: >> I'm trying to write (in C++) a low-pass filter for audio frequencies. > > This may help: > > http://unicorn.us.com/alex/buttercrit.htmlIn that page I only seen the filter design, but as I said, I need to know how to convolve the input signal and the filter kernel. Cristiano
Reply by ●August 6, 20042004-08-06
Cristiano wrote:> In that page I only seen the filter design, but as I said, I need to know > how to convolve the input signal and the filter kernel.N y(k) = sum x(n-k)*h(n) n=0 For various implementations, go to dspguru.com and read the FIR FAQ. -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (703) 779-7770 Better to ask a stupid question than to make a stupid mistake.
Reply by ●August 6, 20042004-08-06
Jim Thomas wrote:> N > y(k) = sum x(n-k)*h(n) > n=0 >Oops! I reversed the n and k. Try this instead: N y(k) = sum x(k-n)*h(n) n=0 -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (703) 779-7770 Better to ask a stupid question than to make a stupid mistake.
Reply by ●August 6, 20042004-08-06