Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Sponsor

Industry's highest performing at the lowest power DSPs now as low as $5.00*
Start development today!
*volume pricing for 10ku

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | How can I create filter with such a low lag?

There are 52 messages in this thread.

You are currently looking at messages 0 to 10.


How can I create filter with such a low lag? - Vadim - 2004-05-06 20:17:00

I need to create a lowpass digital filter with a very low lag. What
type of filter could provide such a lag (look at link)?
http://shareftp.narod.ru

red points is the original data, blue and green curves - two different
lowpass filters.

PS: sorry for mistakes.. english isn't my native language.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - Jerry Avins - 2004-05-06 21:06:00



Vadim wrote:

> I need to create a lowpass digital filter with a very low lag. What
> type of filter could provide such a lag (look at link)?
> http://shareftp.narod.ru
> 
> red points is the original data, blue and green curves - two different
> lowpass filters.
> 
> PS: sorry for mistakes.. english isn't my native language.

You want a minimum- or near-minimum-phase filter. IIRs often come close,
and asymmetric FIRs can be perfect. What are your flatness and cut-off
needs?

The only language error I see is that English isn't capitalized. You
communicate well.

Jerry
-- 
Engineering is the art of making what you want from things you can get.
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - Billy - 2004-05-07 06:58:00

On 6 May 2004 17:17:32 -0700, Vadim <v...@mail.ru> wrote:

> I need to create a lowpass digital filter with a very low lag. What
> type of filter could provide such a lag (look at link)?
> http://shareftp.narod.ru
>
> red points is the original data, blue and green curves - two different
> lowpass filters.
>
> PS: sorry for mistakes.. english isn't my native language.

Looks like
blue filter  - bidirectional lowpass (with zero lag),
green may be the same lowpass with much lower cutoff then blue applied in 
one direction (hence time lag)

-- 
(2B)|~(2B)=?
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - Vadim - 2004-05-07 10:44:00

> Looks like
> blue filter  - bidirectional lowpass (with zero lag),
> green may be the same lowpass with much lower cutoff then blue applied in 
> one direction (hence time lag)

I forgot one thing. Filters must be causal. And in my opinion,
bidirectional filter is noncausal.

This picture was cut from the paper of one russian scientist. He
didn't described what kind of filter it is, but mentioned, that this
filter provide attenuation more then 40 dB in the stop band and
absolutely don't distort magnitude and phase in the pass band.

It's obvious from the picture, that his filters are great, but I doubt
if they could be realised in practice.

PS: most likely that this filters are both of one type. The one
difference is their cutoff frequency.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - Stephan M. Bernsee - 2004-05-07 11:07:00

Unless you name the axes of your plot and put some units on them it's
doubtful that someone can really help you with your request...!

--smb

v...@mail.ru (Vadim) wrote in message news:<e...@posting.google.com>...
> I need to create a lowpass digital filter with a very low lag. What
> type of filter could provide such a lag (look at link)?
> http://shareftp.narod.ru
> 
> red points is the original data, blue and green curves - two different
> lowpass filters.
> 
> PS: sorry for mistakes.. english isn't my native language.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - Fred Marshall - 2004-05-07 12:58:00

"Vadim" <v...@mail.ru> wrote in message
news:e...@posting.google.com...
> I need to create a lowpass digital filter with a very low lag. What
> type of filter could provide such a lag (look at link)?
> http://shareftp.narod.ru
>
> red points is the original data, blue and green curves - two different
> lowpass filters.
>
> PS: sorry for mistakes.. english isn't my native language.

Vadim,

Jerry Avins already gave you pretty much the whole answer to your question
if your objective is to have the lowest possible lag.

"You want a minimum- or near-minimum-phase filter. IIRs often come close,
and asymmetric FIRs can be perfect."

His question: "What are your flatness and cut-off needs?" is very
appropriate.

Perhaps a little more insight:

The more narrow the passband, the greater the "smoothness" of the response
and the greater the lag.
So, you want to design a filter with the widest possible pass band to get
the shortest possible lag (and, minimum phase to get the shortest lag under
these bandwidth circumstances).
To avoid "ringing" at sharp edges you may also want to taper the transition
from pass band to stop band - but you didn't ask about that.
Actually, tapering the transition band and having a shorter FIR filter go
hand in hand with having the least lag.
The smoother the passband, the more attenuation in the stop band and the
narrower the transition band all drive the filter to be longer and increases
the lag.  So, be modest in your requirements - particularly the stopband
attenuation and the transition width - to get the shortest filter possible.

So, I would do this:

1) decide how wide the passband can be - wider is better.  This is a
critical decision for you.  If you have the luxury of being able to
experiment then that may be a help in determining how wide.

2) Given the width, choose a design method that will yield a minimum phase
filter.
One such approach would design an odd-length symmetric FIR filter using
something like the Parks-McClellan program or Matlab's "remez".
Then add a small constant to the frequency response by increasing the center
coefficient of the filter so that the entire frequency response is never
negative.
Then factor the filter impulse response / polynomial and remove all the
zeros that are outside the unit circle and make any unit circle double zeros
into single zeros.
Then multiply out the resulting roots into a polynomial form to yield filter
coefficients.
This new filter will be minimum phase.
The stop band ripple will be larger than you started with - measured in dB
by a factor of two.  So, if you need -40dB in the end, you need to design
for -80dB at the beginning.
The resulting filter will be 1/2 * (the length of the starting filter -1) +1

Later you said:
"This picture was cut from the paper of one russian scientist. He
didn't described what kind of filter it is, but mentioned, that this
filter provide attenuation more then 40 dB in the stop band and
absolutely don't distort magnitude and phase in the pass band."

If there is "absolutely no phase distortion" in the pass band then this
means one of two things:
- the filter is linear phase and not minimum phase / minimum lag.
- the filter is nearly linear phase in the passband which also means it
probably isn't minimum phase / minimum lag.

The lag factors shown in the pictures suggest that there is a very large
difference between the two filters.  The difference in apparent lags is much
greater than a factor of 2.  That is, the lag of the slower filter is maybe
10 times the lag of the faster filter.
This suggests that a factor of 2 greater than "absolutely minimum lag" may
be acceptable to you and that you can use a linear phase filter of the
appropriate bandwidth to get absolutely no phase distortion and acceptable
lag performance.

So, again, I'd start with the filter bandwidth.....

Fred


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - Ronald H. Nicholson Jr. - 2004-05-07 16:21:00

In article <e...@posting.google.com>,
Vadim <v...@mail.ru> wrote:
>I need to create a lowpass digital filter with a very low lag. 

Is the data real-time or not?  If the data is not real-time one might
be able to use a "non-causal" filter to get zero or even negative lag.


IMHO. YMMV.
-- 
Ron Nicholson   rhn AT nicholson DOT com   http://www.nicholson.com/rhn/ 
#include <canonical.disclaimer>        // only my own opinions, etc.
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - Symon - 2004-05-07 16:34:00

Eh? Why would the lag matter if the data weren't real time?
Syms.
"Ronald H. Nicholson Jr." <r...@mauve.rahul.net> wrote in message
news:c7gr4h$9k5$2...@blue.rahul.net...
>
> Is the data real-time or not?  If the data is not real-time one might
> be able to use a "non-causal" filter to get zero or even negative lag.
>


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - jim - 2004-05-07 16:53:00


Symon wrote:
> 
> Eh? Why would the lag matter if the data weren't real time?

That's a good question. You should ask the OP. The image (the OP posted a
link) he is aking about was clearly not done in real time and that is the
entire explanation of why there is no lag. He also, made it clear that the
filter used in that image was linear phase. So does he want to know about that
filter, or about some other filter that is causal and has little or no lag?

-jim


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----==  Over 100,000 Newsgroups - 19 Different Servers! =-----
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: How can I create filter with such a low lag? - Matt Timmermans - 2004-05-07 23:52:00

"Vadim" <v...@mail.ru> wrote in message
news:e...@posting.google.com...
> I need to create a lowpass digital filter with a very low lag. What
> type of filter could provide such a lag (look at link)?
> http://shareftp.narod.ru
>
> red points is the original data, blue and green curves - two different
> lowpass filters.
>
> PS: sorry for mistakes.. english isn't my native language.

An interesting way to design real-valued, discrete, minimum phase filters
with delay constraints is by using the cosine decomposition of the
log-magnitude of the frequency response.  The cosine decomposition can be
used, because the magnitude response of such filters is both even and
periodic.

A filter with a log-magnitude response given by:

ln(|H(w)|)=Acos(kw)

has minimum-phase group delay, in samples:

D(w)=kAcos(kw)

Furthermore if you add two log-magnitude responses together, you can just
add their minimum-phase group delays together to get the minimum phase group
delay of the resulting log-magnitude response.

Because of this linear relationship, you can use a weighted least-squares
fit to design the filter, optimizing the tradeoff between magnitude response
errors (in DB), versus passband group delays (in samples).  Oversample D(w)
and ln(|H(w)|) by a factor of 8 or so when performing this fit.

When you have an acceptable log-magnitude response, use a Hilbert transform
to generate the phase response.  Since you have the cosine decomposition of
the log magnitude response, this is easy and exact -- just substitute sines
for cosines.

Then, exponentiate to get the frequency response (e^ln(H(w)) = H(w)).

H(w) is guaranteed to represent a causal filter, with an infinite impulse
response.  Use whatever technique you like to find approximate truncated
values for this response.  Doing a sufficiently long IFFT, and discarding
the last half of the resulting samples, will usually do the trick.




______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

| 1 | 2 | 3 | 4 | 5 | 6 | next