EEVblog Electronics Community Forum

Electronics => Projects, Designs, and Technical Stuff => Topic started by: Yansi on January 10, 2015, 11:11:09 pm

Title: Bessel low pass filter design for DDS
Post by: Yansi on January 10, 2015, 11:11:09 pm
Hi
I never designed such complex filtering stuff - new for me. I'm just toying with DDS signal generation. I tried to study some materials about what type of filter to choose - and I choosed Bessel, because of the phase linearity (I want to try also arb waveforms, not only pure sine).
I learned, that it is good to have the sampling frequency tripple the max output frequency. So the output filter's passband shoud be fs/3. But I can't decide, what steepnes (order) of the filter I shoud use. I found some recommendation that spurious component rejection ratio should be 70dBc for a good wavegen. I don't understand exactly what this requirement says (it is the ratio of fundamental harmonic to the level of the whole output signal?)
I also found, that 7th order bessel filter of fc = fs/4 shoud do it enough. Is it true?

So i tried to learn how to design sucha passive network filter. I've learned how to work with frequency normalized filter design tables, such as this one. I calculated some values for a filter, just a try, and they have all fit almost exactly what some software told me it shoud be. (I've used AADE filter design tool - old and rusty piece of software, which tried to install some rubbish into my computer).

I have 20Msps multiplying 12bit DAC with current ouput. For the purpose of testing and development only, I am going to use TS613 (common ADSL driver fast high output current OPAmp, 80MHz BW ) opamp both for the I/V and for the output. I am not sure if this is good idea, but I've got a lot of these salvaged from scrap, so I'll give it a try.  This design is only for testing and education only, separate final version will be made after.

There is also a second big unknown and that is what impedance should that filter be designed at? After the I/V stage I will have very low output impedance, so designing the filter at down to 50ohms should be possible, but I'd rather wouldn't do that, so is it ok to go higher, lets say 100 to 300 ohms, to lower the load on the opamp as much as possible, to reduce power consumption and maybe also reduce unnecessary distortion?

First step I think will be I make the filter circuit alone and have a measure of its response, to verify the design. After having some concrete values to work with.

How much critical are the component values? The only readily available for me is the E12 value line, both at capacitance and inductance. So how much accurate should the parts be? Am I right that with increasing filter order, I should keep the values accurate as much as possible? So I should for example 1.438nF make from two capacitors, like 1.2n + 220p (= 1.42nF). Or even more accurate?
Is it good enough to use 0805 surface mount inductors? Top end characteristics of this educational design are not required. Caps could be combined in parralel to easily get desired values, but the inductors are not as much accurate, I think about 10%? Is that enough? I think there not many ways making inductors more accurate then this.

Summary:
For sine and arb generating DDS, 7th order Bessel low pass at fc (-3dB) = fs / 4 should be enough. Or shouldn't? Input and output impedances in the range from 100 to 300 ohms.

And I observed some interesting fact (maybe not much interesting for more experienced designers) with an odd order lowpass filter, beginning and ending with a capacitor, having the same Zsrc and Zload - so having an "symetrical looking" filter, why are the values of components not symmetrical? I used some filter calculating tools and some of them actually made those LC networks symmetrical from both ends. But there was none note about what approximation the filter is. So the question is, does the filter component values symetry happens only with filter of Q=1? (which is not Bessel obviously) And then is the bessel passive filter network symetrical, if the component values are not? I think then it is also not.

Thank you for your kind help,

And I want to apologize for my behaviour in my last thread.

Y
Title: Re: Bessel low pass filter design for DDS
Post by: KJDS on January 11, 2015, 08:02:48 am
I did a post on here a few months back about making these quasi eliiptic to avoid having unnecessarily large orders.

The one thing to watch is inductor Q, which will hurt loss. It's likely you will see much better performance with hand wound coils. Tolerance isn't very critical on low pass compared to band pass. If you need to check, just change a few things in your model and see what the affect is.
Title: Re: Bessel low pass filter design for DDS
Post by: jahonen on January 11, 2015, 09:38:55 am
Do a monte carlo-simulation on the filter components, so you'll quickly get an idea how accurate filter components need to be. LTSpice has an example of that in directory examples/educational/MonteCarlo.asc.

Regards,
Janne
Title: Re: Bessel low pass filter design for DDS
Post by: tggzzz on January 11, 2015, 09:51:07 am
How much critical are the component values? The only readily available for me is the E12 value line, both at capacitance and inductance. So how much accurate should the parts be? Am I right that with increasing filter order, I should keep the values accurate as much as possible? So I should for example 1.438nF make from two capacitors, like 1.2n + 220p (= 1.42nF). Or even more accurate?

Good question, and one that is best answered by a sensitivity analysis, probably using Spice. In theory an AC analysis will give you all the information you need, but you may feel more comfortable with a transient analysis. Only your application can define how non-ideal the filter can be before it becomes intolerable.

Don't ignore the components' tolerance. There's not much point in having a 1.42nF +-10% capacitor! Components values will also vary with time and temperature. Use the standard filter topogies to minimise such sensitivity.

You may need to select-on-test some components, i.e. measure the value to find which one is nearest your desired value.

You will find that some components' values are more critical than others. Some types of component are easier than othes to tweak at design time (e.g. resistors) or in-circuit (e.g. inductors).

Thank you for a well considered interesting post. I look forward to seeing the responses.
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 10:56:06 am
 I've read somewhere not to use cauer/elliptic, they are fine for generatin pure sine, but pain in the ass for complex waveforms, because of their phase/time characteristics, which are likely to distort the output waveform.

7th order bessel is not so big deal from the component count kind of view, it's "only" three coils and four caps.  But you've pleased me a little with the components not being so critical.

Shame is I cant work with such simulator as spice, so I will find a way how to simulate the filter. Maybe I just write down the transfer function to Wolfram Mathematica and  draw it there. It is also possible to analyze there the step response of the filter, but it is rather.. pain in the ass. It is maybe a year when I did it last time for some passive RLC networks.. But sure I should ispect also the step response, because square wave generation (or something with sharp edges like sawtooth) is also probable to be generated from my ToyDDS.

So what impedance should the filter go? Signal source has almost zero impedance (OPamp output), load will be resistor only plus high impedance OPamp input. So thery is plenty of room to choose. Too low and I have to consider cooling of the opamps and fight with power consuption being wasted, or too high and parasitics will become dominant. But I have no idea, how is the impedance selection critical for such a "slow" thing as 5MHz maximum is.

An for the OPamp selection... is TS613i suitable, or is it still too slow to handle the maximum of 5MHz output? I would prefer using another OPamp than this, only one per package would be a lot nicer, than bodging the filter around dual opammp, which looks like a problem source, using two pieces TS613 looks fine, but I really don't like components being not fully utilized. Does anyone know signle OPamp like TS613, which will not cost a fortune? These 613s are well under $ I think.
And here is the datasheet for TS613: http://www.st.com/web/en/resource/technical/document/datasheet/CD00001981.pdf (http://www.st.com/web/en/resource/technical/document/datasheet/CD00001981.pdf)

Maybe I will just figure a bunch of components out, build the circuit and have it measured to see what crap have I built.

Things to be considered and done:
Filter impedance
suitability of TS613 or another single OPAmp
simulation of the filter with nonprecious components
(filter symmetry - but just an interest)
Title: Re: Bessel low pass filter design for DDS
Post by: German_EE on January 11, 2015, 11:12:12 am
For years I have used this site when designing filters:

http://www.wa4dsy.net/filter/filterdesign.html (http://www.wa4dsy.net/filter/filterdesign.html)
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 12:11:02 pm
Thats actually interesting! Because the website you've posted  calculated the values exact same as me, but in reverse order, like having input and output of the filter interchanged. So who's correct? Or is the filter symmetrical also when components arent? (That seem odd to be).

I calculated myself an example filter using the table I posted above: 5MHz cutoff, 5th order, 50ohm I/O.
I got these values with the table, from input to output: 1.44nF, 807nH, 512pF, 1.77uH, 111pF
Your website gave me this: 111pF, 807nH, 512pF, 1.77uH, 1.44nF.
.... well okay, it isn't exactly the reverse - only the caps were in reverse order. What the hell is going on?
Title: Re: Bessel low pass filter design for DDS
Post by: Howardlong on January 11, 2015, 12:14:34 pm
Remember to check the opamp's slew rate as well depending on what amplitude you want.

Also, don't skimp on the power supply, I'd stick with linear and low noise.

Layout around the opamp will be important, be generous with decoupling, generous ground plane, and be aware that these higher speed opamps love to oscillate and ring. Hopefully, with the input band limited, this shouldn't be a problem for you.
Title: Re: Bessel low pass filter design for DDS
Post by: Kalvin on January 11, 2015, 12:43:13 pm
If you want to keep your distortion as low as possible, use C0G/NP0 capacitors in the signal path. For decoupling you can use X7R or X5R.
Title: Re: Bessel low pass filter design for DDS
Post by: Kalvin on January 11, 2015, 12:51:32 pm
-snip-
Shame is I cant work with such simulator as spice, so I will find a way how to simulate the filter.
-snip-

LTSpice from Linear Technology is a free Spice-based simulator. It runs on Windows, Linux and Mac OS X environments, and it is very well user-supported.

Download link:
http://www.linear.com/designtools/software/#LTspice (http://www.linear.com/designtools/software/#LTspice)

Yahoo user-group for LTSpice:
https://groups.yahoo.com/neo/groups/LTspice/info (https://groups.yahoo.com/neo/groups/LTspice/info)

Unofficial wiki page:
http://ltwiki.org/?title=Main_Page (http://ltwiki.org/?title=Main_Page)
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 12:59:24 pm
Those under 1nF I think I've never seen any else then NP0 / C0G. Or have I?

..slew rate.. whooops... Houston, we gotta problem here. It is 6,28V/us per MHz per V (yw cos(wt)). So with 5MHz and a 1V amplitude we need 5 times that, 32V/us. Heck, the TS613 opamp can haz only 40. Fuck!  :phew:

So with a 1V amplitude sine, it should work, somehow. And I've alread considered much higher amplitudes. Thats bad ass. What OPamp will I use now?   That will be another fortune coster I suspect... >:(

Let the fight with component supply begin. (again and again... choosing  the DAC was also a bit frustrating...)
Title: Re: Bessel low pass filter design for DDS
Post by: nctnico on January 11, 2015, 01:03:46 pm
Look at the ADA4870 from analog devices. It's perfect as a final stage for a waveform generator >:D
Title: Re: Bessel low pass filter design for DDS
Post by: jpb on January 11, 2015, 01:05:23 pm
If you read the literature on DDS, eg the stuff on the Agilent 33522 or 33622 it generally suggests different filters for pure sin (elliptic with sharp cut off) to that for arbitrary waveforms where you want constant time delay at the cost of roll off rate.

See for example:

http://www.thinksrs.com/downloads/PDFs/ApplicationNotes/DDS.pdf (http://www.thinksrs.com/downloads/PDFs/ApplicationNotes/DDS.pdf)
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 01:24:53 pm
I assume, you haven't read my first post, or have you? Or how do you think I got to the idea of using phase linear bessel instead of cauer/elliptic?

//BTW, the document you posted looks almost exactly like one I have read, but is in color.

// that's it! http://www.noise.physx.u-szeged.hu/Online/DigitalSynthesis/DDS.PDF (http://www.noise.physx.u-szeged.hu/Online/DigitalSynthesis/DDS.PDF)

//$20 ADA4870 is not a thing I wish to use for a lowcost low spec DDS design. ;-)
Title: Re: Bessel low pass filter design for DDS
Post by: G0HZU on January 11, 2015, 01:44:30 pm
Have you considered using a high order cheby or elliptic lowpass filter followed by an all pass filter to try to give flat group delay over your passband?

I don't see the Bessel LPF as a viable solution because it provides a very poor rolloff rate. Your 7th order Bessel would not work very well at all in terms of rejection at 15MHz.
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 02:07:46 pm
That is a nice advice, I appreciate that, but I can't do that so I haven't considered at all.  :-//

7th order 3 * fc about 40dB (fast guess). That is not enough? Thats 100 times reduction in amplitude. Is that really not enough for a simple lowcost gen?

//I might screwed the calculation, but if 7th order is 42dB/octave, at 3fc it will give  42*log(3)/log(2) = 66dB reduction.. Hell, that is a lot!(an I've just plotted a graph in the AADE rubbish, it also says me about 66dB at that kind o frequency, of course using lossless ideal parts)
Screwed crap...  guess was close enough, might be around that, about 35dB
Title: Re: Bessel low pass filter design for DDS
Post by: KJDS on January 11, 2015, 02:14:52 pm
Here's one I prepared earlier


https://www.eevblog.com/forum/projects/what-type-of-antialiasing-filter-is-used-in-a-digital-scope/msg389166/#msg389166 (https://www.eevblog.com/forum/projects/what-type-of-antialiasing-filter-is-used-in-a-digital-scope/msg389166/#msg389166)
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 02:35:56 pm
Thanx for the design approach description. But I should first learn how to simulate that kind off stuff.

By the way, what would happen to the output signal, I'd use the 7th order Bessel? Can it be somehow expressed, how much bad harmonic crap would come out? I want only to build a reasonable quality fgen for home use, not a hightech machine. Problem is that I just can't see where's the border of what is not going to work, what is good enough to work (that's what I want) and what is suitable for a pretty spec.

So is it possible to design the filter, according to a requirement of getting lets say 1% THD sine at 1MHz output?
Well I think it is possible, but would require to calculate all the harmonics present on the output. So firstly get the transfer function of the filter and then use it for getting the right amplitudes of the harmonic content and then calculate the THD. with it, at least for the first 5 harmonics?

Is Butterworth suitable? Gives a lot faster rolloff. Often used for audio applications demanding high precision and low distortion, would it work here?
Title: Re: Bessel low pass filter design for DDS
Post by: KJDS on January 11, 2015, 02:40:37 pm
That design was simulated using RFSim99, which is readily available, but a bit awkward to install on a 64 bit machine.

A Butterworth will cause phase distortion, but how much will depend on what is acceptable.
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 03:19:56 pm
For this kind of educational purpose first test is acceptable almost anything, but I'd rather not to build a pile of  dog turd. So the question remains, what is a reasonambleamount of filtering? I will use this project as a base to learn how to make a complete diy DDS, using PLD, fast memory, DAC and all support circuitry such as amplitude/offset control, PSU and main processor. Based on this skill I will probably make it into final design, where I correct at least some mistakes made before.

I've just consulted google a little and found this: http://www.crbond.com/papers/bsf.pdf (http://www.crbond.com/papers/bsf.pdf)
I'd like to try to calculate the approximate THD on the output for such a presumption: Consider 1MHz sinewave being produced with  the DAC at  fs of 20MHz. After the DAC, bessel filter appears with fc about 5MHz and order of 5 (or 7).

How can I calculate this? I know how to calculate THD ratio with knowing what the harmonic contents are. How can I get the amplitudes for lets say first 10 harmonics (1,2,3,4,5,....10MHz) behind that filter, to estimate the THD like that?

That sounds like pretty school homework from an EE college, but EE colleges today really do not teach us anything like that, they only employ students with piles of unnecessary crap with the excuse of "preparing us for work". Sorry for the offtopic rant.. :-) (at least in our country, not sure if others are as bad as ours)
Title: Re: Bessel low pass filter design for DDS
Post by: Howardlong on January 11, 2015, 03:38:54 pm
Try:

LMH6642/3/4
LMH6611/2
OPA354/2354/4354

I am working on a design at the moment (a high speed 12 bit flash ADC filter and buffer) and all three of these have been used during the development. I needed rail-rail output (save a few pennies on the BOM on the PSU that way).

I am not sure how super low noise your opamp needs to be bearing in mind the quantisation noise you'll have from the DAC anyway, but I stand to be corrected.
Title: Re: Bessel low pass filter design for DDS
Post by: jpb on January 11, 2015, 03:48:40 pm
I assume, you haven't read my first post, or have you? Or how do you think I got to the idea of using phase linear bessel instead of cauer/elliptic?

//BTW, the document you posted looks almost exactly like one I have read, but is in color.

// that's it! http://www.noise.physx.u-szeged.hu/Online/DigitalSynthesis/DDS.PDF (http://www.noise.physx.u-szeged.hu/Online/DigitalSynthesis/DDS.PDF)

//$20 ADA4870 is not a thing I wish to use for a lowcost low spec DDS design. ;-)
Yes, I did read your post.

The point I was trying to make is that many (if not most) commercial DDS systems switch different filters in.  Often the sampling rate on modern systems is much higher
than three times the intrinsic bandwidth of other components such as the power amplifier stage. The Rigol DG4000 series extends the bandwidth by using different amplifications for different bandwidths and the new Agilent 33622 does a similar thing. On some systems filters are applied for sine waves and no filters used for square waves (though this tends to be on true ARGs).

As an example, the DS4000 uses a 500MS/s DAC so has an image reject filter of around 150MHz but the frequency limit on many waveforms is more like 60MHz.

Rather than designing a single filter it might make sense to have a sharp cut off fs/3 filter and then a separate filter to be switched in for some waveforms and not for others.
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 04:40:27 pm
Howardlong: Oh, these OPamp puppies looks great and affordable. About a buck each, no pissful wallet killers.  :) Bu? I'd rather appreciate bigger amplitude capabilities, than having 5V or 12V max R2R opamp. I assume well built fgen shoud deliver at least 10V peak-peak signal amplitude.

jpb: Now I understand ur point! I will consider this for the second/final version, to have two switchable filters. No I need only some estimation what to use for a prototype, where I could start toying with VHDL and so, to generate at least something looking like a waveform. So should I slap there the 7th order bessel? Is it a good starting point for this kind of job? I will gradually make my project better, after I learn the basics first.

500Msps to 150MHz is about 3.3 ratio...  I have only 20Msps DAC. At least something reasonable to begin with. I understand that generating a waveform with high harmonic xomplexity for example square at 5MHz will give me pile of turd instead of waveform on teh output - so I thought exactly - to limit arb waveforms to lets say 1MHz and leave only sinewave to about 5MHz, which is ratio of 4. (20MHz fs) Shouldn't be that fine?

So can I use the 7th order passive bessel as a starting point, to have at least something, which I can use to learn thing on? I remind that I haven't built anything like that, so there is also a lot of other stuff to learn. For example the HDL design. I haven't done much stuff in VHDL. It is great to have practice on some real design problem such as this DDS (or my other PCI crap experiment), than play with LEDs, buttons and switches on a minimalistic kit.

//I am considering now to implement both filterways right into the first prototype.. Not a big complication, only some PCB space will be eaten and two SPDT signal relays. //
Title: Re: Bessel low pass filter design for DDS
Post by: jpb on January 11, 2015, 05:04:05 pm
An interesting practical paper I found when I was searching this topic sometime ago is:

The Design and Construction of a DDS based
Waveform Generator
Darrell Harmon

I couldn't find the pdf directly when I looked just now but if you google it you should find the option to read it. You may have already looked at it as his design seems very similar to what you are working with.
Title: Re: Bessel low pass filter design for DDS
Post by: tggzzz on January 11, 2015, 05:29:19 pm
As a sanity check, you might like to be aware of the filter shown in Analog Device's AD9851, on p21 of the datasheet http://www.analog.com/static/imported-files/data_sheets/AD9851.pdf (http://www.analog.com/static/imported-files/data_sheets/AD9851.pdf)

It is 70MHz, 7th order elliptical, 200ohm, for a 180MHz clock frequency, and component values are shown.
Title: Re: Bessel low pass filter design for DDS
Post by: T3sl4co1l on January 11, 2015, 06:14:08 pm
Thats actually interesting! Because the website you've posted  calculated the values exact same as me, but in reverse order, like having input and output of the filter interchanged. So who's correct? Or is the filter symmetrical also when components arent? (That seem odd to be).

By reciprocity, it doesn't matter which end you call the "input" or "output".  Waves don't care, they just bounce back and forth through the structure.  There may be practical reasons, like presenting a certain dominant inductance or capacitance to the outside (or inside) world.

Once upon a time, I was involved in the design of, essentially, a DAQ (data acquisition) system.  We found that a 5th order Bessel did a fine job for Fs = 4*Fc.

Note that, for arbitrary waveforms, your 20MHz DAC with 5MHz cutoff can't describe anything with risetime below 70ns, fundamental above 5MHz, or effective symbol rate over 10MHz.  A waveform will look like trash until it's got more than a few points, limiting your arbitrary waves to perhaps <500kHz (N=40, but only 1/10th of Fc).

Statements like "effective symbol rate" seem disingenuous when your sample rate is obviously an explicit 20MHz -- but, that's exactly the point: a good flat filter exhibits a gradual cutoff, not the hard cutoff and aliasing due to sampling alone.  It won't drop off suddenly at 5.0MHz, it will do so gradually.  Whereas pushing to 10MHz requires ever sharper filters (and more ringing), and attempting more results in complete aliasing (you can't sample a 15MHz waveform at 20MHz and get 15MHz out -- actually, you can, but only because you get 5MHz, and 15, and 25, and etc. all at once, and you have no way to disambiguate which sidebands are the intended signal!).

The slope of a Bessel is very gradual, so the components can pretty loose.  I suggest picking standard 5% C0G caps and RF inductors (usually powdered iron or air cored for this range), testing the frequency and step response in SPICE, and adjusting values to get a reasonable response.

Tim
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 06:44:55 pm
tggzzz: At least we can get close enough by slapping some numbers into ready-to-use filter calculator. The values in schematics in the datasheet looks pretty same as what I got from the calculator. See attachement please.

Notice the 200ohm impedance... I think designing such filter at about 100-300ohm is pretty common, so no problems with that.

jpb: I'll try find it.

As I look at teh cauer/elliptical filter - it has only some shunt capacitancies accross the inductors. The filter can be easily routed on the board as universal layout one could use for both variants.

What I plan to do or use:  Two switchabe filters, bessel and elliptical. Both at about 200 ohm impedance, both 7th order, fc = 5MHz.  I will switch 'em with a signal relay, probably SPDT on both ends. (easy for proper layout). Sadly I've just found my SMD signal relays are 24V..  Maybe I'll just slap there Omron G5V1, it is SPDT I think, and have them both 5 and 12V I think. They should be pretty fine with this kind of frequency.

The unsolved are:
What OPamp and how to do the I/V stage
How to design output stage
Where to put the amplitude and offset controlling elements

I gotta some ideas to these three points, I will write something to them little later, now I must leave for a while...


T3sl4co1l: I plan 64K sample memory. And I understand the point of having arbs at a maximum frequency only a fraction of what I can get with sine. I will test and toy a little with that, to see where the limits are.
Iron powder RF cores are nice, no problems with that. But for those values around 1uH and below, it is becoming a little problematic I think. Is it possible to use SMD0805 inductors? I have ready to use set of those.
Title: Re: Bessel low pass filter design for DDS
Post by: G0HZU on January 11, 2015, 07:47:45 pm
That is a nice advice, I appreciate that, but I can't do that so I haven't considered at all.  :-//

7th order 3 * fc about 40dB (fast guess). That is not enough? Thats 100 times reduction in amplitude. Is that really not enough for a simple lowcost gen?

//I might screwed the calculation, but if 7th order is 42dB/octave, at 3fc it will give  42*log(3)/log(2) = 66dB reduction.. Hell, that is a lot!(an I've just plotted a graph in the AADE rubbish, it also says me about 66dB at that kind o frequency, of course using lossless ideal parts)
Screwed crap...  guess was close enough, might be around that, about 35dB

With a decent synthesis/simulation tool it's possible to design a compensated filter in a few seconds.

eg see below for a compensated elliptic filter.

This (simulated) filter has flat group delay from LF right up to 5MHz. i.e. the change in group delay is <1ns from LF to 5MHz. So it is as flat as a Bessel filter from LF to 5MHz but it offers much steeper rolloff.
The penalty is that it is a much more complicated filter to build.

Obviously, it won't produce very good square waves because it cuts off sharply at 5MHz. But I'm not sure what your priorities are. But this filter has the same group delay time for 1kHz as it does for 5MHz.
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 08:16:46 pm
G0HZU: That's nice filter, but I've really no idea how did you do that or how the schematic should look like. And those "much complicated" I am aware of...  So probably lets start with Bessel and Cauer.  These are the two which I might be able to design. Complicated stuff is just complicated. I never built any filter like so, so I'd rather start with more basic one.

...and probably learn how to use spice.

My priorities are... I tried to explain, but it wasn't caught. Just not to complicate complicated even more, so at first, I'd like to start with basics.

The unsolved three a little later, still some work to be done here..   :-\
Title: Re: Bessel low pass filter design for DDS
Post by: nfmax on January 11, 2015, 09:44:27 pm
Recently I had to design an anti-alias filter for a system with a bandwidth of around 15MHz, where the transient response was critical, no overshoot permitted, but the sampling frequency limited to about 100MHz. I found a 'maximally flat delay with Chebyshev stopband' design with n=7 worked very well, scaled to 50ohm impedance. This has the same circuit topology as an elliptic or Cauer design, but different component values. It has an almost purely Gaussian impulse response, so it should be just as good for the DDS application.
The trick is to forget entirely about frequency response in the passband, and instead concentrate on rise time and freedom from overshoot: let the 3dB frequency be what it may. This is rather like the rationale for a Gaussian frequency response on oscilloscopes, it does the best job of preserving the waveshape. So long as the stopband response is low enough to limit the amplitude of any aliases to somewhere around 1lsb of your DAC, the design is good. The design tables are in Williams 'Electronic filter design handbook', 3rd edition, section 11.
I didn't have a circuit simulator handy, so I used Matlab to set up and solve the nodal admittance matrix for the circuit. Easy to do a Monte Carlo analysis and to investigate the effect of inductor resistance. The design is quite tolerant of inductor Q, and 5% tolerance parts were fine.
A design like this will work for arbitrary signals, but with sine waves you can do better with a sharp cutoff elliptic design: since there is only one wanted frequency present you don't care about phase response, except for generating a sync output. For square waves the best way to go is to generate the sine wave and use a fast comparator - this can be your sync output for sine waves as well. Using two filters like this lets you generate sine and square waves up to a frequency closer to the Nyquist limit, without the drop off in amplitude which the 'arbitrary waveform' filter introduces at higher frequencies.
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 11, 2015, 10:39:25 pm
So if I got it right, the filter has to suppress the first image below 1LSB level. With 12bit DAC, it must be below -70dB. I think that is not easy with phase-linear filter design. How can such a beast as ?ebyšev have phase-linear response in the pass-band? I thought use of  ?ebyšev would likely make crap out of the arbiter waveforms. I didn't notice any use of this filter approx in this kind of application. Did I miss something?

Seems that the "basic DDS test design" should come up with a solution for easy testing of different filter configurations.

Sync out wasn't considered for this basic education-testing only design. And sure the comparator must be hooked directly on the output. (But arb waveforms with multiple zero X-ings complicate the simple use of comparator... But I have an idea how to deal it effectively)

So what others think of the ?ebyšev filter to be used as an output filter for arb waveforms?
Title: Re: Bessel low pass filter design for DDS
Post by: T3sl4co1l on January 12, 2015, 12:53:14 am
The name Chebyshev is used because the design involves the eponymous polynomial as an approximation method.

The ideal filter response is 1.0 gain in the passband, 0.0 (or a certain maximum amount) in the stop band, and going from one to the other over a specified transition range.

Since an ideal square (brick wall) filter requires infinite poles, is either noncausal (starts moving before a signal is applied) or exhibits infinite time delay (but doesn't start moving before the signal is applied), and has poor step response (it exhibits both a sin x/x impulse response and Gibbs phenomenon), it's not very practical.

So, we make the sacrifice that the transition band must be continuous and gradual, and we have many degrees of freedom to traverse than "1 to 0" band.

The tightest approximation, in absolute terms, is the Butterworth.  Which, in more abstract mathematical terms, is an orthogonal series of polynomials, of increasing order, with some characteristic property.  The polynomials arise in fitting a polynomial curve to this problem; the metric is minimum RMS error, thus, the frequency response is maximally flat.

Chebyshev approximations work within a peak error band, rather than a mean or RMS weighted error metric.  This is why Chebyshev filters are specified with pass/stop band ripple.  The limit as ripple --> 0 is a Butterworth filter.

If, instead of approximating frequency and amplitude response exclusively, you dig deeper and find the phase shift / group delay, you can run some numbers on those.  If you go for maximally linear phase, you get a Bessel filter.

All all-pole filters have ripple (or not) in the passband and an asymptotic drop in the stop band.  You can't add nulls in the stop band, because those are zeros...

Filters with zeros (L||C links or L+C branches) have ripple in the stop band.  The passband response can still be any of the traditional types, but by adding zeros, the same can be done for the stop band as well (in reciprocal, of course).

The Cauer / Elliptical filter does this, using all poles and all zeros (Nz = Np) to achieve the sharpest (most sudden) possible frequency cutoff, at complete cost to asymptotic attenuation (it's flat at -xx dB, not a slope of -xx dB/dec), (usually?) having a Chebyshev response in the passband.

Cheb. filters are generally used where sharpest frequency response is required: analog radio and audio applications, for example.  Sound card outputs are an excellent example, typically having horrible step response -- but a frequency response of just over 20kHz for a sample rate of 44.1kHz, or whatever.  (Or these days, since digital is so cheap, it's typically upsampled and sinc interpolated, thus pre-filtering it in digital to get by with an even cheaper analog filter.)  They are avoided where excellent time-domain response is necessary: scopes*, digital radio, etc.

*Except some of the, DPO3000 or something like that Tek scopes were "100MHz" with lots of overshoot, another sign of their corporate change..

Tim
Title: Re: Bessel low pass filter design for DDS
Post by: codeboy2k on January 12, 2015, 06:41:57 am
An interesting practical paper I found when I was searching this topic sometime ago is:

The Design and Construction of a DDS based
Waveform Generator
Darrell Harmon

I couldn't find the pdf directly when I looked just now but if you google it you should find the option to read it. You may have already looked at it as his design seems very similar to what you are working with.

It appears to be only available online at one view-only PDF hostage site (yumpu, similar to scribd, another PDF hostage site). No downloads even if you make an account there.

So I kept digging and here it is from the Internet Archive.

https://web.archive.org/web/20120417075707/http://dlharmon.com/~dlharmon/arb.pdf (https://web.archive.org/web/20120417075707/http://dlharmon.com/~dlharmon/arb.pdf)
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 12, 2015, 11:29:45 pm
Thanks for the pdf, looks like useful practical reading. Definitely will read that.

T3sl4co1l: Nicely done! I had to readit a few times, to understand it as a whole.  (but... "understand"... )
Title: Re: Bessel low pass filter design for DDS
Post by: Jay_Diddy_B on January 13, 2015, 03:58:28 am
Hi group,

Here is some LTspice analysis of the 7th order Butterworth filter used in Darrell Harmon's DDS Waveform generator.

In the first analysis I am sweeping the circuit with the calculated values and the values that were used by Darrell:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129453;image)

Results:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129455;image)


If I change the source to a 2 MHz square wave:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129457;image)


The results show a little ringing on the leading edges:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129459;image)

I have now modified the model to include Monte Carlo analysis. Is the analysis the simulation is run multiple times, I have set the number to 50 times. I have set the capacitor tolerance to 2% and the inductor tolerance to 5%.

Here is the model:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129461;image)

And the results show:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129463;image)

All the LTspice models are in the zipfile.

You can modify these models to other filter types. Enjoy !!

Regards,

Jay_Diddy_B

Title: Re: Bessel low pass filter design for DDS
Post by: Jay_Diddy_B on January 13, 2015, 01:10:29 pm
Hi group,

I have extended my model to illustrate the difference between a Butterworth and a Bessel Filter. Both filters are 50 Ohm input and output. Both filters were calculated from this link:

http://www.wa4dsy.net/filter/filterdesign.html (http://www.wa4dsy.net/filter/filterdesign.html)

Here is the model:
(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129536;image)

The results for the frequency domain:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129538;image)

And the transient response with a 2 MHz square wave:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129540;image)



I have attached the models in a zipfile.

Regards,

Jay_Diddy_B
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 13, 2015, 02:01:15 pm
Thanks for the sims... Could you please add also Chebyshev and cauer/elliptic version in the same picture, to have the comparison complete? That would be very neat. One image worth thousand words.  :-+
Title: Re: Bessel low pass filter design for DDS
Post by: Jay_Diddy_B on January 13, 2015, 02:54:52 pm
Hi,

A picture is worth a thousand words, here are a few thousand words.

I have built a LTspice model to simulate clocking sine wave data into a filter. The model has two inputs. The ref_sine is the waveform that you want to generate and the sample clock. The rising edge of the sample clock is used to sample the reference waveform. This generates a waveform with steps. The same waveform you would get if you fed values from a look-up table into a DAC.

The output of the sample and hold is then fed to a filter. This should reconstruct the reference waveform (ideally).

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129554;image)

Here is a sample waveform, the sample clock is 40 MHz and the reference sine is 4.5 MHz.

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129556;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129558;image)

The FFT shows the fundamental 4.5 MHz and Fs - 4.5MHz and Fs + 4.5 MHz

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129560;image)


I have attached the LTspice model in the zipfile.

You can replace the ref_sine voltage source with a PWL source if you want to try ARBs.

Regards,

Jay_Diddy_B
Title: Re: Bessel low pass filter design for DDS
Post by: Jay_Diddy_B on January 14, 2015, 12:22:10 pm
Hi,

Here is a little more modelling to compare 7 pole filters for a DDS application.
I could not find a calculator for the elliptical (Cauer) filter, but I did find a 18 MHz filter on an Analog devices application note. I have also added a Chebyshev filter to the model.

There is no need for a lot of words, this is a continuation of the previous posts.

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129720;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129722;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129724;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129726;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129728;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129730;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129732;image)

Regards,

Jay_Diddy_B
Title: Re: Bessel low pass filter design for DDS
Post by: Pjotr on January 14, 2015, 02:01:13 pm
Nice demonstration about filtering. You can not have a nice low distortion sine reconstruction and a nice square wave/pulse reconstruction without ringing with the same filter.

The ringing of the square wave has by itself not much with the filter to do, it is just what a band limited square wave is.
Title: Re: Bessel low pass filter design for DDS
Post by: nfmax on January 14, 2015, 05:00:29 pm
Sorry, I've been busy recently. Component values for a 'linear phase with Chebyshev stopband' design that is -3dB @17.4MHz with 19.8ns risetime, -66dB stopband from 68.8MHz upwards, and 0.1% overshoot, are:

R5 50R
C10 47p
L9 160n
C11 20p
C7 420p
L10 390n
C12 13p
C8 91p
L11 120n
C13 8p2
C9 12p
R6 50R

Component references are the same as Jay_Diddy_B's Elliptical design - just different values. I haven't got response plots handy, maybe Jay_Diddy_B could simulate it, please?  :) This is basically a Bessel passband with zeros in the stopband to improve rejection. Linear phase where we care, but not where we don't.

PS I don't claim this as an ideal design for your application, just 'one I prepared earlier'!
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 14, 2015, 05:11:08 pm
PS I don't claim this as an ideal design for your application, just 'one I prepared earlier'!

I didn't claim my DDS shoud or have to be ideal, because it simply won't be.  ;)

My app. will have 20MHz running DAC, so the filter should be  around 5 to 7 MHz. 
Title: Re: Bessel low pass filter design for DDS
Post by: Jay_Diddy_B on January 15, 2015, 12:22:55 pm
Sorry, I've been busy recently. Component values for a 'linear phase with Chebyshev stopband' design that is -3dB @17.4MHz with 19.8ns risetime, -66dB stopband from 68.8MHz upwards, and 0.1% overshoot, are:

R5 50R
C10 47p
L9 160n
C11 20p
C7 420p
L10 390n
C12 13p
C8 91p
L11 120n
C13 8p2
C9 12p
R6 50R

Component references are the same as Jay_Diddy_B's Elliptical design - just different values. I haven't got response plots handy, maybe Jay_Diddy_B could simulate it, please?  :) This is basically a Bessel passband with zeros in the stopband to improve rejection. Linear phase where we care, but not where we don't.

PS I don't claim this as an ideal design for your application, just 'one I prepared earlier'!


nfmax and the group,

Here is the simulation of the above filter

First the model:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129864;image)

Then the AC analysis, this shows the filter is not as steep as some of the other filters modelled:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129866;image)


The transient response is similar to the Bessel filter:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129868;image)

In the DDS circuit, the filter performs similar to the Bessel filter:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129870;image)


The FFT also shows:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=129872;image)


Regards,

Jay_Diddy_B



Title: Re: Bessel low pass filter design for DDS
Post by: nfmax on January 15, 2015, 12:29:31 pm
Jay_Diddy_B - cheers!
Title: Re: Bessel low pass filter design for DDS
Post by: Jay_Diddy_B on January 16, 2015, 03:32:42 am
PS I don't claim this as an ideal design for your application, just 'one I prepared earlier'!

I didn't claim my DDS shoud or have to be ideal, because it simply won't be.  ;)

My app. will have 20MHz running DAC, so the filter should be  around 5 to 7 MHz. 

I have adjusted the model to have a 20 Msps sample rate and 5MHz Bessel and Butterworth Filters. I have also changed the reference source so that it will sweep.

Here is the new model:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=130017;image)

This is the full sweep:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=130019;image)

These are samples of the waveforms at progressively higher frequencies:

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=130021;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=130023;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=130025;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=130027;image)

(https://www.eevblog.com/forum/projects/bessel-low-pass-filter-design-for-dds/?action=dlattach;attach=130029;image)


I have attached a zipfile with the LTspice model.

Regards,

Jay_Diddy_B

Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 16, 2015, 03:18:26 pm
Thank you Jay_Diddy_B, for your help simulating the filters for me. (Now I should learn how to use the spice...)

Now I'd like to make a small change of the topic. I'd like to leave the filter stuff, until I have working prototype of the DDS. I have at least some guess, what filters to use. But I have a little trouble design the I/V part and output buffer. Could you please help?

The original idea was to generate full swing signal in the I/V circuit on the DAC output, run it through the filter and then use only buffer with 0dB gain (including the 6dB loss in the filter, bcs of the same IN and OUT impedances). I planned to use there the TS613, but I quickly discovered, it is not enough.

So how should I design the analog path? What is the usual maximum output swing of generators? I  think it should be 10Vpp output (no load, so 5Vpp into 50ohm) and also include offset shift capability to the output. So the output stage would require at least +-15V supply voltage.

I have got multiplying DAC, AD5445. To control output amplitude, I will simply regulate the voltage at the DAC reference input.

To shift the offset level, I thought to do it in the output stage, by simply adding the offset control voltage together with the signal from the filter.

What are your reccomendations for designing the analog part please? The holy grail should be to keep it as low cost as posible, so I am not afraid of using more components (like for discrete buffer).

Lets start with the current2voltage part: What output amplitude should it produce? The output of the whole generator should be 10Vpp. It seems to be nonsense to make the I/V part generate full swing signal, because it would require very fast and expensive opamp.  The I/V output amplitude should be therefore a compromise of the opamp speed. Considering the 6dB voltage loss in the filter, I would prefer to have the output amplitude of about 2 to 4Vpp out of the I/V stage. Is it fine or did I miss any other drawbacks? With such an amplitude and the filter input impedance of about 200ohms, it does not require any highcurrent OPamp.

Output buffer: Here comes the trouble.  Very fast opamps capable of 30V supply voltage and 50ohm output are very expensive. I'd like to avoid using them. I'd like to build discrete or semi-discrete output buffer. The output stage must have some gain, not only pure buffer. Output voltage from filter woud be around volt to two, so the buffer should have gain at least of about 5 (14dB) to produce teh desired 10Vpp. I really don't know, if there is some simple discrete solution for this (obviously not), but using a standard OPamp with current gain stages seems like a more souitable way to do it. But the opamp must therefore be capable of working at 30V supply voltage and be fast enough to produce any usable quality of signal, at a gain of about 5 to 10. Are there some affordable "high" voltage and high speed opamps, or is there any other way how to make such a buffer with some voltage gain?

What do you think about my ideas for building the analog output circuitry?
Thank you,
Y
Title: Re: Bessel low pass filter design for DDS
Post by: Jay_Diddy_B on January 16, 2015, 04:37:31 pm
Yansi,

I would probably start a new thread, with a title like '5 MHz function generator output stage design'

Something like the LT1210 would be a suitable place to start for the output stage.

Regards,

Jay_Diddy_B
Title: Re: Bessel low pass filter design for DDS
Post by: Yansi on January 16, 2015, 04:59:05 pm
Ok, I'll do it. I just didn't want to spread my mess too much :-)

Thanx
Y