Re: [Flexradio] Filters redux.

2007-02-19 Thread Jim Lux
At 02:08 PM 2/18/2007, Mark Amos wrote:
>Jim,
>
>OK, I don't quite understand what you're getting at. I made some 
>measurements - the amplitude of a signal passing through a filter at 
>various bandwidths. I divided the -60dB down bandwidth and by the 
>-6dB down bandwidth. I refered to this dimensionless quantity as 
>"shape factor."

Exactly..


>I do (barely) understand that it is possible to create all kinds of 
>filters digitally that have interesting characteristics, some of 
>which are impossible with analog circuits.
>
>What I was asking about was measurement of the specific 
>instantiation of the narrow digital filters in the Flex-Radio. (Not 
>what "could be done" but, rather, what "was" done in this specific case.)




>I have heard the expression "brick wall" filter tossed around and I 
>thought almost any measurable quantity that describes it would be 
>more meaningful than "brick wall". To me a "brick wall filter", 
>regardless of the technology to create it or the method of its 
>measurement, would ideally have a characteristic where the signal 
>-60dB down would be the same as the signal -6dB down.

That's as good a definition as any.. Although in a practical system, 
one might want to be a bit picky about the phase response near the 
transition (on the passband side.. who cares what the phase is when 
it's 60 dB down).

The problem will lie when trying to measure something that is 
inherently discrete and not continuous.  Say your filter "bins" are 
20 Hz wide, and at bin #50 (1kHz), you measure zero attenuation, bin 
#6 (1020 Hz), you measure 1dB attenuation, and at bin #7 (1040 Hz) 
you measure 100 dB attenuation.  If you were to measure at, say, 1030 
Hz you'd measure something in between 1 and 100, but it's tough to 
say  exactly where the -6 dB point would be and the -60 dB point might be.

You could use a very, very narrow filter (say, 1 Hz) and sweep it 
very, very slowly and measure the response, averaged over many 
seconds. (or, sweep a narrow band source with a broad band detector, 
which is a bit easier) However, gettting good accuracy at the -60 dB 
point from the same detector as the -6 dB point is tougher.  In the 
SDR1000 case, one could conceivably turn off spur reduction, use a 
constant frequency excitation (like the 10 MHz oscillator) and sweep 
the receiver tuning frequency (i.e. shift the DDS frequency) leaving 
the "IF" processing fixed.

>So, perhaps a more specific question is in order: "Why DOESN'T the 
>measured shape of a 20Hz filter have very steep walls, or a 
>shape-factor of 1, or whatever one should call this characteristic?"

Depends on the precise implementation.  If the implementation is a 
straightforward set the gain of bins M thru N to 1 and all other bins 
to zero, then the bandpass transition will depend on the windowing 
function used, but in general, will have a sin x/x sort of shape. 
(which doesn't roll off all that fast..as it happens).  In any case, 
the idealized shape factor would be something along the lines of 
(N+2)/N where N is the number of bins wide the filter is (the skirt 
isn't a nice straight line between samples, but that's probably an ok 
approximation)


>Or put another way,"What is a good metric for a "brick wall" filter 
>in digital parlance and what tools do I need to measure it?"

Usually, you specify stop band corner and attenuation.  Tools are 
fairly conventional (i.e. measure the attenuation/gain at a series of 
frequencies), but when measuring filters with rapid transitions 
(where the transition is < the bandwidth of the source) you have to 
be careful.  A nice quiet XO is pretty narrow, but taking my Wenzel 
Streamline OCXOs as an example (the HP 10811 will be similar), 
they're only 130 dB down at 10 Hz out, and it comes up pretty fast.. 
At 5 Hz out, it might be only 50-60 dB down or even as much as 20-30 
dB.  So what you're getting is the shape of the source slid across 
the shape of the filter.  You CAN back out the spectrum of the 
source, if you know what it is.

But don't forget that you also have to deal with the phase noise of 
the receiver, etc.

A lot of times what people do is figure out what the theoretical 
shape should be, and fit the measurements to that shape to confirm 
that it's working as planned.


>Or put yet another way, "Why wouldn't a shape factor 1 filter 
>(without ringing) be a good thing to have in a digital radio? Is it 
>computationally prohibitive, is it a waste of processor bandwidth; 
>nobody needs one, so why bother, etc.?)"

It would be a good thing, depending on what you want to do..  There 
is, of course, the CPU load aspect, but there's also deciding just 
what is important, and how to adjust it.  A square skirt in the 
frequency domain implies some ringing in the time domain, or a very 
long time delay through the filter.

part of it is that digital filters are often designed to replicate 
the behavior of familar analog filters,if only to make them 
adjustable in familar ways.

[Flexradio] Filters redux.

2007-02-18 Thread Mark Amos
Jim,

OK, I don't quite understand what you're getting at. I made some measurements - 
the amplitude of a signal passing through a filter at various bandwidths. I 
divided the -60dB down bandwidth and by the -6dB down bandwidth. I refered to 
this dimensionless quantity as "shape factor."

I do (barely) understand that it is possible to create all kinds of filters 
digitally that have interesting characteristics, some of which are impossible 
with analog circuits. 

What I was asking about was measurement of the specific instantiation of the 
narrow digital filters in the Flex-Radio. (Not what "could be done" but, 
rather, what "was" done in this specific case.)

I have heard the expression "brick wall" filter tossed around and I thought 
almost any measurable quantity that describes it would be more meaningful than 
"brick wall". To me a "brick wall filter", regardless of the technology to 
create it or the method of its measurement, would ideally have a characteristic 
where the signal -60dB down would be the same as the signal -6dB down. 

So, perhaps a more specific question is in order: "Why DOESN'T the measured 
shape of a 20Hz filter have very steep walls, or a shape-factor of 1, or 
whatever one should call this characteristic?" 

Or put another way,"What is a good metric for a "brick wall" filter in digital 
parlance and what tools do I need to measure it?"

Or put yet another way, "Why wouldn't a shape factor 1 filter (without ringing) 
be a good thing to have in a digital radio? Is it computationally prohibitive, 
is it a waste of processor bandwidth; nobody needs one, so why bother, etc.?)"

Am I missing some fundamental issue, or are you just correcting my (obiously 
poor) ability to communicate this question? You've clearly got considerable 
expertise in this area, and it is entirely possible that I am incapable of 
understanding the answer. So, I'm ok with a "come back later when you have 
brought me the witch's broom" kind of answer - I obviously have a lot to learn 
regarding DSP and I certainly haven't paid my DSP dues!

I think, however, that most people that buy radios have more experience in the 
analog world and we need to talk to them in terms they'll understand. And, of 
course, I am obviously one of them.

Thanks for your patience and continued contribution to these discussions!

Mark

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jim Lux
Sent: Sunday, February 18, 2007 1:44 PM
To: Tom Thompson; Bill Tracey
Cc: flexradio@flex-radio.biz
Subject: Re: [Flexradio] Filter measurements

At 08:18 AM 2/18/2007, Tom Thompson wrote:
>Mark and Bill,
>
>I made some measurements and got similar results as Mark.The one thing
>that confused me was the difference in shape factor between the narrow
>filters and the wide filters, but I think you just cleared that up for
>me, Bill.It has to be a function of the bin resolution and the bin
>bleed.Thanks, Mark for bringing this up, and thanks Bill for clearing
>my confusion...very interesting.


This is somewhat confusing because you are using a conceptual model 
(shape factor) that is really derived from analog filter design in a 
domain (digital filters with a lot of samples) that it isn't as well suited to.

In analog filters, we talk about how many sections or poles it might 
have, and knowing that number tells you what the ultimate rolloff is 
going to be (12 dB/octave per section, eh?). The close in rolloff in 
a high q filter (say a crystal lattice) is still determined by 
combining a relatively small number of tuned circuits (albeit high q 
ones).. Essentially, you stack up a bunch of stagger tuned sections 
so that you get a "bart's head" type frequency domain response. You 
have to worry about interacctions between the tuned circuits (some 
deliberate, as in a double tuned IF stage, some not), drifting in 
component parameters, and non-ideal components, so Q isn't infinite.


But in the digital domain, you can (easily) build a filter that is 
the equivalent of 4000 ideal lossless LC tuned networks with infinite 
Q. Yowza!..Sure, there are tradeoffs, and there are some 
peculiarities (roundoff, truncation, etc.) but it's easy to build 
filters that have "desirable" properties but which don't fit the 
usual analog filter metrics and design tradeoffs.For instance, it's 
pretty easy to build a "linear phase" filter in the digital world 
(one that has the same time delay for all frequencies in the 
passband, which has minimal pulse shape distortion).. something that 
is quite challenging with analog filters (as anyone who has agonized 
over group delay properties has dealt with).

In the digital world, one could build a dynamically adjusting CW 
keying envelope that is precisely limited in it's bandwidth to the 
current keying rate, without "ringing".Heck, in the digital world, 
one can have non-physically realizable filters (i.e. that have an 
output before the input is applied, in some senses)


So the