WhenI was working on the FSK oscillator the other day, I wanted to use a low-pass filter on the switching waveform to reduce aliasing. I used the HZ to cutoff converter posted ages ago on the forum and discovered that it has an error in the formula to convert the cutoff frequency to an alpha value. The formula in the converter is 1-((2*pi*cutoff)/(Fs-(2*pi*cutoff))), but should be 1-((2*pi*cutoff)/(Fs+(2*pi*cutoff))). Here's a corrected converter and lowpass filter.
Whoa! Thanks! I was using the heck out of the old one you posted too. This is one that really should be in the default modile collection if you ask me. Using HighPass or LowPass without it is a little hit or miss otherwise.
I found the earlier formula in a post when I was was trying to figure out what the heck alpha meant. When the cutoff frequency is low the incorrect formula is pretty close. When I tried using it at around 10 kHz, I was getting alpha values over 1 which I knew couldn't be correct. Since I usually tune things by ear anyway I never noticed that the formula was wrong.
I drank some coffee and did the equation twice, then I simplified the original equation "a=1-((2bc)/(d+2bc)) solve for c" a= aplha b= pi c= cut off d= sample rate and plugged it into wolfram alpha https://www.wolframalpha.com/input/?i=a=1-((2bc)%2F(d%2B2bc))+solve+for+c
In the end, I'm pretty sure the correct expression is Fs*((1-a)/(2*pi*a) where Fs is sample rate and a is alpha.
You are correct. I based my answer on the formula in Wikipedia article on lowpass filters. I forgot that the alpha definition that Taylor is using is the inverse of the Wikipedia article. In the Wikipedia article 1 is no smoothing and 0 is full smoothing which is the reverse of the lowpass node. It drove me crazy when I was working out the Hz to alpha, I can't believe I forgot it already. If you substitute 1-a for a in my answer you get your correct one!