Reply by Jerry Avins September 15, 20052005-09-15
Gert Baars wrote:
> I get good results with correction. The problem is that any window > is much too small if Fc/Fs gets very small because sinc(x) will be > 1 everywhere in the window so the actual h[n] will become shaped > exactly like the (hamming)window.
It seems to me that when the sinc is so heavily truncated that it's 1 everywhere, you have at nest a moving average filter, and a rectangular window may be as good as any.
> Concerning your question; Because H(W) of a HPF equals 1-H(W) of a LPF?
Yes ... Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by Gert Baars September 15, 20052005-09-15
I get good results with correction. The problem is that any window
is much too small if Fc/Fs gets very small because sinc(x) will be
1 everywhere in the window so the actual h[n] will become shaped
exactly like the (hamming)window.

Concerning your question; Because H(W) of a HPF equals 1-H(W) of a LPF?



Jerry Avins wrote:
> Gert Baars wrote: > >> Jerry Avins wrote: >> >>> Gert Baars wrote: >>> >>> ... >>> >>>> Now I have to find out how I differ from ScopeFIR's method >>>> (I selected the Windowed Sinc type of filter). >>> >>> >>> >>> >>> ScopeFIR uses a different method. It involves no window. There is no >>> reason to expect the results to be identical. In fact, for a given >>> number of taps, you can expect the Parks/McClellan design to match >>> the specs more closely. >>> >>> Jerry >> >> >> >> >> What I think ScopeFIR does is correct afterwards. I tried adding up all >> coefficients with my method (including the Hammingwindow) and then >> afterwards correct all coefficients so they DO add up to 1. The results >> sound pretty good. > > > Windowed sinc is good; numerical approximation methods are a bit better. > Coefficients summing to one gives unity gain at DC. For a high-pass > filter, they will sum to zero. In fact, with an odd number of symmetric > taps, subtracting the sum of a low-pass's taps from the middle one makes > an inverting high-pass. Do you see why? > > Jerry
Reply by Fred Marshall September 14, 20052005-09-14
"Gert Baars" <g.baars13@chello.nl> wrote in message 
news:d65c1$43280129$3ec23590$23949@news.chello.nl...
> The easiest way is to compare only the center tap which origins > from sinc(0). Here hn = 2*Fc/Fs and the Hamming window = 1. > > This equals the centre tap of the ScopeFir design as long as > Fc >= 1 KHz with Fs = 12KHz with LPF. > The difference also gets very small if #TAPS gets very large > no matter what Fc is.
I asked what the "by hand" design algorithm was ...... not the comparison method or results. Fred
Reply by Rune Allnor September 14, 20052005-09-14
Gert Baars wrote:
> Hello, > > For a low-pass filter with hammingwindow I can calculate > the coefficients manually. > > Lets say for n = (L-1)/2 the middle tap (#taps is odd) > > coefficient is 2*Fc/Fs. (The Hammingwindow here is 1). > > Compared to the FIR filter program ScopeFIR I get exactly > the same values for manually calculated middle-tap coefficient if Fc >= > 1 KHz < Fs/2 while Fs = 12 KHz. > The problem with Fs < 1 KHz is that the difference becomes bigger and > bigger. 2*0.3/12 = 0.05 while scopeFIR calculates 0.09. > > What is causing the difference? All help here is much appreciated.
The formula for determining the number of taps for a given specification seems to be based om empiri. Only general guidelines are given in my books, experienced filter designers might have found more efficient formulas that they might keep quiet about. So given a spec and a filter length N, the sin(Nn)/Nsin(n) terms might be computed differently. Rune
Reply by Jerry Avins September 14, 20052005-09-14
Gert Baars wrote:
> Jerry Avins wrote: > >> Gert Baars wrote: >> >> ... >> >>> Now I have to find out how I differ from ScopeFIR's method >>> (I selected the Windowed Sinc type of filter). >> >> >> >> ScopeFIR uses a different method. It involves no window. There is no >> reason to expect the results to be identical. In fact, for a given >> number of taps, you can expect the Parks/McClellan design to match the >> specs more closely. >> >> Jerry > > > > What I think ScopeFIR does is correct afterwards. I tried adding up all > coefficients with my method (including the Hammingwindow) and then > afterwards correct all coefficients so they DO add up to 1. The results > sound pretty good.
Windowed sinc is good; numerical approximation methods are a bit better. Coefficients summing to one gives unity gain at DC. For a high-pass filter, they will sum to zero. In fact, with an odd number of symmetric taps, subtracting the sum of a low-pass's taps from the middle one makes an inverting high-pass. Do you see why? Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Gert Baars September 14, 20052005-09-14
Jerry Avins wrote:
> Gert Baars wrote: > > ... > >> Now I have to find out how I differ from ScopeFIR's method >> (I selected the Windowed Sinc type of filter). > > > ScopeFIR uses a different method. It involves no window. There is no > reason to expect the results to be identical. In fact, for a given > number of taps, you can expect the Parks/McClellan design to match the > specs more closely. > > Jerry
What I think ScopeFIR does is correct afterwards. I tried adding up all coefficients with my method (including the Hammingwindow) and then afterwards correct all coefficients so they DO add up to 1. The results sound pretty good.
Reply by Jerry Avins September 14, 20052005-09-14
Gert Baars wrote:

   ...

> Now I have to find out how I differ from ScopeFIR's method > (I selected the Windowed Sinc type of filter).
ScopeFIR uses a different method. It involves no window. There is no reason to expect the results to be identical. In fact, for a given number of taps, you can expect the Parks/McClellan design to match the specs more closely. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Gert Baars September 14, 20052005-09-14



Jerry Avins wrote:
> Gert Baars wrote: > >> Gert Baars wrote: >> >> I corrected the previous message. >> >> Hello, >> >> For a low-pass filter with hammingwindow I can calculate >> the coefficients manually. >> >> Lets say for n = (L-1)/2 the middle tap (#taps is odd) >> >> coefficient is 2*Fc/Fs. (The Hammingwindow here is 1). >> >> Compared to the FIR filter program ScopeFIR I get exactly >> the same values for manually calculated middle-tap coefficient >> if Fc >= 1 KHz < Fs/2 while Fs = 12 KHz. >> >> The problem with Fc < 1 KHz is that the difference becomes bigger >> and bigger. 2*0.3/12 = 0.05 while scopeFIR calculates 0.09. >> >> What is causing the difference? All help here is much appreciated. > > > Are the unwindowed coefficients the same? You and ScopeFIR may calculate > them differently. To see if the Hamming window is just a red herring, > calculate the coefficients with a rectangular window. > > Jerry
What I did was do an IFT on H(W) with: H = 1 for -Wc < W < Wc and 0 else the result is now sin(Wc.n) / (pi.n) this equals (Wc/pi) (sin(Wc.n) / (Wc.n)) sinx/x = 1 for x=0 so for n = 0 -> h=Wc/pi = (2.pi.Fc/Fs)/pi = 2.Fc/Fs (a Hamming window = 1 for n = 0) Compared with ScopeFIR the results match if #TAPS is very large or if Fc/Fs is not too small. (with a LPF). What occurs to me is that all the coefficients from ScopeFIR add up to precisely 1 which should be te case indeed. Now I have to find out how I differ from ScopeFIR's method (I selected the Windowed Sinc type of filter).
Reply by Jerry Avins September 14, 20052005-09-14
Gert Baars wrote:
> Gert Baars wrote: > > I corrected the previous message. > > Hello, > > For a low-pass filter with hammingwindow I can calculate > the coefficients manually. > > Lets say for n = (L-1)/2 the middle tap (#taps is odd) > > coefficient is 2*Fc/Fs. (The Hammingwindow here is 1). > > Compared to the FIR filter program ScopeFIR I get exactly > the same values for manually calculated middle-tap coefficient > if Fc >= 1 KHz < Fs/2 while Fs = 12 KHz. > > The problem with Fc < 1 KHz is that the difference becomes bigger > and bigger. 2*0.3/12 = 0.05 while scopeFIR calculates 0.09. > > What is causing the difference? All help here is much appreciated.
Are the unwindowed coefficients the same? You and ScopeFIR may calculate them differently. To see if the Hamming window is just a red herring, calculate the coefficients with a rectangular window. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
Reply by Gert Baars September 14, 20052005-09-14
The easiest way is to compare only the center tap which origins
from sinc(0). Here hn = 2*Fc/Fs and the Hamming window = 1.

This equals the centre tap of the ScopeFir design as long as
Fc >= 1 KHz with Fs = 12KHz with LPF.
The difference also gets very small if #TAPS gets very large
no matter what Fc is.





Fred Marshall wrote:
> "Gert Baars" <g.baars13@chello.nl> wrote in message > news:8db2b$4327bdf1$3ec23590$24049@news.chello.nl... > >>Gert Baars wrote: >> >>I corrected the previous message. >> >>Hello, >> >>For a low-pass filter with hammingwindow I can calculate >>the coefficients manually. >> >>Lets say for n = (L-1)/2 the middle tap (#taps is odd) >> >>coefficient is 2*Fc/Fs. (The Hammingwindow here is 1). >> >>Compared to the FIR filter program ScopeFIR I get exactly >>the same values for manually calculated middle-tap coefficient >>if Fc >= 1 KHz < Fs/2 while Fs = 12 KHz. >> >>The problem with Fc < 1 KHz is that the difference becomes bigger >>and bigger. 2*0.3/12 = 0.05 while scopeFIR calculates 0.09. >> >>What is causing the difference? All help here is much appreciated. >> > > > It would help to know what algorithm you're using for designing the filter > "by hand". Only then might one compare the two.... > > Fred > >