The problem is I cannot see how they get from that formula to the final values for the filter taps they show; the formula seems to give the same answer regardless of the value for n, like this:
Taking the example in the link above...
Fc = 1Hz, Fs = 16Hz therefore Fn = 8Hz, applying:
C(n) = (Sin( n * pi * (Fc/Fn)) ) / (pi * n)
C(n) = (Sin( -2 * pi * (1/8)) ) / (pi * -2) = 0.00218
C(n) = (Sin( -1 * pi * (1/8)) ) / (pi * -1) = 0.00218
C(n) = (Sin( 0 * pi * (1/8)) ) / (pi * 0) = calculator says "Math Error" this is just plan wrong
C(n) = (Sin( 1 * pi * (1/8)) ) / (pi * 1) = 0.00218
C(n) = (Sin( 2 * pi * (1/8)) ) / (pi * 2) = 0.00218
See the problem? I assume I am misunderstanding something at a very fundamental level, but I have no idea what. I have not applied the hamming window correction formula to the results above, but in all cases the adjustment was in the range of 0.99999 which dosent alter the final filter tap values much... Any help would be greatly appreciated
First, I know nothing about electronic engineering so don't expect to much, but I was rather good at maths (lots of it as part of my software engineering degree).
IMO, the problem is simply radians/degrees conversion. Most common calculators (including the Windows one) interpret the input of the sin() function as degrees, but the presence of PI in the formula leads me to believe it should be radians. Try your formula in Excel (the sin function uses radians, not degrees) if you have it. Otherwise, you can always try to replace PI by 180 in the sin function like this:
C(n) = (Sin( n * 180 * (Fc/Fn)) ) / (pi * n)
Oh, and n must be different than 0 or you will have a division by 0 which is a mathematical error.
Thanks for taking a look; that's sorted it out, thank you! I repeated all the calculations in radians mode (both the ones in my post above, and the hamming windows ones which I didn't show) rather than degrees and sure enough things come out prety close to what they should be. It turns out that n(0) is a special case; there is seperate formula for this which is C(0) = 2Fc. I havent been able to get that to work though.
I now get
(-2) tap = 0.019
(-1) tap = 0.082
(0) tap = ... still trying to sort that one out
(1) tap = 0.082
(2) tap = 0.019
Which strangely is not exactly what is on the web site in the link, perhaps there are some errors in that site since I have applied the radians approach to some other examples of this type of problem I have and it works perfectly.
when you get limit of SIN(x)/x where x converges to 0 you get 1 . It does not matter whether you converge from minus side or plus side, therefore this is a continuous function. ( in other words there is no divide_by_zero= +/- infinite situation )
2. Hardcore mathematical answer :
When you open up SIN(x) function into Taylor series you get