DSPRelated.com
Forums

signal with high- and low-frequency components, real-time application

Started by Unknown May 7, 2008
Hi all,

I have a signal that consists of components with higher an lower
frequencies.
For my application I try to keep the higher frequencies and remove the
lower ones. Normally I could achieve this with a high-pass filter, but
in my case, the result is not promising.

Problem is, that I need the result in real-time, so for a newly read
sensor value I have to obtain the *LAST* filtered value without any
delay. A high-pass filter (or any filters I'm aware of), has it's
weaknesses on the borders of the signal (so the first and last values
of the signal are destorted through missing values before and after
first/last values) or it has some kind of delay.

My question: Is there a better algorithm to get appropriate results
for a newly measured sample? Sampling rate is 1 Hz and I can't wait 20
seconds till I have a stable (high-pass filtered) value.

Thanx for any hints!

Stefan

stefan_baierl@yahoo.com wrote:

> Hi all, > > I have a signal that consists of components with higher an lower > frequencies. > For my application I try to keep the higher frequencies and remove the > lower ones. Normally I could achieve this with a high-pass filter, but > in my case, the result is not promising. > > Problem is, that I need the result in real-time, so for a newly read > sensor value I have to obtain the *LAST* filtered value without any > delay.
This is equvalent to the knowledge about the future. If your signal is predictable, you can do it with more or less luck.
> A high-pass filter (or any filters I'm aware of), has it's > weaknesses on the borders of the signal (so the first and last values > of the signal are destorted through missing values before and after > first/last values) or it has some kind of delay. > > My question: Is there a better algorithm to get appropriate results > for a newly measured sample? Sampling rate is 1 Hz and I can't wait 20 > seconds till I have a stable (high-pass filtered) value.
*Any* filter makes use of the information from the past to adjust the instant value. The only way around this is if you can somehow predict the signal. I.e. if you can extrapolate the missing 20 seconds from the current. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
stefan_baierl@yahoo.com wrote:
> Hi all, > > I have a signal that consists of components with higher an lower > frequencies. > For my application I try to keep the higher frequencies and remove the > lower ones. Normally I could achieve this with a high-pass filter, but > in my case, the result is not promising. > > Problem is, that I need the result in real-time, so for a newly read > sensor value I have to obtain the *LAST* filtered value without any > delay. A high-pass filter (or any filters I'm aware of), has it's > weaknesses on the borders of the signal (so the first and last values > of the signal are destorted through missing values before and after > first/last values) or it has some kind of delay. > > My question: Is there a better algorithm to get appropriate results > for a newly measured sample? Sampling rate is 1 Hz and I can't wait 20 > seconds till I have a stable (high-pass filtered) value. > > Thanx for any hints!
If the sampling rate is 1 Hz, the signal had better not have components as high as 1/2 Hz. What high frequencies do you need to remove? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
On May 7, 4:51�pm, stefan_bai...@yahoo.com wrote:
> Hi all, > > I have a signal that consists of components with higher an lower > frequencies. > For my application I try to keep the higher frequencies and remove the > lower ones. Normally I could achieve this with a high-pass filter, but > in my case, the result is not promising. > > Problem is, that I need the result in real-time, so for a newly read > sensor value I have to obtain the *LAST* filtered value without any > delay. A high-pass filter (or any filters I'm aware of), has it's > weaknesses on the borders of the signal (so the first and last values > of the signal are destorted through missing values before and after > first/last values) or it has some kind of delay. > > My question: Is there a better algorithm to get appropriate results > for a newly measured sample? Sampling rate is 1 Hz and I can't wait 20 > seconds till I have a stable (high-pass filtered) value. > > Thanx for any hints! > > Stefan
Hello Stefan, Are you able to reasonably predict the low frequency part of the signal? If you can, then just subtract it from the total signal. Clay p.s. If you can provide more info about the frequency ranges for what you want and what you want to reject and the amount of needed rejection, we can better able help you.
stefan_baierl@yahoo.com wrote:
> Hi all, > > I have a signal that consists of components with higher an lower > frequencies. > For my application I try to keep the higher frequencies and remove the > lower ones. Normally I could achieve this with a high-pass filter, but > in my case, the result is not promising. > > Problem is, that I need the result in real-time, so for a newly read > sensor value I have to obtain the *LAST* filtered value without any > delay. A high-pass filter (or any filters I'm aware of), has it's > weaknesses on the borders of the signal (so the first and last values > of the signal are destorted through missing values before and after > first/last values) or it has some kind of delay. > > My question: Is there a better algorithm to get appropriate results > for a newly measured sample? Sampling rate is 1 Hz and I can't wait 20 > seconds till I have a stable (high-pass filtered) value. > > Thanx for any hints! >
So you're sampling intermittently? Why can't you sample continuously? Are you using an IIR filter? -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Do you need to implement control loops in software? "Applied Control Theory for Embedded Systems" gives you just what it says. See details at http://www.wescottdesign.com/actfes/actfes.html
First of all, thanks for your ideas and comments!

@Jerry
I have to *KEEP* the "high" frequencies, in my case these are about
0.1 Hz, so Nyquist is fulfilled. The part of the signal that has to be
removed is about 0.05 Hz and lower.

@Vladimir
@Clay
Yes, prediction also came to my mind. The trouble is, I don't have an
idea how to accomplish this task.

I have uploaded a small file containing a typical portion of my signal
to http://www.freewebs.com/stefanbaierl/sig1.txt
Maybe someone of you has time to look at it...
On May 7, 8:38 pm, stefan_bai...@yahoo.com wrote:
> First of all, thanks for your ideas and comments! > > @Jerry > I have to *KEEP* the "high" frequencies, in my case these are about > 0.1 Hz, so Nyquist is fulfilled. The part of the signal that has to be > removed is about 0.05 Hz and lower. > > @Vladimir > @Clay > Yes, prediction also came to my mind. The trouble is, I don't have an > idea how to accomplish this task. > > I have uploaded a small file containing a typical portion of my signal > tohttp://www.freewebs.com/stefanbaierl/sig1.txt > Maybe someone of you has time to look at it...
I noticed that you said you have to do this in real time. Do you really mean that you must do it in real time with no buffering? There's a difference between having a process with a real-time constraint (which defines the rate at which you put data out) and having a latency constraint. If you can handle a latency of just N samples, where N is the order of your highpass filter, you can still meet your real-time criterion without needing to predict the future. Otherwise, you're stuck with techniques like linear prediction, which requires the development of some sort of statistical model for your signal (or, you could create something like an adaptive LMS linear predictor). You can get some starting information here: http://en.wikipedia.org/wiki/Linear_prediction Jason
Hi Tim,

seems, that I wasn't precise enough. The signal, I'm sampling, is
provided once per second from an external device. So I'm not reading
from an ADC and therefore have no chance to get a higher update rate.

Currently I use a FIR filter (since I have a C++ implementation for
it).
Jason,

not *HARD* real-time, maybe two to three secs delay are tolerable. But
this is not enough for a standard high-pass filter:-(
stefan_baierl@yahoo.com wrote:
> First of all, thanks for your ideas and comments! > > @Jerry > I have to *KEEP* the "high" frequencies, in my case these are about > 0.1 Hz, so Nyquist is fulfilled. The part of the signal that has to be > removed is about 0.05 Hz and lower.
Nyquist is only "fulfilled" if the signal being sampled is appropriately bandlimited. If you use a low-pass analog filter to do that, can you lower its cutoff point? Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������