Reply by dbell September 12, 20062006-09-12
You normally have to either know the degree of bandwidth limitation or
enforce the degree of bandwidth limitation in order to properly design
the next stage of filtering.

Dirk Bell
DSP Consultant

jim wrote:
> dbell wrote: > > > Originaly the discussion was about 3 filters and that was what I was > > commenting on. I have reread those posts and I don't see anything > > incorrect in what I said related to that, but the normal way (usually > > optimal) is to bandlimit first, then effectively zeropad and filter > > with generally progressively shorter half-band filters at successively > > higher sample rates. > > > The original discussion was about interpolation. That is a term that is > often used loosely, but if the OP needs to have his original 1 Mhz > samples preserved with 7 new samples injected between to create a smooth > 8 Mhz signal he should not do what you are recommending. Preserving the > original sample points sounds like what he may need, since it sounds > like his samples are the output from a filter that has already > attenuated the upper frequencies. > On the other hand, if his signal to be interpolated contains a lot of > content near fs/2 and he doesn't care if the new interpolated 8mhz > signal misses the original 1mhz sample points then what you recommend > makes sense. > > -jim > > > > > > > > > > > > > Yes, the ripple factor is a good point. > > > > > > If you do a four-filter system and you need to keep as much of the > > > original signal as possible, then you're still going to have a mighty > > > narrow transition band even working at Fs. It's not at all clear to me > > > that the taps you're saving due to a larger transition band offset the > > > extra taps that would be required for really sharp interpolating > > > filters, especially when you consider that this filter is no longer > > > half-band. > > > > > > > The length of the filter operating at the lowest sample rate would be > > shorter by a factor of about 2 to meet the same specs, and shorter > > still if the non-equal ripple is taken into account. This should more > > than offset the zero taps at the higher rate. If you widen up the > > transition band early, you may be able to reduce the taps in the > > half-band filters (sometimes funny things happen, like one half-band > > length may be overkill and the next shorter one may be inadequate). > > > > I have used half-band filters alot over the years (almost every job) > > and it can be a non-trivial optimization problem especially with > > something like 7 stages of decimation by 2, non-half-band FIR, followed > > by 7 stages of interpolation by 2, used as part of a narrow notch > > filter. A succession of different design attempts may be considered. > > (Of course you could use available multirate design software, but I > > like to control the details.) > > > > I don't know of a real nice "proof" for the case of 4 stages (3 > > half-band) over the other options except try different design > > approaches (taps, ripple, transition for eachstage) for a given set of > > specs and see what is "best". My experience in different application > > areas leads me to believe the way to go is virtually always > > non-half-band filter first (assuming not already sufficiently > > bandlimited), then use the half-band filters for interpolation, and do > > the opposite for decimation. It seems to be the standard procedure. > > > > If you look in Rabiner and Crochierre's (spelling?) Multirate DSP book > > (and maybe in their long IEEE article), they give you some tools > > (equations) to estimate attenuation/length/computation tradeoffs, and > > some general example results to get a feel for what is possible. > > > > Dirk > > > > Dirk Bell > > DSP Consultant > > > > > This is getting into a multidimensional optimization problem and > > > I'm not at all sure I've got my mind around everything. > > > > > > --Randy > > > > > > > <snipped> > > ----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- > http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups > ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Reply by Rick Lyons September 12, 20062006-09-12
On 11 Sep 2006 08:24:55 -0700, "dbell" <bellda2005@cox.net> wrote:

  (snipped)
> >It will remove the upper image only if the upper image completely falls >in the stopband of the half-band filter and there is no significant >signal in the transition band, i.e. it is bandlimited as described >above. > >Dirk Bell >DSP Consultant
Hi, Whenever I think about sample rate change systems I'm usually thinking about decimation. With decimation by 8, it's fine to implement: half-band filter, downsample by two (discard alt. samples), half-band filter again, downsample by two, half-band filter again, downsample by two. After the last 'downsample by two' step there will be a little spectral aliasing in the vicinity of half the final sample rate. How much is "little" depends on the width of the half-band filter's transition region. However, the amount of aliasing does *NOT* depend on the bandwidth of the original signal. Now if I happened to be waiting in line to buy a Lottery ticket at the liquor store and someone asked me, "Is it acceptable to perform interpolation by 8 using: upsample by two (insert a zero sample) half-band filter upsample by two half-band filter again upsample by two half-band filter again?", due to the strong complementary relationships between decimation and interpolation, My first reaction would be, "Yep, that should work fine." But Dirk makes the really great point that the above interpolation steps may *NOT* work fine. His warning about interpolation using half-band filters is something that I don't remember thinking about before. (I don't think much about interpolation because interpolation is for sissies.) Dirk has pointed out that the amount of image-rejection--the accuracy of the overall interpolation process--depends on two things: (1)the transition region width of the half-band filter *AND* (2)the bandwidth of the original signal. So what I hope I can remember from all of this, thanks to Dirk, is: When performing decimation by an integer power of two using half-band filters, the "quality" of the decimation process does NOT depend on the bandwidth of the original signal. When performing interpolation using half-band filters, the "quality" of the interpolation process DOES depend on the bandwidth of the original signal. See Ya', [-Rick-]
Reply by jim September 12, 20062006-09-12

dbell wrote:

> Originaly the discussion was about 3 filters and that was what I was > commenting on. I have reread those posts and I don't see anything > incorrect in what I said related to that, but the normal way (usually > optimal) is to bandlimit first, then effectively zeropad and filter > with generally progressively shorter half-band filters at successively > higher sample rates.
The original discussion was about interpolation. That is a term that is often used loosely, but if the OP needs to have his original 1 Mhz samples preserved with 7 new samples injected between to create a smooth 8 Mhz signal he should not do what you are recommending. Preserving the original sample points sounds like what he may need, since it sounds like his samples are the output from a filter that has already attenuated the upper frequencies. On the other hand, if his signal to be interpolated contains a lot of content near fs/2 and he doesn't care if the new interpolated 8mhz signal misses the original 1mhz sample points then what you recommend makes sense. -jim
> > > > > Yes, the ripple factor is a good point. > > > > If you do a four-filter system and you need to keep as much of the > > original signal as possible, then you're still going to have a mighty > > narrow transition band even working at Fs. It's not at all clear to me > > that the taps you're saving due to a larger transition band offset the > > extra taps that would be required for really sharp interpolating > > filters, especially when you consider that this filter is no longer > > half-band. > > > > The length of the filter operating at the lowest sample rate would be > shorter by a factor of about 2 to meet the same specs, and shorter > still if the non-equal ripple is taken into account. This should more > than offset the zero taps at the higher rate. If you widen up the > transition band early, you may be able to reduce the taps in the > half-band filters (sometimes funny things happen, like one half-band > length may be overkill and the next shorter one may be inadequate). > > I have used half-band filters alot over the years (almost every job) > and it can be a non-trivial optimization problem especially with > something like 7 stages of decimation by 2, non-half-band FIR, followed > by 7 stages of interpolation by 2, used as part of a narrow notch > filter. A succession of different design attempts may be considered. > (Of course you could use available multirate design software, but I > like to control the details.) > > I don't know of a real nice "proof" for the case of 4 stages (3 > half-band) over the other options except try different design > approaches (taps, ripple, transition for eachstage) for a given set of > specs and see what is "best". My experience in different application > areas leads me to believe the way to go is virtually always > non-half-band filter first (assuming not already sufficiently > bandlimited), then use the half-band filters for interpolation, and do > the opposite for decimation. It seems to be the standard procedure. > > If you look in Rabiner and Crochierre's (spelling?) Multirate DSP book > (and maybe in their long IEEE article), they give you some tools > (equations) to estimate attenuation/length/computation tradeoffs, and > some general example results to get a feel for what is possible. > > Dirk > > Dirk Bell > DSP Consultant > > > This is getting into a multidimensional optimization problem and > > I'm not at all sure I've got my mind around everything. > > > > --Randy > > > > <snipped>
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups ----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Reply by dbell September 11, 20062006-09-11
Randy Yates wrote:

> > I follow you up to the point you say "You are describing doing the > filtering AFTER the first zero-padding...". You're not? It sounds like > you're now proposing a four-filter system, the first one being at Fs > to limit the energy just below Fs/2, then the other three as > interpolating filters. Whereas I thought that you were originally > proposing a three-filter system - all interpolating filter, but the > first one just not half-band - and in that case you still have the > "half-transition band" problem.
Originaly the discussion was about 3 filters and that was what I was commenting on. I have reread those posts and I don't see anything incorrect in what I said related to that, but the normal way (usually optimal) is to bandlimit first, then effectively zeropad and filter with generally progressively shorter half-band filters at successively higher sample rates.
> > Yes, the ripple factor is a good point. > > If you do a four-filter system and you need to keep as much of the > original signal as possible, then you're still going to have a mighty > narrow transition band even working at Fs. It's not at all clear to me > that the taps you're saving due to a larger transition band offset the > extra taps that would be required for really sharp interpolating > filters, especially when you consider that this filter is no longer > half-band. >
The length of the filter operating at the lowest sample rate would be shorter by a factor of about 2 to meet the same specs, and shorter still if the non-equal ripple is taken into account. This should more than offset the zero taps at the higher rate. If you widen up the transition band early, you may be able to reduce the taps in the half-band filters (sometimes funny things happen, like one half-band length may be overkill and the next shorter one may be inadequate). I have used half-band filters alot over the years (almost every job) and it can be a non-trivial optimization problem especially with something like 7 stages of decimation by 2, non-half-band FIR, followed by 7 stages of interpolation by 2, used as part of a narrow notch filter. A succession of different design attempts may be considered. (Of course you could use available multirate design software, but I like to control the details.) I don't know of a real nice "proof" for the case of 4 stages (3 half-band) over the other options except try different design approaches (taps, ripple, transition for eachstage) for a given set of specs and see what is "best". My experience in different application areas leads me to believe the way to go is virtually always non-half-band filter first (assuming not already sufficiently bandlimited), then use the half-band filters for interpolation, and do the opposite for decimation. It seems to be the standard procedure. If you look in Rabiner and Crochierre's (spelling?) Multirate DSP book (and maybe in their long IEEE article), they give you some tools (equations) to estimate attenuation/length/computation tradeoffs, and some general example results to get a feel for what is possible. Dirk Dirk Bell DSP Consultant
> This is getting into a multidimensional optimization problem and > I'm not at all sure I've got my mind around everything. > > --Randy >
<snipped>
Reply by Randy Yates September 11, 20062006-09-11
"dbell" <bellda2005@cox.net> writes:

> Randy, > > Why would you design a filter like that in the first place? It > requires a transition band that makes the filter unnecessarily long. > It would be a rare application where that narrow of a transition band > would be required. Being a halfband filter you end up sacrificing > stopband attenuation because of the constraint that the passband have > the same amount of ripple as the stopband, which could be unnecessarily > small by a factor of potentionally 100-200X. You are describing doing > the filtering AFTER the first zero-padding which unnecessarily halves > the normalized transition band (approximately doubling the number of > filter taps). > > Where's the benefit? Why not just do it right?
Dirk, I'm sloowwwly starting to synchronize my thinking with yours, but there's still one or two things that I don't understand. I follow you up to the point you say "You are describing doing the filtering AFTER the first zero-padding...". You're not? It sounds like you're now proposing a four-filter system, the first one being at Fs to limit the energy just below Fs/2, then the other three as interpolating filters. Whereas I thought that you were originally proposing a three-filter system - all interpolating filter, but the first one just not half-band - and in that case you still have the "half-transition band" problem. Yes, the ripple factor is a good point. If you do a four-filter system and you need to keep as much of the original signal as possible, then you're still going to have a mighty narrow transition band even working at Fs. It's not at all clear to me that the taps you're saving due to a larger transition band offset the extra taps that would be required for really sharp interpolating filters, especially when you consider that this filter is no longer half-band. This is getting into a multidimensional optimization problem and I'm not at all sure I've got my mind around everything. --Randy
> > Dirk Bell > DSP Consultant > > Randy Yates wrote: >> "dbell" <bellda2005@cox.net> writes (see note 1): >> > [...] >> > "Randy Yates" <yates@ieee.org> writes: >> >> I agree that any energy in the transition band of the half-band filter >> >> should be considered since it will never be filtered out (as you >> >> stated, the response at Fs/2 is only down 6 dB), and perhaps that was >> >> your main point. However, I'm not sure this is a "half-band show >> >> stopper" for Bob's application or for any real-world practical >> >> application. >> > >> > Real-world applications generally do not use a half-band filter as the >> > first filter, unless the signal is already properly bandlimited. >> >> Dirk, >> >> Why is aliasing of 0.4 percent of the upper signal so critical? To >> put some numbers to it, that means that a 48 kHz audio signal would >> have 192 Hz of aliasing at the very top-end of the band. >> >> Or if you can, give me a real example of where this minute level >> of aliasing would make a difference. Maybe I can learn something. >> >> --Randy >> >> Note 1: This post has been rearranged to eliminate top-posting. >> -- >> % Randy Yates % "How's life on earth? >> %% Fuquay-Varina, NC % ... What is it worth?" >> %%% 919-577-9882 % 'Mission (A World Record)', >> %%%% <yates@ieee.org> % *A New World Record*, ELO >> http://home.earthlink.net/~yatescr >
-- % Randy Yates % "Rollin' and riding and slippin' and %% Fuquay-Varina, NC % sliding, it's magic." %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Living' Thing', *A New World Record*, ELO http://home.earthlink.net/~yatescr
Reply by dbell September 11, 20062006-09-11
Randy,

Why would you design a filter like that in the first place?  It
requires a transition band that makes the filter unnecessarily long.
It would be a rare application where that narrow of a transition band
would be required. Being a halfband filter you end up sacrificing
stopband attenuation because of the constraint that the passband have
the same amount of ripple as the stopband, which could be unnecessarily
small by a factor of potentionally 100-200X. You are describing doing
the filtering AFTER the first zero-padding which unnecessarily halves
the normalized transition band (approximately doubling the number of
filter taps).

Where's the benefit? Why not just do it right?

Dirk Bell
DSP Consultant

Randy Yates wrote:
> "dbell" <bellda2005@cox.net> writes (see note 1): > > [...] > > "Randy Yates" <yates@ieee.org> writes: > >> I agree that any energy in the transition band of the half-band filter > >> should be considered since it will never be filtered out (as you > >> stated, the response at Fs/2 is only down 6 dB), and perhaps that was > >> your main point. However, I'm not sure this is a "half-band show > >> stopper" for Bob's application or for any real-world practical > >> application. > > > > Real-world applications generally do not use a half-band filter as the > > first filter, unless the signal is already properly bandlimited. > > Dirk, > > Why is aliasing of 0.4 percent of the upper signal so critical? To > put some numbers to it, that means that a 48 kHz audio signal would > have 192 Hz of aliasing at the very top-end of the band. > > Or if you can, give me a real example of where this minute level > of aliasing would make a difference. Maybe I can learn something. > > --Randy > > Note 1: This post has been rearranged to eliminate top-posting. > -- > % Randy Yates % "How's life on earth? > %% Fuquay-Varina, NC % ... What is it worth?" > %%% 919-577-9882 % 'Mission (A World Record)', > %%%% <yates@ieee.org> % *A New World Record*, ELO > http://home.earthlink.net/~yatescr
Reply by Randy Yates September 11, 20062006-09-11
"dbell" <bellda2005@cox.net> writes (see note 1):
> [...] > "Randy Yates" <yates@ieee.org> writes: >> I agree that any energy in the transition band of the half-band filter >> should be considered since it will never be filtered out (as you >> stated, the response at Fs/2 is only down 6 dB), and perhaps that was >> your main point. However, I'm not sure this is a "half-band show >> stopper" for Bob's application or for any real-world practical >> application. > > Real-world applications generally do not use a half-band filter as the > first filter, unless the signal is already properly bandlimited.
Dirk, Why is aliasing of 0.4 percent of the upper signal so critical? To put some numbers to it, that means that a 48 kHz audio signal would have 192 Hz of aliasing at the very top-end of the band. Or if you can, give me a real example of where this minute level of aliasing would make a difference. Maybe I can learn something. --Randy Note 1: This post has been rearranged to eliminate top-posting. -- % Randy Yates % "How's life on earth? %% Fuquay-Varina, NC % ... What is it worth?" %%% 919-577-9882 % 'Mission (A World Record)', %%%% <yates@ieee.org> % *A New World Record*, ELO http://home.earthlink.net/~yatescr
Reply by dbell September 11, 20062006-09-11
Randy Yates wrote:

<clipped>.
> > That's true if you require ALL image frequency components from Fs/2 to > Fs (where Fs is the original input sample rate) to be attenuated by > the stopband attenuation. > > However, is this really necessary? For example, what if only 1/100th > of the image frequency bandwidth bled through (at Fs/2)? Or how about > 1/1000th? At some point, it's probably going to be practically a > non-issue, but I'm not sure where that point is. In most practical > designs, there is some "overkill" in the sample rate, so that there > is not much energy up near Fs/2 anyway. > > FYI, I played around with remez and found a 999-tap half-band filter > that had a stopband attenuation of >70 dB with a stopband begin > frequency of only 0.504 (where 1 corresponds to the original sample > rate of Fs). Now 999 taps sounds like a lot, but about half of them > are zero and it's symmetric, so that means you'd only have to store > about 250 coefficients for this magnificent filter. Perhaps Bob can > store 250 coefficients in his FPGA but not 637.
What is usually not necessary is preserving the signal up to Fs/2. However, in real-world applications (forensic analysis, audio, DSP-based receivers,...) the presence of the image at any significant levels is often unacceptable. Real-world applications generally do not use a half-band filter as the first filter, unless the signal is already properly bandlimited. You normally use a non-half-band filter at the lowest sample rate, then use half-band filters following the effective zero-insertions. The length required for the half-band filters normally decreases as the sample rate is progressively increased. Half-band filters that I have seen and used are pretty short (3, 7, 11, 15, ..127 taps), with the longer lengths being unusual. Dirk Bell DSP Consultant
> > I agree that any energy in the transition band of the half-band filter > should be considered since it will never be filtered out (as you > stated, the response at Fs/2 is only down 6 dB), and perhaps that was > your main point. However, I'm not sure this is a "half-band show > stopper" for Bob's application or for any real-world practical > application. > -- > % Randy Yates % "I met someone who looks alot like you, > %% Fuquay-Varina, NC % she does the things you do, > %%% 919-577-9882 % but she is an IBM." > %%%% <yates@ieee.org> % 'Yours Truly, 2095', *Time*, ELO > http://home.earthlink.net/~yatescr
Reply by Fred Marshall September 11, 20062006-09-11
<stenasc@yahoo.com> wrote in message 
news:1157971790.116226.26660@d34g2000cwd.googlegroups.com...
> Hi all, > > If I take an example of a 16 tap fir and use a polyphase structure of 4 > filters each containing 4 taps, will the symmetrical properties of the > filter be negated?
Just to belabor the point I made earlier: A polyphase implementation does not change the filter - it better not! So, any filtering properties should be retained. Like the unit sample response (symmetric perhaps) and the frequency/phase response. Well, any time you change how the arithmetic is done - in what order, etc. there can be roundoff differences but I'm ignoring *that* in saying that the filter is implementation independent. Of course there are things that are changed such as numerical efficiency, etc. but that's the real point of using a polyphase structure / implementation and so I'm not talking about *that* either. Fred
Reply by Randy Yates September 11, 20062006-09-11
stenasc@yahoo.com writes:

> Hi all, > > If I take an example of a 16 tap fir and use a polyphase structure of 4 > filters each containing 4 taps, will the symmetrical properties of the > filter be negated? > > e.g > > c0, c1, c2 .....c15 > > becomes > > c0, c4, c8, c12 > c1, c5, c9, c13 > c2, c6, c10, c14 > c3, c7, c11, c15 > > It look to me that for the individual filter, there is no symmetry. Can > the coefficients be rearranged? > > Thanks > Bob
Hi Bob, As far as storage is concerned, it doesn't matter that the individual polyphase filters aren't symmetric as long as the "overall" filter is symmetric. Then, using your example, c7 = c8 c6 = c9 c5 = c10 c4 = c11 c3 = c12 c2 = c13 c1 = c14 c0 = c15 However, if you were trying to optimize the operations by summing two inputs and multiplying once, then you're out of luck as far as I can tell. -- % Randy Yates % "My Shangri-la has gone away, fading like %% Fuquay-Varina, NC % the Beatles on 'Hey Jude'" %%% 919-577-9882 % %%%% <yates@ieee.org> % 'Shangri-La', *A New World Record*, ELO http://home.earthlink.net/~yatescr