DSPRelated.com
Forums

Digital filter simulators?

Started by Joerg December 18, 2005
Hello Folks,

Is there a low/no cost simulator tool for non-ideal digital filters, 
maybe from a university?

What I want to do is briefly simulate the effects of reduced coefficient 
granularity in filters such as WDF. IOW, play around a bit. I know I 
could do this with Matlab but that is an expensive piece of software 
that I wouldn't really need for anything else. Writing code for the PC 
or writing a huge spreadsheet routine is another option but takes too 
long. I am looking for something equivalent to what SPICE is for the 
analog world. Ideally where you could use test tapes piped in through 
the sound card.

I have some filter design software that came with DSP books but they 
don't go that far. They assume 'ideal' coefficient granularity base on 
the available word width. Didn't find anything with Google but maybe I 
hadn't used optimal search phrases.

Regards, Joerg

http://www.analogconsultants.com
Joerg wrote:

> Hello Folks, > > Is there a low/no cost simulator tool for non-ideal digital filters, > maybe from a university? > > What I want to do is briefly simulate the effects of reduced coefficient > granularity in filters such as WDF. IOW, play around a bit. I know I > could do this with Matlab but that is an expensive piece of software > that I wouldn't really need for anything else. Writing code for the PC > or writing a huge spreadsheet routine is another option but takes too > long. I am looking for something equivalent to what SPICE is for the > analog world. Ideally where you could use test tapes piped in through > the sound card. > > I have some filter design software that came with DSP books but they > don't go that far. They assume 'ideal' coefficient granularity base on > the available word width. Didn't find anything with Google but maybe I > hadn't used optimal search phrases. > > Regards, Joerg > > http://www.analogconsultants.com
SciLab (http://www.scilab.com). The last time I recommended it the fellow responded with "boy, it's about as user friendly as a chainsaw". I had to disagree because chainsaws come with instruction manuals and finger guards. But it's as powerful as MatLab, it's very MatLab-like in the way it works (although the details are quite different), it's free, it's being maintained, and it has good newsgroup support (on comp.soft-sys.math.scilab). I find that for control systems work its better than Matlab because it comes with a native type for polynomial ratios that gives you transfer functions in s and z, and another one for representing state-space systems. For your stuff you can use the z-domain transfer functions and force granularity on the coefficients. If you need to investigate fixed-point arithmetic it has a discrete-time ODE solver that works well. You may also want to look into Octave, which is also free but apparently no longer well maintained. I keep it around because its nearly 100% MatLab compatible, but the version that comes with Cygwin doesn't really work right and the Cygwin-independent version doesn't play well with Cygwin. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com

Joerg wrote:

> Hello Folks, > > Is there a low/no cost simulator tool for non-ideal digital filters, > maybe from a university? > > What I want to do is briefly simulate the effects of reduced coefficient > granularity in filters such as WDF. IOW, play around a bit. I know I > could do this with Matlab but that is an expensive piece of software > that I wouldn't really need for anything else. Writing code for the PC > or writing a huge spreadsheet routine is another option but takes too > long. I am looking for something equivalent to what SPICE is for the > analog world. Ideally where you could use test tapes piped in through > the sound card. > > I have some filter design software that came with DSP books but they > don't go that far. They assume 'ideal' coefficient granularity base on > the available word width. Didn't find anything with Google but maybe I > hadn't used optimal search phrases. >
Joerg, The good book where you can find the treatment of the digital filter limited precision artifacts is: Dietrich Schlichtharle. Digital Filters: Basics and Design. Springer ISBN 3-540-66841-1 In most cases the analysis is not very complicated; there is really no point to do the simulation. Vladimir Vassilevsky DSP and Mixed Signal Design Consultant http://www.abvolt.com
There is also Ptolomey.  It's free but it may be more than you want.  I 
haven't used it.



In article <stydnUmu99f5dDjeRVn-gw@web-ster.com>, Tim Wescott 
<tim@seemywebsite.com> wrote:
>Joerg wrote: > >> Hello Folks, >> >> Is there a low/no cost simulator tool for non-ideal digital filters, >> maybe from a university? >> >> What I want to do is briefly simulate the effects of reduced coefficient >> granularity in filters such as WDF. IOW, play around a bit. I know I >> could do this with Matlab but that is an expensive piece of software >> that I wouldn't really need for anything else. Writing code for the PC >> or writing a huge spreadsheet routine is another option but takes too >> long. I am looking for something equivalent to what SPICE is for the >> analog world. Ideally where you could use test tapes piped in through >> the sound card. >> >> I have some filter design software that came with DSP books but they >> don't go that far. They assume 'ideal' coefficient granularity base on >> the available word width. Didn't find anything with Google but maybe I >> hadn't used optimal search phrases. >> >> Regards, Joerg >> >> http://www.analogconsultants.com > >SciLab (http://www.scilab.com). The last time I recommended it the >fellow responded with "boy, it's about as user friendly as a chainsaw". > I had to disagree because chainsaws come with instruction manuals and >finger guards. > >But it's as powerful as MatLab, it's very MatLab-like in the way it >works (although the details are quite different), it's free, it's being >maintained, and it has good newsgroup support (on >comp.soft-sys.math.scilab). I find that for control systems work its >better than Matlab because it comes with a native type for polynomial >ratios that gives you transfer functions in s and z, and another one for >representing state-space systems. > >For your stuff you can use the z-domain transfer functions and force >granularity on the coefficients. If you need to investigate fixed-point >arithmetic it has a discrete-time ODE solver that works well. > >You may also want to look into Octave, which is also free but apparently >no longer well maintained. I keep it around because its nearly 100% >MatLab compatible, but the version that comes with Cygwin doesn't really >work right and the Cygwin-independent version doesn't play well with Cygwin. >
Hello Tim,

> SciLab (http://www.scilab.com). The last time I recommended it the > fellow responded with "boy, it's about as user friendly as a chainsaw". > I had to disagree because chainsaws come with instruction manuals and > finger guards. >
Thank you, I will try that out. If it's like a chainsaw I'll be comfy. The only somewhat tricky task with chainsaws is the correct sharpening of the chain when the fingers are almost frozen. Also, I don't trust those 'automatic' oilers anymore and always carry a pot of chain oil with me. Just in case others are also interested, it's: http://www.scilab.org Regards, Joerg http://www.analogconsultants.com
Hello Vladimir,

> The good book where you can find the treatment of the digital filter > limited precision artifacts is: > > Dietrich Schlichtharle. Digital Filters: Basics and Design. > Springer ISBN 3-540-66841-1 >
Thanks. I'll play around with Scilab and when that doesn't get me going I'll order the book. Luckily it is still available on Amazon, about $90. I was kind of surprised that IEEE doesn't carry it.
> In most cases the analysis is not very complicated; there is really no > point to do the simulation. >
I'll have to try it out somehow by piping in real test data and see what the noise levels will be. IOW how much of unwanted response each filter produces. It is hard to forecast that when things in the signal path can go non-linear as in my case. Regards, Joerg http://www.analogconsultants.com
Joerg wrote:
> Hello Folks, > > Is there a low/no cost simulator tool for non-ideal digital filters, > maybe from a university? > > What I want to do is briefly simulate the effects of reduced coefficient > granularity in filters such as WDF. IOW, play around a bit. I know I > could do this with Matlab but that is an expensive piece of software > that I wouldn't really need for anything else. Writing code for the PC > or writing a huge spreadsheet routine is another option but takes too > long. I am looking for something equivalent to what SPICE is for the > analog world. Ideally where you could use test tapes piped in through > the sound card. > > I have some filter design software that came with DSP books but they > don't go that far. They assume 'ideal' coefficient granularity base on > the available word width. Didn't find anything with Google but maybe I > hadn't used optimal search phrases.
Octave. Scilab. Any program that plots filters with coefficients you give it -- modify ideal filters to suit your test. 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;
Hello Jerry,
> > Octave. Scilab. Any program that plots filters with coefficients you > give it -- modify ideal filters to suit your test. >
After Tim mentioned Scilab I played with it a bit. Looks like quite a learning curve so maybe I just fire up the solder iron, get a 16bit ADC plus a good uC and try all this out in the lab. Problem is, the lab is also where the Christmas cookie jar is and I can't stay away from it. Tim: Scilab is more complicated than a chainsaw, at least for a hardware guy... Regards, Joerg http://www.analogconsultants.com
Joerg wrote:
-snip-

> > Just in case others are also interested, it's: http://www.scilab.org > > Regards, Joerg > > http://www.analogconsultants.com
Oops. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Joerg wrote:

> Hello Vladimir, > >> The good book where you can find the treatment of the digital filter >> limited precision artifacts is: >> >> Dietrich Schlichtharle. Digital Filters: Basics and Design. >> Springer ISBN 3-540-66841-1 >> > > Thanks. I'll play around with Scilab and when that doesn't get me going > I'll order the book. Luckily it is still available on Amazon, about $90. > I was kind of surprised that IEEE doesn't carry it. > > >> In most cases the analysis is not very complicated; there is really no >> point to do the simulation. >> > > I'll have to try it out somehow by piping in real test data and see what > the noise levels will be. IOW how much of unwanted response each filter > produces. It is hard to forecast that when things in the signal path can > go non-linear as in my case. > > Regards, Joerg > > http://www.analogconsultants.com
If you think that Scilab has a future with you get a copy of "Engineering and Scientific Computing with Scilab with CDROM" by Claude Gomez. Neither it nor the Scilab on-line documentation give you the complete picture, and even with both there are still holes, but it'll give you a good step up. I found it particularly helpful with making decent graphs. If someone would fund me, and if I thought the Scilab team would pay attention, I'd love to dig in and write _good_ documentation for that package. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com