Reply by Jerry Avins January 17, 20042004-01-17
Rick Lyons wrote:

   ...

> Jerry, did I ever tell you that "sometimes you > tick me off." You see things, often so quickly, > that I just don't see. > > [-Rick-]
You know too much, Rick. Sometimes ignorance is a blessing. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Reply by Rick Lyons January 17, 20042004-01-17
On Fri, 16 Jan 2004 11:54:46 -0500, Jerry Avins <jya@ieee.org> wrote:

>Rick Lyons wrote: > >> On Fri, 16 Jan 2004 03:01:04 GMT, Randy Yates <yates@ieee.org> wrote: >> >> (snipped) >> >>>>Hi Fred, >>>> yep, the delay through a linear-phase nonrecursive >>>>FIR filter is the (# of taps -1)/2. >>> >>>What about this filter: >>> >>>h[0] = 0 >>>h[1] = 0 >>>. >>>. >>>. >>>h[30] = 0 >>>h[31] = 1 >>> >>>??? This filter has 32 taps and its delay is 32 taps. It is also >>>linear-phase and FIR/nonrecursive. >> >> >> Oh shoot. Another "Yates Trick Question"!! >> >> Neat. >> >> Isn't its delay 31 samples (instead of 32)? > >Quibble, quibble! (You're right of course.) > >> I'll have to think about how that filter could >> have linear phase. Sheece. > >What's to think about? The output is a delayed replica of the input. >Constant time delay <--> Linear phase > >Jerry
Jerry, did I ever tell you that "sometimes you tick me off." You see things, often so quickly, that I just don't see. [-Rick-]
Reply by Clay S. Turner January 17, 20042004-01-17
"Randy Yates" <yates@ieee.org> wrote in message
news:k73r2vxc.fsf@ieee.org...
>> Hi Clay, > > There you go again expanding my horizons. I don't ever remember hearing > the symmetry of a filter referred to as "parity." If you know and feel > like it, it would be interesting to hear how this term came about in > this context. > > Thanks for the P&M reference.
Hello Randy, The notion of parity that I referred to here is something I lifted from quantum mechanics. Basically a parity operator, P, when operating on a function negates its positional coordinates. When the parity operator is used on a space symmetric function you get no change, but when you operate on an antisymmetric function, you will get a negation. And in quantum mechanics, these two cases are referred to as even and odd parity. Certainly it is possible to have a function that is neither even nor odd, so we say the parity is indefinite in this case. In quantum, parity is important since it plays a part of the CPT (charge-parity-time) and CP (charge-parity) conservation laws. But it is not always obeyed - see the link below. So in the case of linear phase FIR filters, I just cited that they have definite parity. Thus if I have a set of taps h(n) and I compare them to h(N-n) (I.e., reverse their order) then I write the equation h(n) = p*h(N-n) where p is either 1 or -1 for a state of definite parity. A formulation for linear phase of FIR filters is given in: McClellan and Parks, "A Unified Approach to the Design of Optimum FIR Linear-Phase Digital Filters", IEEE Trans. on Circuit Theory, Vol. CT-20, No. 6, Nov. 1973. Basically they give an FIR's filter response as H(F)=G(F)exp(j( A+B*2pi*F)) where G(F) is a real valued function. Notice that the argument to the exponential function is linear (1st order in frequency). Then they show that when G(F) is even, then A==0 and when G(F) is odd, then A==pi/2. Since |G(F)|, the magnitude of the frequency response, is even, then G(F) must be either even or odd. Next they show that B must equal -(N-1)/2, for both values of A, which is what we all learn the delay of a linear phase FIR filter to be. IHTH, Clay Some links describing parity in a physics sense: http://hyperphysics.phy-astr.gsu.edu/hbase/quantum/parity.html http://www.accessscience.com/Encyclopedia/4/48/Est_489800_frameset.html
Reply by Randy Yates January 16, 20042004-01-16
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> writes:
> [...]
Fred, I'm sorry, but I'm afraid you're one of those people who for whatever reason are going to piss away multiple posts and hours of time arguing against perfectly obvious facts. I choose not to engage in this type of argument (I believe it dissipates time and energy with absolutely no return on investment), so go ahead and believe what you wish. I believe that there ought to be grace given and received in all human interactions, so forgive me if I'm wrong or have jumped to improper conclusions. Maybe there is more to discuss, but at this juncture that doesn't appear to be the case. -- % Randy Yates % "Bird, on the wing, %% Fuquay-Varina, NC % goes floating by %%% 919-577-9882 % but there's a teardrop in his eye..." %%%% <yates@ieee.org> % 'One Summer Dream', *Face The Music*, ELO
Reply by Randy Yates January 16, 20042004-01-16
"Clay S. Turner" <CSTurner@WSE.Biz> writes:

> "Randy Yates" <yates@ieee.org> wrote in message > news:wu7s9did.fsf@ieee.org... >> >> Can it be proven that a linear-phase FIR filter MUST be symmetric? > > Hello Randy, > > Parks & McClellan give a proof in one of their early papers that a linear > phase filter must have definite parity. I.e., it is either symmetric or > antisymmetric.
Hi Clay, There you go again expanding my horizons. I don't ever remember hearing the symmetry of a filter referred to as "parity." If you know and feel like it, it would be interesting to hear how this term came about in this context. Thanks for the P&M reference. -- % Randy Yates % "Bird, on the wing, %% Fuquay-Varina, NC % goes floating by %%% 919-577-9882 % but there's a teardrop in his eye..." %%%% <yates@ieee.org> % 'One Summer Dream', *Face The Music*, ELO
Reply by Fred Marshall January 16, 20042004-01-16
"Randy Yates" <yates@ieee.org> wrote in message
news:smif926w.fsf@ieee.org...
> "Fred Marshall" <fmarshallx@remove_the_x.acm.org> writes: > > [...]
Randy, OK. Here's how I understand things: First the formula for delay of (N-1)/2 is only good for filters that are: 1) symmetric (and possibly anti-symmetric) but not for arbitrary structures. 2) start at t=0. If the filter isn't symmetric then the delay is a function of frequency and the filter doesn't have *a* delay, it has a continuum of delays with frequency. Now, because you brought up the hardware design aspect and have been inserting delays all over the place, I wonder if you aren't thinking about delay measured in clock ticks or some such thing. Well, that certainly has its place. Here we were pretty much limited to the filter structure itself. Otherwise we'd be talking about OS impact, prospective look-ahead processing, verious latencies, intentional delays, etc. etc. in the limit of implementation discussions. All good stuff but out of scope. If the filter doesn't start at t=0 (which *is* generally understood) then where does it start? We would have to all the time be saying where (in time) the filter starts and that would be a pain when there's such a simple way that's accepted to deal with it. Just for fun: note that a symmetric filter that's centered at t=0 has zero delay. I find that very handy when using frequency domain multiplication (in place of time domain convolution) on canned data in order to time-register the output relative to the input. So, for symmetric filters at least this is another candidate for a "standard" registration.
>> ***It could be called an 11-tap filter with delay of 7 but that could be >> confusing because it isn't symmetric.
>Fred, how many filters have you implemented? Most people who have to >program an FIR in some real piece of hardware or software could give >a hoot about symmetry - all they care about is the number of coefficients >they have to store and the number of multiply-accumulates they're gonna >have to do.
>So, no, it isn't confusing - it's a very normal way of thinking about >FIRs.
Nope. That's because you can't express the delay of a non-symmetric filter except as a function of frequency. So, to talk about it as though there is but *a* single delay number is likely confusing because it's just plain incorrect. OK - group delay is a counter example but is often followed up with the adjective "flat". As far as implementation goes, there's a pretty good argument for linear phase - that there's no waveform distortion due to phase nonlinearities in, say, a passband - aka flat group delay. That's like a filter spec. It makes for easier, quicker, design - which is often also an important driver in development. Of course filters that aren't linear phase can be shorter and still meet a magnitude spec. But that's just a different filter spec: "we don't care about flat group delay and are resource limited or time constrained and if it takes a tiny bit longer to get the design that's fine". If that's the *only* way you approach filter design - if you don't give a hoot about symmetry *ever* then you must operate in a confined space. Or, am I missing the point completely and linear phase filters are just something nobody who's in the "know" ever uses? ;-) Fred
Reply by Brian Reinhold January 16, 20042004-01-16
I think that idea would work well on very quiet VHF but on HF there is so
much noise that there is ALWAYS a signal; you just have to see if the signal
follows the pattern it should and if it does, then you know it's what you
are looking for.  If it doesn't, well then you can resume scanning.

And that does bring up another problem which I have opened in another thread
as I thought this one got lost (it 'restarted' with v's submission).  Only
today did I "refind" it!

And that it on VHF the FSK baud rates are very short and barely contain one
period of the wave.  Now the integrate and dump method seems not to work. It
maybe due to noise, but I am not sure.  Such a signal may require other
techniques, but I don't know.

Brian

"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message
news:wNqdnX-JiJ7dypnd4p2dnA@centurytel.net...
> > "Brian Reinhold" <breinhold@comcast.net> wrote in message > news:U9ILb.8460$Rc4.33990@attbi_s54... > > Now I see the problem. I never thought my first message got posted. So
I
> > posted it again today. And I thought it didn't get posted either but I > > couldn't beleive it would happen again. But now I have found it. I
have
> > always had the messages ordered by time, but somehow they have gotten > > ordered by something else, and my posts were way down the list. It was
a
> > stupid mistake; also enhanced by coincidence that the messages appearing > at > > the top of the list were all from today. > > > > In any case, the FSK signal is part of Marine DSC and it uses 1615 Hz > > (1-bit) and 1785 Hz(0-bit) at 100 baud on HF and 1300 Hz and 2100 Hz at > 1200 > > baud on VHF as the two tones. I have an integrate and dump using
matched
> > filters to distinguish between the two tones. But strong low frequency > > signals can mess it up, so I want to clean up the signal before it goes > into > > the Integrate and dump. > > > > Now not only to I have to detect the signal but I have to decode it to
see
> > if it has the correct DSC signature. > > Brian, > > Well, I'm not the expert on FSK or scanning but here are some areas you
may
> want to consider: > > The frequency separation of the two tones is 170 Hz. To distinguish
between
> them requires a bandpass filter that cuts off pretty well after 170Hz > bandwidth - or a narrower filter than that! Such a filter has a time > constant around 6msec. I believe. This means that you can scan at around > 170Hz/6msec = 28.33kHz/second which seems a bit slow to me but I don't
know
> your system parameters well enough to judge. > [This is based on the idea that you have to "dwell" for one time constant
of
> the filter in order to see an output given there is a signal present - it > could practically be a bit slower than this.] > > Scanning would be faster with a wider filter. I would be tempted to do > something like this: > Scan with a bandwidth of 1kHz at a rate of 1MHz/second. Note that the
scan
> rate increases as the square of the filter bandwidth - so increasing the > bandwidth will improve the scan rate considerably. > When something is detected with such a wider band filter, stop long enough > to run the signal through a separate FSK code detector. If the code is > detected, stop scanning. If the code is not detected, resume scanning > without sounding the alarm. > > Fred > >
Reply by Brian Reinhold January 16, 20042004-01-16
Oh yes, I should have remembered that. Just sat in a DSP course a year ago
and that was one of the first things discussed.  Of course, when I was
thinking about the IIR filters not having so much of a delay what I really
meant was not so many taps (reducing the overhead).

Brian

"Clay S. Turner" <CSTurner@WSE.Biz> wrote in message
news:HqyNb.39602$v16.4196@bignews5.bellsouth.net...
> > "Brian Reinhold" <breinhold@comcast.net> wrote in message > news:ByaNb.49543$5V2.65582@attbi_s53... > > > > Is there a theorem which states that the time it takes to implement a > filter > > of width 'x' Hz is 1/x of a second? Some IIR filters seem a lot better > than > > that, though it does seem that FIR filters are at least proportional to > that > > value. > > Hello Brian, > While there isn't a theorem that says exactly what you ask above, there
are
> some theorems that let you see highly related properties. > > First a scaling theorem > > 1 > f(at) <==> --- F(w/a) > |a| > > where f() and F() are a Fourier pair. So here you can see a reciprocal > relationship. So if you squeeze a time domain response for a function into
a
> tighter time frame, then its frequency response expands out to occupy more > bandwidth. > > Another theorem sometimes called the "bandwidth" theorem is given by
(delta
> t)*(delta w) >= gamma > > where the delta signifies an effective span and gamma is a fixed constant. > > A common delta method is finding the standard deviation of the magnitude > square of the function. In this case gamma is simply 1/2. And this
approach
> is applicable to finite energy functions. Notice how the theorem is an > inequality in terms of gamma. This means some functions can have a
tightest
> support in both domains simultaneously while others are worse. > > Example, let your function be a gaussian pulse, i.e., f(t) = exp(-a*t^2), > > then its fourier transform is F(w) = sqrt(pi/a)exp(-(w^2)/(4a)) > > If you find the second moments about the mean of each of these (the
standard
> deviation) and find their product, > you will result in exactly 1/2. This is an example of a minimum
uncertainty
> function. > > The reason for using a moment for measuring the spread is you get a finite > value for a function that has infinite support. These gaussian functions
are
> nonzero everywhere (real arguments). > > So when one uses a rule of thumb to reciprocate the time domain width to > find the bandwidth, then you can see by the above theorem that this is
only
> an approximation since in general you don't know if your function is going > to be a minimum uncertainty function such as the gaussian above. > > But as both as these theorems state there is an inherent inverse > relationship between the "width" of the function and the "width" of the > fourier transform of the same function. > > So I hope this helps to answer your problem. > > > Clay > > >
Reply by Randy Yates January 16, 20042004-01-16
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> writes:
> [...] > "Randy Yates" <yates@ieee.org> wrote in message >> > That's a pathological case which can also be represented by adding >> > h[32]....h[64]=0 so that the delay is half the length. >> >> Agreed. OK then how about this: >> >> h[-3] = 3 >> h[-2] = 2 >> h[-1] = 1 >> h[+0] = 0 >> h[+1] = 1 >> h[+2] = 2 >> h[+3] = 3 >> >> This filter is linear-phase and non-recursive, but it's delay is 0, not > 3*Ts. > > ***Right - Except... there's an understanding that the filters under > discussion are always causal.
Oh yeah. Forgot about them thar "understandings." You know, the ones people usually misunderstand? I do think it relevent to state your assumptions when making such blanket statements.
> There are two ways to look at it: > If a filter isn't causal then it isn't of the real world where time is > concerned. > Or, if one is working on canned data then "time" isn't real, or is > arbitrary, and you can define a filter to have zero delay as above. Because > a vector is a vector..... etc. > Most of our discussions are based on linear systems theory where time is > real. There could be a huge discussion about this that probably wouldn't be > very productive.
I think offline processing is common enough. Live DSP certainly isn't the only venue to be discussed here.
>> Perhaps we could modify our statement to "A symmetric (and thus > linear-phase) >> FIR filter has a delay corresponding to the reflection point of the > impulse >> response"? One might be tempted to simply add "causal" to the original >> definition, but what about cases like: >> >> h[+0] = 0 >> h[+1] = 0 >> h[+2] = 0 >> h[+3] = 0 >> h[+4] = 3 >> h[+5] = 2 >> h[+6] = 1 >> h[+7] = 0 >> h[+8] = 1 >> h[+9] = 2 >> h[+A] = 3 >> >> ?? This filter would, by most people's standards, be called an 11-tap > filter, >> but it's delay is not 5 but rather 7. Right? (I think...) > > ***It could be called an 11-tap filter with delay of 7 but that could be > confusing because it isn't symmetric.
Fred, how many filters have you implemented? Most people who have to program an FIR in some real piece of hardware or software could give a hoot about symmetry - all they care about is the number of coefficients they have to store and the number of multiply-accumulates they're gonna have to do. So, no, it isn't confusing - it's a very normal way of thinking about FIRs.
> One could add 4 zeros after +A and it could be called a 15-tap symmetric > filter with delay of 7.
Yeah. And one could add 20 seros after that filter and 20 zeros before it can call it a 20 + 20 + 15 = 55-tap symmetric FIR.
> (Obviously the added zero coefficients are "no ops" so adding them does > nothing but get symmetry in the definition). > It could be called a 7-tap filter with delay of 3 preceded by a pure > delay of 4 yielding a total delay of 7. > I don't see how you can get a delay of 5 in any case.
(N-1)/2, as the original formula stated.
> To add to Rick's assertion about delay for linear phase (symmetric) > filters - (which we understand by convention to be causal and start at t=0):
No, we understand no such thing. That's kinda the point of my discussion. -- % Randy Yates % "...the answer lies within your soul %% Fuquay-Varina, NC % 'cause no one knows which side %%% 919-577-9882 % the coin will fall." %%%% <yates@ieee.org> % 'Big Wheels', *Out of the Blue*, ELO
Reply by Fred Marshall January 16, 20042004-01-16
"Randy Yates" <yates@ieee.org> wrote in message
news:4quwasks.fsf@ieee.org...
> "Fred Marshall" <fmarshallx@remove_the_x.acm.org> writes: > > > "Randy Yates" <yates@ieee.org> wrote in message > > news:oet4a90w.fsf@ieee.org... > >> r.lyons@REMOVE.ieee.org (Rick Lyons) writes: > >> > >> > On Thu, 15 Jan 2004 10:25:39 -0800, "Fred Marshall" > >> > <fmarshallx@remove_the_x.acm.org> wrote: > >> > > >> >> > >> >>"Rick Lyons" <r.lyons@REMOVE.ieee.org> wrote in message > >> >>news:40067255.50327296@news.west.earthlink.net... > >> >>> On Wed, 14 Jan 2004 12:25:05 GMT, "Brian Reinhold" > >> >>> <breinhold@comcast.net> wrote: > >> >>> > >> >>> >Fred, > >> >>> > > >> >>> >Is there a theorem which states that the time it takes to
implement a
> >> >>filter > >> >>> >of width 'x' Hz is 1/x of a second? Some IIR filters seem a lot > > better > >> >>than > >> >>> >that, though it does seem that FIR filters are at least
proportional
> > to > >> >>that > >> >>> >value. > >> >>> > >> >>> Hi Brian, > >> >>> > >> >>> such a great question, ... the answer of > >> >>> which I don't know off the top of my head. > >> >>> > >> >>> But what I think we should say is that the > >> >>> time delay through a linear-phase > >> >>> nonrecursive FIR filter is roughly proportional > >> >>> to the reciprocal of the filter transition > >> >>> region width, and not its passband width. > >> >> > >> >>Rick, > >> >> > >> >>The time delay through a linear phase FIR filter is 1/2 the length of > > the > >> >>filter isn't it? Well, it is for a lowpass I believe. > >> > > >> > Hi Fred, > >> > yep, the delay through a linear-phase nonrecursive > >> > FIR filter is the (# of taps -1)/2. > >> > >> What about this filter: > >> > >> h[0] = 0 > >> h[1] = 0 > >> . > >> . > >> . > >> h[30] = 0 > >> h[31] = 1 > >> > >> ??? This filter has 32 taps and its delay is 32 taps. It is also > >> linear-phase and FIR/nonrecursive. > > > > Randy, > > > > That's a pathological case which can also be represented by adding > > h[32]....h[64]=0 so that the delay is half the length. > > Agreed. OK then how about this: > > h[-3] = 3 > h[-2] = 2 > h[-1] = 1 > h[+0] = 0 > h[+1] = 1 > h[+2] = 2 > h[+3] = 3 > > This filter is linear-phase and non-recursive, but it's delay is 0, not
3*Ts. ***Right - Except... there's an understanding that the filters under discussion are always causal. There are two ways to look at it: If a filter isn't causal then it isn't of the real world where time is concerned. Or, if one is working on canned data then "time" isn't real, or is arbitrary, and you can define a filter to have zero delay as above. Because a vector is a vector..... etc. Most of our discussions are based on linear systems theory where time is real. There could be a huge discussion about this that probably wouldn't be very productive.
> > Perhaps we could modify our statement to "A symmetric (and thus
linear-phase)
> FIR filter has a delay corresponding to the reflection point of the
impulse
> response"? One might be tempted to simply add "causal" to the original > definition, but what about cases like: > > h[+0] = 0 > h[+1] = 0 > h[+2] = 0 > h[+3] = 0 > h[+4] = 3 > h[+5] = 2 > h[+6] = 1 > h[+7] = 0 > h[+8] = 1 > h[+9] = 2 > h[+A] = 3 > > ?? This filter would, by most people's standards, be called an 11-tap
filter,
> but it's delay is not 5 but rather 7. Right? (I think...)
***It could be called an 11-tap filter with delay of 7 but that could be confusing because it isn't symmetric. One could add 4 zeros after +A and it could be called a 15-tap symmetric filter with delay of 7. (Obviously the added zero coefficients are "no ops" so adding them does nothing but get symmetry in the definition). It could be called a 7-tap filter with delay of 3 preceded by a pure delay of 4 yielding a total delay of 7. I don't see how you can get a delay of 5 in any case. To add to Rick's assertion about delay for linear phase (symmetric) filters - (which we understand by convention to be causal and start at t=0): If the filter is of odd length, the delay is (N-1)/2. Example: N=3, Delay=(3-1)/2=1 If the filter is of even length, the delay is still (N-1)/2. Example: N=4, Delay=(4-1)/2=3/2 which is a time that lies between samples. Fred