Reply by robert bristow-johnson January 7, 20052005-01-07
in article 34807vF482h3eU1@individual.net, Jon Harris at
goldentully@hotmail.com wrote on 01/07/2005 12:46:

> "robert bristow-johnson" <rbj@audioimagination.com> wrote in message > news:BE036569.3A84%rbj@audioimagination.com...
...
>> there is no difference if the LPF was designed in the s-plane and converted >> to z-plane by use of the bilinear transform. the BLT maps s=j*inf to >> z=exp(j*Nyquist). but if the LPF was converted to H(z) using, say, impulse >> invariant, then frequency response aliasing occurs and the notch does not go >> down to -inf dB. > > Agreed, Robert, though I was actually thinking of an FIR notch filter in this > case.
... in article VLadnYfFLqsge0PcRVn-ig@centurytel.net, Fred Marshall at fmarshallx@remove_the_x.acm.org wrote on 01/07/2005 14:45: ...
> Yeah, I was assuming FIR design on the unit circle in the z plane - as is > often the case.
well, we can pretend that i am actually literate and that i really do read through your posts. :-\ -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by Fred Marshall January 7, 20052005-01-07
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message 
news:BE036569.3A84%rbj@audioimagination.com...
> in article o7Cdnej2p4lKaUDcRVn-tw@centurytel.net, Fred Marshall at > fmarshallx@remove_the_x.acm.org wrote on 01/06/2005 21:32: > >> "Jon Harris" <goldentully@hotmail.com> wrote in message >> news:343c9pF455tmaU1@individual.net... >>> "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message >>> news:t4-dnYJRBdvqg0HcRVn-hA@centurytel.net... > ... >>>> Maybe this would be something like a FIR notch filter at fs/2. >>> >>> What is the difference bewteen a notch filter at fs/2 and a low-pass >>> filter with >>> cut-off very close to fs/2 (assuming real filter coefs)? >> >> ***Well, I did say "maybe"..... I don't think there's a difference. >> And, I >> agree with your comments regarding implementation. > > there is no difference if the LPF was designed in the s-plane and > converted > to z-plane by use of the bilinear transform. the BLT maps s=j*inf to > z=exp(j*Nyquist). but if the LPF was converted to H(z) using, say, > impulse > invariant, then frequency response aliasing occurs and the notch does not > go > down to -inf dB.
Yeah, I was assuming FIR design on the unit circle in the z plane - as is often the case. Fred
Reply by Jon Harris January 7, 20052005-01-07
"robert bristow-johnson" <rbj@audioimagination.com> wrote in message
news:BE036569.3A84%rbj@audioimagination.com...
> in article o7Cdnej2p4lKaUDcRVn-tw@centurytel.net, Fred Marshall at > fmarshallx@remove_the_x.acm.org wrote on 01/06/2005 21:32: > > > "Jon Harris" <goldentully@hotmail.com> wrote in message > > news:343c9pF455tmaU1@individual.net... > >> "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message > >> news:t4-dnYJRBdvqg0HcRVn-hA@centurytel.net... > ... > >>> Maybe this would be something like a FIR notch filter at fs/2. > >> > >> What is the difference bewteen a notch filter at fs/2 and a low-pass > >> filter with > >> cut-off very close to fs/2 (assuming real filter coefs)? > > > > ***Well, I did say "maybe"..... I don't think there's a difference. And, I > > agree with your comments regarding implementation. > > there is no difference if the LPF was designed in the s-plane and converted > to z-plane by use of the bilinear transform. the BLT maps s=j*inf to > z=exp(j*Nyquist). but if the LPF was converted to H(z) using, say, impulse > invariant, then frequency response aliasing occurs and the notch does not go > down to -inf dB.
Agreed, Robert, though I was actually thinking of an FIR notch filter in this case.
Reply by robert bristow-johnson January 6, 20052005-01-06
in article o7Cdnej2p4lKaUDcRVn-tw@centurytel.net, Fred Marshall at
fmarshallx@remove_the_x.acm.org wrote on 01/06/2005 21:32:

> "Jon Harris" <goldentully@hotmail.com> wrote in message > news:343c9pF455tmaU1@individual.net... >> "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message >> news:t4-dnYJRBdvqg0HcRVn-hA@centurytel.net...
...
>>> Maybe this would be something like a FIR notch filter at fs/2. >> >> What is the difference bewteen a notch filter at fs/2 and a low-pass >> filter with >> cut-off very close to fs/2 (assuming real filter coefs)? > > ***Well, I did say "maybe"..... I don't think there's a difference. And, I > agree with your comments regarding implementation.
there is no difference if the LPF was designed in the s-plane and converted to z-plane by use of the bilinear transform. the BLT maps s=j*inf to z=exp(j*Nyquist). but if the LPF was converted to H(z) using, say, impulse invariant, then frequency response aliasing occurs and the notch does not go down to -inf dB. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."
Reply by Fred Marshall January 6, 20052005-01-06
"Jon Harris" <goldentully@hotmail.com> wrote in message 
news:343c9pF455tmaU1@individual.net...
> "Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message > news:t4-dnYJRBdvqg0HcRVn-hA@centurytel.net... >> >> >> I want to do some subsequent processing, like interpolation. >> For a variety of reasons I want to make sure that the coefficients around >> fs/2 are zero, so I pass the data through a lowpass filter first. > > Well, your interpolation filter is already a lowpass filter, so by > filtering > first, you are effectively going to filter the data twice. In most cases, > I > would think it would be simpler, cleaner, and more effecient to just use > that > processing time to make a better interpolation filter. > >> Maybe this would be something like a FIR notch filter at fs/2. > > What is the difference bewteen a notch filter at fs/2 and a low-pass > filter with > cut-off very close to fs/2 (assuming real filter coefs)?
***Well, I did say "maybe"..... I don't think there's a difference. And, I agree with your comments regarding implementation.
>> Or, if I'm going to interpolate anyway, I increase the sample rate by a >> factor of two and apply a halfband filter before doing anything else. > > Presumably "increase the sample rate by a factor of two" means to add a > zero > between every other sample? Again, I think you are better off combining > the two > filters into one better filter if you are going to actually implement > this.
***Exactly.
> >> So, now I turn the question around and ask: "is this *ever* a good idea >> and >> why?" > > I've heard of examples where doing large amounts of interpolation or > decimation > in multiple stages makes, but have never really fully "gotten" it myself.
***I *think* it comes from the assumption that the filtering is going to be in the time domain. It must be something like that. I've seen it in the texts and after thinking about it, I don't get why it's important to talk about either. ***Thinking in the time domain can cause one to do strange things in the frequency domain. Here's an example of something I did: - Double the sample rate. FFT / Halfband filter in frequency / IFFT. - Double the sample rate. FFT / Halfband filter in frequency / IFFT. until done.... It seems efficient because the number of time sample points keeps increasing - so the earlier filters are shorter. But that is the opposite of the situation in which frequency domain filtering by multiplication improves the efficiency. Thus, it's a carryover from time domain thinking. It's obvious after you think about it that the spectrum only needs to be replicated N times and then a single lowpass filter applied in frequency.
> >> The one example of why? that I can think of is this: >> "After this filtering, you can apply a rectangular lowpass filter in >> frequency without temporal aliasing - or at least with temporal aliasing >> quite attenuated". > > Not sure I follow that last sentence--rectangular lowpass filter in > frequency?
Yeah, a "gate" or "perfect" lowpass filter. Thus, rectangular. If the samples around fs/2 are zero, and further if some derivatives (or differences) of the samples around fs/2 are zero, then using such a filter is almost a no op and there's no or little temporal aliasing introduced I believe. Fred
Reply by Jon Harris January 5, 20052005-01-05
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
news:t4-dnYJRBdvqg0HcRVn-hA@centurytel.net...
> > OK - thanks everyone. > > I am tempted to suggest this: > > If there is a sampled time sequence, > and we want to do subsequent processing, > might it not be a good idea to lowpass filter the sequence first just to > make sure? > > I think a good example might go like this: > > I want to do some subsequent processing, like interpolation. > For a variety of reasons I want to make sure that the coefficients around > fs/2 are zero, so I pass the data through a lowpass filter first.
Well, your interpolation filter is already a lowpass filter, so by filtering first, you are effectively going to filter the data twice. In most cases, I would think it would be simpler, cleaner, and more effecient to just use that processing time to make a better interpolation filter.
> Maybe this would be something like a FIR notch filter at fs/2.
What is the difference bewteen a notch filter at fs/2 and a low-pass filter with cut-off very close to fs/2 (assuming real filter coefs)? If you draw your filter response graph with the negative frequencies wrapped around above fs/2, a low-pass looks like a notch centered around fs/2.
> Or, if I'm going to interpolate anyway, I increase the sample rate by a > factor of two and apply a halfband filter before doing anything else.
Presumably "increase the sample rate by a factor of two" means to add a zero between every other sample? Again, I think you are better off combining the two filters into one better filter if you are going to actually implement this.
> So, now I turn the question around and ask: "is this *ever* a good idea and > why?"
I've heard of examples where doing large amounts of interpolation or decimation in multiple stages makes, but have never really fully "gotten" it myself.
> The one example of why? that I can think of is this: > "After this filtering, you can apply a rectangular lowpass filter in > frequency without temporal aliasing - or at least with temporal aliasing > quite attenuated".
Not sure I follow that last sentence--rectangular lowpass filter in frequency?
Reply by HEATH RAFTERY January 5, 20052005-01-05
Fred Marshall <fmarshallx@remove_the_x.acm.org> wrote:

> "robert bristow-johnson" <rbj@audioimagination.com> wrote in message > news:BDFF93CA.3929%rbj@audioimagination.com... >> in article crd5i3$hif$1@seagoon.newcastle.edu.au, Heath Raftery at >> hraftery@myrealbox.com wrote on 01/03/2005 23:20: >>> >>> Just a WAG, but wouldn't non-zero samples at fs/2 be without magnitude >>> information? That is, energy at fs/2 could actually appear as DC, or be >>> much higher or lower in magnitude that where it is sampled. So the >>> problem is data at fs/2 gives us no phase or magnitude information.
> Re Heath's response: > I don't think it has anything to do with DC - that would match with fs.
Oops, you are quite right. Only if the DC has zero amplitude will it sample the same as a signal that has frequency at exactly fs/2 and is in phase with the sampler. That's what I meant - the sampled signal could produce nothing from a signal at fs/2 - DC was not the right way to describe that! -- *--------------------------------------------------------* | ^Nothing is foolproof to a sufficiently talented fool^ | | Heath Raftery, HRSoftWorks _\|/_ | *______________________________________m_('.')_m_________*
Reply by Andor January 5, 20052005-01-05
Hi Fred,

I'm not sure if I agree with you that is a useful procedure (even if
you want to interpolate afterwards):
"
I want to do some subsequent processing, like interpolation.
For a variety of reasons I want to make sure that the coefficients
around
fs/2 are zero, so I pass the data through a lowpass filter first. Maybe

this would be something like a FIR notch filter at fs/2.
"
However, if you want an arbitrary tight notch filter with just one
second order IIR, you can simply design an analog lowpass filter with a
cutoff frequency below fs/2 and use the bilinear transform to get the
time discrete version. The warping of the bilinear transform will make
sure that the filter frequency response at fs/2 is 0, and if you have
the cutoff frequency close enough to fs/2, phase should not be an
issue. This way you can achieve an arbitrary small transition bandwidth
with just one single biquad.

Reply by Jerry Avins January 5, 20052005-01-05
robert bristow-johnson wrote:

> in article 342m1sF4425asU1@individual.net, Jerry Avins at jya@ieee.org wrote > on 01/05/2005 12:22:
...
>The real practical problem is elsewhere. How many sample periods would >>it take to reconstruct a signal at .499*Fs? > > > to within what tolerance of error? to get it (or any other frequency < > Fs/2) right on the money, you need an infinite number of samples. sinc(u) > goes on for a long way in both directions.
The closer to Nyquist, the longer it takes to get a meaningful answer. I've seen it supposed that energy at Nyquist is intolerable, but energy at .9999 Nyquist is just dandy. Whatever theory leads to that conclusion is woefully incomplete. 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;
Reply by robert bristow-johnson January 5, 20052005-01-05
in article 342m1sF4425asU1@individual.net, Jerry Avins at jya@ieee.org wrote
on 01/05/2005 12:22:

> Fred Marshall wrote: > >> "robert bristow-johnson" <rbj@audioimagination.com> wrote in message >> news:BDFF93CA.3929%rbj@audioimagination.com... > > ... > >>> the problem with non-zero energy at Nyquist is that you cannot >>> reconstruct that frequency component unambiguously. there is an >>> infinite number of combinations of phase and magnitude of the Nyquist >>> component that would result in the exact same sampled data.
...
> The argument that a signal at Fs/2 can't be reconstructed properly > doesn't grab me.
all's i am saying is that if you sample: x(t) = A/cos(theta) * cos(2*pi*(Fs/2)*t + theta) for -pi/2 < theta < pi/2 at t = n/Fs, you get x[n] = A * (-1)^n no matter what theta is as long as -pi/2 < theta < pi/2 .
> Hey: if it's filtered out before sampling, it can't be > reconstructed at all.
that's the point. if you abhor ambiguity, then lose that component in the first place
> You know that the reconstruction might be too > small, but it can't be too large. What's the harm?
there was a thread a while back about what would happen if you tried to ideally reconstruct a non-zero Nyquist component, specifically what does +inf y(t) = sum{ A * (-1)^n * sinc(Fs*t - n) } n=-inf where sinc(u) = sin(pi*u)/(pi*u) add up to? i don't remember. did it add up to y(t) = A * cos(pi*Fs*t) ? or was it nasty?
> The real practical problem is elsewhere. How many sample periods would > it take to reconstruct a signal at .499*Fs?
to within what tolerance of error? to get it (or any other frequency < Fs/2) right on the money, you need an infinite number of samples. sinc(u) goes on for a long way in both directions. -- r b-j rbj@audioimagination.com "Imagination is more important than knowledge."