|
![](/i/fill.gif) |
On 9/10/2010 3:42 AM, Invisible wrote:
> On 10/09/2010 09:38 AM, Invisible wrote:
>
>> Next fun thing: Transforming from rectangular to polar coordinates. It's
>> not as simple as you think it is.
>
What the whole arctangent thing? Oh, yeah... Thankfully most programming
languages have a function called atan2 ;)
Magnitude is simple to calculate, though. It's just the distance formula
after all.
I only wish I had this enthusiasm for mathematics when I was in school.
It would have made my algebra, geometry and trig classes much more
enjoyable.
> Other fun things:
>
> * If you place a pole and a zero on top of each other, mathematics says
> they should cancel each other out. In the real world, this doesn't work
> at all! (It's called a pole-zero cancellation, and you want to stay the
> hell away from it.)
Ooh, Hmm... lets see: 0/0 .... would that be a big fat "NaN"? I know
that as a denominator approaches 0 the quotient approaches infinity. 0
in the numerator is always 0, but I don't know that 0 divided by itself
is defined.
And yes, it appears that for IEEE floats that is definitely the case (at
least, on the Intel architecture.) that 0 divided by itself is NaN.
> * An IIR filter is a feedback loop. Feedback magnifies rounding errors.
> So after you design your filter, you may find that it doesn't actually
> have the frequency response it's supposed to have. (Depending on whether
> you use fixed-point or floating-point arithmetic, and at what precision.)
Right. I was having a bit of fun with this exact fact the other day with
Falstad's filter applet. I pushed the filter to the point where it would
rounding error slowly crept in. It was interesting to listen to as it
started as white noise, but occasional harmonics would sneak in and
dance around. Eventually the program would give up, claiming
instability. I'm not sure when the applet decides the filter is
unstable, My guess is when a result is infinite or NaN that's it. You
can't adjust gain on that, and it doesn't translate to a finite integer
very well. I suppose you could clip....
> * The more poles a lowpass filter has, the better its frequency response
> theoretically becomes. However, more poles increases the passband gain,
> so you have to turn down the A-coefficients, while the extra poles keep
> increasing the number and magnitude of the B-coefficients. Gradually you
> end up with a filter that's less and less sensitive to its input
> (A-coefficients), and has higher and higher gain in the feedback path
> (B-coefficients). Can you spell "unstable"?
Yep. With all filter types there's a limit to the number of pole/zero
pairs you can use before the filter loses stability.
What's also extremely interesting is the fact that the poles/zeros of
the IIR filter can be used to design that filter as an electronic circuit.
--
~Mike
Post a reply to this message
|
![](/i/fill.gif) |