[psas-avionics] Digital filters
Barton C Massey
bart at cs.pdx.edu
Mon Nov 2 16:10:42 PST 2009
You can't do a 1Hz cutoff against a 1000Hz sampling rate
with any sane single-stage design, AFAIK. The usual plan
would be to downsample the signal in a series of stages;
maybe 5 downsample-by-four stages, which would get you to
about 1Hz very nicely. The problem with this is that your
passband ripple and noise will be kind of high, and it's
pretty computationally expensive. Still it's more likely to
get you where you want to go than trying to do this as a
one-step. (It also tells you that as a rule of thumb you'd
need about a 10-pole Butterworth to do this directly; I
still wouldn't recommend it, though, as the numerical
instability problems will be very real with such high-order
You can also think very-high-order FIR, but it would be very
high order indeed.
Caveat: I have no idea what I'm talking about. Act
In message <20091102140516.20346wqzurbms7mk at webmail.pdx.edu> you wrote:
> Hey All,
> I'm looking for advice from someone who's DSP foo is stronger than
> mine to help with a filter applied to the roll control system..
> Implement a 2nd-order low-pass filter (butterworth would be fine) with
> a 1Hz cutoff frequency and a sampling rate of 1000Hz. Input is uint16,
> 0-65535 from an ADC.
> My usual solution:
> Create the appropriate transfer function, then use Matlab c2d command
> to obtain the coefficients. Finally, build the filter as a series of
> first order difference equations. This is working in several products
> in production, but isn't quite right for our rocket roll-controller.
> The reason this isn't working:
> 1) Matlab c2d gives only 4 significant figures, regardless of the
> format setting.
> 2) Using only 4 significant figures propagates errors in the filter
> which make it unstable.
> 3) When the coefficients are obtained by calculation (float-doubles),
> the DC offset is too big to make the filter useful when converted to
> fixed point math.
> 4) The fixed point data sizes get kind-of big for such a simple filter
> (long long) if I want to keep my resolution.
> 5) Filter coefficients for a 1000Hz sample rate and a 1Hz cutoff are
> so far apart in size (1 vs. 0.00000009808) that 64 bit math or slower
> sampling are likely the only solutions.
> A couple of questions:
> 1) Is there another way to realize a discrete fixed-point filter that
> has little (1-2 LS bits) offset and full resolution on a 16 bit input?
> 2) Can another filter be designed more easily ( I had to derive the
> filter using a bilinear transform. Frequency warping wasn't used
> because the sampling frequency is much faster than the corner
> frequency. )?
> Anyone have any thoughts?
> psas-avionics mailing list
> psas-avionics at lists.psas.pdx.edu
More information about the psas-avionics