DSPRelated.com
Forums

Low Pass Filter Design Help

Started by Eric Branch August 13, 2007
I am collecting data from an AC servo motor and the data collected is very
messy.  I've tried using a moving average to improve clarity but the
problem is that the moving average causes some loss of important data when
comparing the two data plots.  To make that previous statement more clear,
the data folds back on itself like an infinity symbol.  When using the
moving average to clean up the collected data, the far ends are moved
inward toward the 0 axis much more than desired.

For the real question, I know the data could be cleaned up greatly with a
FIR filter; however, I have not had any formal dsp training and am having
trouble coding a filter into visual basic.  I've seen a lot of the
formulas and code given on this site and others, but I cannot figure out
how to apply it.  Is there any simple code out there or is there an easy
way to determing the zeros and poles of data if you cannot determine the
actual function that is created?

-Eric


Eric Branch wrote:
> I am collecting data from an AC servo motor and the data collected is very > messy. I've tried using a moving average to improve clarity but the > problem is that the moving average causes some loss of important data when > comparing the two data plots. To make that previous statement more clear, > the data folds back on itself like an infinity symbol. When using the > moving average to clean up the collected data, the far ends are moved > inward toward the 0 axis much more than desired. > > For the real question, I know the data could be cleaned up greatly with a > FIR filter; however, I have not had any formal dsp training and am having > trouble coding a filter into visual basic. I've seen a lot of the > formulas and code given on this site and others, but I cannot figure out > how to apply it. Is there any simple code out there or is there an easy > way to determing the zeros and poles of data if you cannot determine the > actual function that is created?
I think you need to start further back than filter design. You cannot successfully sample a signal whose bandwidth exceeds half the sampling frequency, and it is difficult to approach that limit. The mess you see is probably -- at least in part -- aliasing caused by violating that condition. So you need an analog filter applied before the sampler. Filtering a signal delays it, and delay can be death to a servo. The delay can be made small by making the filter's cutoff frequency high. That in turn dictates a high sampling rate. Expect to sample at about twenty times the servo's effective bandwidth if you don't plan to call in a consultant. To expect less then eight times is probably dreaming. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Jerry Avins wrote:

> ... delay can be death to a servo. ...
If not death, at least convulsions. Jerry -- Engineering is the art of making what you want from things you can get. ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
On Aug 13, 3:17 pm, "Eric Branch" <eric.bra...@gatech.edu> wrote:
> I am collecting data from an AC servo motor and the data collected is very > messy. I've tried using a moving average to improve clarity but the > problem is that the moving average causes some loss of important data when > comparing the two data plots. To make that previous statement more clear, > the data folds back on itself like an infinity symbol. When using the > moving average to clean up the collected data, the far ends are moved > inward toward the 0 axis much more than desired. > > For the real question, I know the data could be cleaned up greatly with a > FIR filter; however, I have not had any formal dsp training and am having > trouble coding a filter into visual basic. I've seen a lot of the > formulas and code given on this site and others, but I cannot figure out > how to apply it. Is there any simple code out there or is there an easy > way to determing the zeros and poles of data if you cannot determine the > actual function that is created? > > -Eric
For what it's worth, a moving average *is* an FIR filter. Jason
Eric Branch wrote:
> I have not had any formal dsp training and am having > trouble coding a filter into visual basic. I've seen a lot of the > formulas and code given on this site and others, but I cannot figure out > how to apply it. Is there any simple code out there or is there an easy > way to determing the zeros and
I have had a lot of help from: <http://www.dspguide.com/pdfbook.htm> Many code examples in BASIC. I have translated them to Pascal and they just work. But as Jerry Avins suggested, you really *must* start from chapter I. DSP can be quite overwhelming...
> For what it's worth, a moving average *is* an FIR filter. > > Jason
Is it still considered FIR when implemented with a delayed differentiator (delay sets the window size) followed by an integrator? I would consider this implementation as IIR. Phil
On Aug 14, 6:23 pm, Phil <philguilleme...@alumni.uwaterloo.ca> wrote:
> > For what it's worth, a moving average *is* an FIR filter. > > > Jason > > Is it still considered FIR when implemented with a delayed > differentiator (delay sets the window size) followed by an > integrator? I would consider this implementation as IIR. > > Phil
I would agree, that cascade is an IIR filter. But it's not just a moving average at that point, so it's kind of a moot point. Jason
Phil <philguillemette@alumni.uwaterloo.ca> writes:

>> For what it's worth, a moving average *is* an FIR filter. >> >> Jason > > Is it still considered FIR when implemented with a delayed > differentiator (delay sets the window size) followed by an > integrator? I would consider this implementation as IIR. > > Phil
How many non-zero impulses are in an N-sample moving average impulse response? I rest my case (counsel pro-bono Jason). A recursive implementation does not an IIR make. -- % Randy Yates % "With time with what you've learned, %% Fuquay-Varina, NC % they'll kiss the ground you walk %%% 919-577-9882 % upon." %%%% <yates@ieee.org> % '21st Century Man', *Time*, ELO http://home.earthlink.net/~yatescr
Phil wrote:
>> For what it's worth, a moving average *is* an FIR filter. >> >> Jason > > Is it still considered FIR when implemented with a delayed > differentiator (delay sets the window size) followed by an > integrator? I would consider this implementation as IIR.
It's recursive, but (when properly implemented) has a finite impulse response. Believe it or not, that's the real defining criterion. Jerry -- Engineering is the art of making what you want from things you can get. &macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;&macr;
On Aug 14, 8:21 pm, Jerry Avins <j...@ieee.org> wrote:
> Phil wrote: > >> For what it's worth, a moving average *is* an FIR filter. > > >> Jason > > > Is it still considered FIR when implemented with a delayed > > differentiator (delay sets the window size) followed by an > > integrator? I would consider this implementation as IIR. > > It's recursive, but (when properly implemented) has a finite impulse > response. Believe it or not, that's the real defining criterion. > > Jerry > -- > Engineering is the art of making what you want from things you can get. > =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=
=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF= =AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF=AF You're right. Now that I think about it more, it does have a finite- length response; my mistake. Jason