DSPRelated.com
Forums

Related to FIR filters

Started by I. R. Khan June 23, 2005
Hi,

I am comparing a maximally linear (ML) FIR differentiator with an equiripple 
one. The ML filter has a monotonic response, and comparing the relative 
error curves (1- actual / ideal magnitude response) of both filters, it is 
found that ML is more accurate in the lower band below 0.88 * nyquist. Can I 
say that if we set the sampling frquency beyond (2/0.88) * maximum frequency 
in the signal, the ML will be more accurate in any application?

Regards,
Ishtiaq. 

"I. R. Khan" <ir_khan@hotmail.com> wrote in message 
news:3hv79tFitlghU1@individual.net...
> Hi, > > I am comparing a maximally linear (ML) FIR differentiator with an > equiripple one. The ML filter has a monotonic response, and comparing the > relative error curves (1- actual / ideal magnitude response) of both > filters, it is found that ML is more accurate in the lower band below 0.88 > * nyquist. Can I say that if we set the sampling frquency beyond (2/0.88) > * maximum frequency in the signal, the ML will be more accurate in any > application? > > Regards, > Ishtiaq.
Please post news posts in plain text.... Well, you *must* establish a point of reference. We had a long thread here recently about absolute vs. relative frequencies in the response of digital filters. It is best to think in relative terms. i.e. the critical frequencies (i.e. those you specify or talk about - and not the "analog" kind) as fractions of the sample rate or as fractions of 1/T where T is the unit delay in a digital filter. The latter because you could have a data sample rate of 1/T1 and a filter with unit delay of 1/T2 where T2 is an integer multiple of T1 - and I'm sure more complicated versions their relationship. So, to paraphrase what you say:
>..., it is found that ML is more accurate in the lower band below 0.88 * >fs/2 or 0.44*fs >. Can it be said that if we set the sampling frequency fs so that fs > >(2/0.88) * maximum frequency in the signal, the ML will be more accurate in >any application?
Hmmmm.... I can't even quite get there. The problem is you use the term "nyquist" which often means fs/2 and sometimes means B where B is the bandwidth of the signal. Obviously these can be different. Relative to a signal with bandwidth B, the Nyquist rate is 2B and the sampling rate must be higher than this rate. Relative to an established sample rate fs, half the sample rate fs/2 is often labeled the "Nyquist frequency" for which it is said that the bandwidth of a signal B must be less than fs/2. No wonder folks get confused.... It's better to use "sampling frequency or sampling interval" and not Nyquist. Nyquist is a limit and you can't "measure" it in a real system. But, you can measure the sample rate, know the filter unit delay and estimate signal bandwidth without mentioning Mr. Nyquist - except to brag about knowing he will be happy looking down at what you are doing and have comfort that engineers will approve of your approach (and have some assurance that you have not caused aliasing). Let's start with a filter with unit delays of 1/T2 and a sample rate that is 1/T1 and we will also start with T1=T2 which is the usual case. Now, if you reduce T1 to increase the sample rate *and* reduce the filter unit delay T2 to maintian equality, then the critical frequencies of the filter will increase in an absolute sense and will remain unchanged in a relative sense. The quality that you mention will extend to higher frequencies. But, I would caution that you consider the other impacts of doing that. For example, if this were a lowpass filter and you want to have low error in the passband then the passband *width* would increase by using this method - and maybe that's unacceptable. With a differentiator you pay by having the higher sample rate is all (I think). Fred
Thanks Fred.

> Please post news posts in plain text....
Are my posts not in plain text? I am using Japanese Outlook Express and cannot understand and set all the options. I will try to find some other non-japanese software for posting. From your reply what I could understand is that if ML differentiator A is more accurate below 0.44fs than equiripple differentiator B, then by setting fs to a new value > fmax/0.44, we can ensure a higher accuracy with A. Now, say we don't have a control over fs, and we have just data samples. Now we don't know if all the useful information lies below 0.44fs or some part of it is beyond this point as well. Can we do some "upsampling -> differentiation with A -> downsampling", and ensure higher accuracy as compared to "differentiation with B". I might be very much wrong in this. Please bear with me. Regards, Ishtiaq.
in article 3i14urFj8m86U1@individual.net, I. R. Khan at ir_khan@hotmail.com
wrote on 06/23/2005 21:17:

> Thanks Fred. > >> Please post news posts in plain text.... > > Are my posts not in plain text?
they appear to be plain ASCII to me. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message 
news:BEE0DFB7.8829%rbj@audioimagination.com...
> in article 3i14urFj8m86U1@individual.net, I. R. Khan at > ir_khan@hotmail.com > wrote on 06/23/2005 21:17: > >> Thanks Fred. >> >>> Please post news posts in plain text.... >> >> Are my posts not in plain text? > > they appear to be plain ASCII to me. > > -- > > r b-j rbj@audioimagination.com > > "Imagination is more important than knowledge." >
Well, they "appear" to be plain text to me too because of how I view news. However, when I Reply, it comes up in Arial - which is unusual. Usually replies also come up in plain text. Thus my remark. I really don't think it's at my end. Fred
Fred, perhaps you missed second part of my post :-)

In this post:
fs = sampling frequency
ML = maximally linear
fmax = maximum frequency in the signal
DD = digital differentiator

From your reply what I could understand is that if ML DD A is
more accurate below 0.44fs than equiripple DD B, then by setting
fs to a new value > fmax/0.44, we can ensure a higher accuracy with A.

Now, say we don't have a control over fs, and we have just data samples. Now
we don't know if all the useful information lies below 0.44fs or some part
of it is beyond this point as well. Can we do some "upsampling ->
differentiation with A -> downsampling", and ensure higher accuracy as
compared to "differentiation with B".

As you know ML DDs have very high accurcies, so if above idea is 
implementable, then we can perform diferentiation at very high accuracies. I 
have actullay found that a ML DD of length 4 (length = no of coefficients) 
is more accurate in 0.42fs, while a ML DD of length 100 is more accurate in 
0.46fs, as compared to equiripple DDs of the same lengths. So roughly if we 
can increase the sampling frequency by 20%, we can guarantee higher 
accuracies with ML DDs for any length.

Please comment.

Regards,
Ishtiaq. 

"I. R. Khan" <ir_khan@hotmail.com> wrote in message 
news:3i2649Fjh2rgU1@individual.net...
> Fred, perhaps you missed second part of my post :-) > > In this post: > fs = sampling frequency > ML = maximally linear > fmax = maximum frequency in the signal > DD = digital differentiator > > From your reply what I could understand is that if ML DD A is > more accurate below 0.44fs than equiripple DD B, then by setting > fs to a new value > fmax/0.44, we can ensure a higher accuracy with A. > > Now, say we don't have a control over fs, and we have just data samples. > Now > we don't know if all the useful information lies below 0.44fs or some part > of it is beyond this point as well. Can we do some "upsampling -> > differentiation with A -> downsampling", and ensure higher accuracy as > compared to "differentiation with B". > > As you know ML DDs have very high accurcies, so if above idea is > implementable, then we can perform diferentiation at very high accuracies. > I have actullay found that a ML DD of length 4 (length = no of > coefficients) is more accurate in 0.42fs, while a ML DD of length 100 is > more accurate in 0.46fs, as compared to equiripple DDs of the same > lengths. So roughly if we can increase the sampling frequency by 20%, we > can guarantee higher accuracies with ML DDs for any length. > > Please comment. > > Regards, > Ishtiaq.
Ishtiaq, I don't know much practical about differentiation - except that it is a "noisy" process and I *do* know from experience about that! Otherwise, my comments would be about filtering in general: First, let's just say that equiripple is designed to have the minimum peak error across a band. And what you call ML is what I call "maximally flat" has higher peak error for the same length - by virtue of the nature of the equiripple objective criterion. However, a maximally flat design "takes up" all the error at the end of the band. So, your observations would confirm that maximally flat will be better than an equiripple design if you only take some fraction of the band. There is some frequency range where their peak errors are equal. If you make the sample rate higher then you simply scale the frequency range accordingly and the amplitude numbers remain the same on a relative frequency scale. That is to say: if you increase the sample rate by 1.2, then you will move all the interesting frequencies in the filter response up by the same factor 1.2. This applies to maximally flat and equiripple and all other designs. However, since you have observed that there is some "useful" range for the maximally flat design then, as above, your amplitude criterion should extend to higher frequencies. It has not much to do with equiripple designs then. To your question about upsampling .... I'm not going to pretend to be very quick at this sort of thing. Others may well answer the question better - but without any study, here goes: In order to make the upsampling really work you are going to have to effectively lowpass filter after upsampling - unless there is some trick in changing the order of operations that I'm not mentioning here. And, there may well be because this has been a topic of discussion here and in the recent IEEE literature. Without doing the filtering, you won't have anything but zero values after upsampling. And, you need those values in order to differentiate (highpass filter). This is the typical differentiator problem: how much to lowpass filter the data before differentiation. Not enough and the result is noisy. Too much and the differentiator is too slow - i.e. has too little bandwidth. So, I think this is a bit of a tough problem but figure that someone must have analyzed it to death by now! All that said, an empirical effort seems useful - just try it. My guess is that upsampling will harm more than help. There is no free lunch. Fred
I. R. Khan wrote:

Path:
border1.nntp.dca.giganews.com!nntp.giganews.com!in.100proofnews.com!in.100proofnews.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: "I. R. Khan" <ir_khan@hotmail.com>
Newsgroups: comp.dsp
Subject: Re: Related to FIR filters
Date: Fri, 24 Jun 2005 10:17:02 +0900
Lines: 23
Message-ID: <3i14urFj8m86U1@individual.net>
References: <3hv79tFitlghU1@individual.net>
<OfCdnUD558pfSSffRVn-sw@centurytel.net>
Mime-Version: 1.0
Content-Type: text/plain;
	format=flowed;
	charset="iso-2022-jp";
	reply-type=response
Content-Transfer-Encoding: 7bit
X-Trace: individual.net vRex97G6CjbnXwrp+s7nWAQSCElwoeCKvHyIRETEpaVpcr4Q82
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
Xref: number1.nntp.dca.giganews.com comp.dsp:173396

Thanks Fred.

> Please post news posts in plain text....
Are my posts not in plain text? I am using Japanese Outlook Express and cannot understand and set all the options. I will try to find some other non-japanese software for posting. ... I can see from the header that your posts are plain text. However, the displayed size is larger than what we usually see. It must be the character set you use: iso-2022-jp. Most of us use something like ISO-8859-1. Fred owes you an appology for what he wrote and I, for what I thought. Please accept one from both of us. 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;
Fred Marshall wrote:

   ...

> My guess is that upsampling will harm more than help. There is no free > lunch.
I agree about the free lunch, but upsampling doing harm isn't intuitively obvious to me. I suspect that you may have missed the crux of what Ishtiaq wants to do. I'll put my understanding in different terms than he did to isolate the core. Given: an analog signal to be sampled, and a filter that eliminates frequencies too high to be "interesting". The filter's cutoff is not affected by the sample rate we will choose. Clearly, the sample rate must be hither than twice the filter's cutoff frequency. We intend to do digital differentiation on the sample train. Ishtiaq asks if there a higher sample rate can provide a more accurate differentiated signal than a rate close to the minimum. I think it does, but I haven't taken steps to show it. I know that many IIR filters, particularly impulse-invariant ones, work best when their critical frequencies are far below the sample rate. I see no reason to believe that differentiators can't follow that pattern, and I know that (within limits set by quantization) very simple ones do. There's rarely a free lunch, but one can often buy a good one. A higher sample rate, either in the ADC or upsampled, is a reasonable price. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message 
news:SNGdneQED-i0XyPfRVn-jA@rcn.net...
> Fred Marshall wrote: > > ... > >> My guess is that upsampling will harm more than help. >> There is no free lunch. > > > Clearly, the sample rate must be hither than twice the > filter's cutoff frequency. We intend to do digital > differentiation on the sample train. > > Ishtiaq asks if there a higher sample rate can provide a > more accurate differentiated signal than a rate close to > the minimum. I think it does, but I haven't taken steps to > show it.
Depends on the differentiator. There are some FIR filters for which the variance reduction factor for a differentiating filter depends explicitly on the sample rate. An intuitive way to see this is to consider the presence of noise in the signal. Take a very simple differentiator: Y(n) = (X(n) - X(n-1)) / T For large T (the sample period), Y(n) approaches the average rate-of-change of the signal over the large delta-Time baseline. As T gets smaller, Y(n) becomes more representative of the derivative of the noise. At some point, all you'll see is the derivative of noise.