digital low pass filter

Did anyone tried dynamic C code running a digital lowpass filter in a RCM3000?
Did it worked correctly or took a lot of machine time?

I have to filter a high frequency signal and I can�t use a DSP.
Thanks

[QUOTE=lgimenez;739]Did anyone tried dynamic C code running a digital lowpass filter in a RCM3000?
Did it worked correctly or took a lot of machine time?

I have to filter a high frequency signal and I can�t use a DSP.
Thanks[/quote]
Do you need real time filtering? If not then collect say 1024 samples at a time at some acurate sample rate, pass the array to the fftreal() function. Then in the frequency domain reduce all the frequencies above the LP cut off point to zero (best if you do this with some form of window function to eliminate the ‘end effects’) then use fftrealinv() to recover the filtered time domain data. We frequently use this technique with PC applications so I see no reason why it shouldn’t work on a RCM. One thing that shouldn’t be forgotten is the need for anti-aliassing filters in front of your analogue input, otherwise high frequencies could be aliassed in to the low frequency band that you are interested in.

There are lots of real-time digital filter implementations. You don’t give a lot of information so I don’t know how much you need to attenuate the high frequency. It also helps to know what your sampling frequency is. That said, you may be able to make do with a simple averaging filter, many of which can be constructed without multiplies.

The simplest is one outputs the average of the current and previous sample. The average is computed by adding the two samples and dividing the by two. The divide by two is simply a right shift.

If that isn’t enough you can average more samples. If the number of samples is a power of two, then the division by the number of samples is a right shift by the number of samples.

Don’t forget you still will need some sort of analog anti-alias filter.

Hello, Cairomike. Thanks for your reply.
It is a realtime filter that I need so a difference equation needs to be running on the RCM. Do you have any experience implementing a realtime digital filter with a Rabbit uP?
The idea is to start with a simple low pass filter and also implement a transfer function (a state observer) in a control loop of a DC motor. I was wondering how well rabbit work running digital filters in real time.

[QUOTE=lgimenez;804]Hello, Cairomike. Thanks for your reply.
It is a realtime filter that I need so a difference equation needs to be running on the RCM. Do you have any experience implementing a realtime digital filter with a Rabbit uP?
The idea is to start with a simple low pass filter and also implement a transfer function (a state observer) in a control loop of a DC motor. I was wondering how well rabbit work running digital filters in real time.[/quote]

Unfortunately I haven’t any experience of RT filter on RCM.

Hello Keith,

Actually my digital filter will be a space state observer implementing a z-transfer function. I wanted to know if rabbit�s performance was good dealing with recursive equations as in my application I will use a RCM3000 to run the control algorithm and probably a space state observer (I am not sure yet).
Systems wideband is 100Hz, antialiasing filter�s cut off frequency is 500Hz and sampling frequency is 1KHz.
The problem is that, although the control loop is quiet slow, the control signal needed by the control algorithm is very high (more than 10kHz). If we add other taks that the uP will be in charge of I think it will have much spare time. Let�s see.
Regards,
Luciano