AW: Analog DIY versus Digital DIY
Magnus Danielson
magnus at analogue.org
Fri May 8 03:22:25 CEST 1998
>>>>> "SC" == Sean Costello <costello at seanet.com> writes:
SC> I was one of the people that had been working with analog filters
SC> without really understanding anything about what was going on. Whenever
SC> Electronotes would start getting mathematical, my eyes would glaze over,
SC> and I'd skip to the construction of the circuit. Now, I'm going back
SC> and forcing myself to understand all of the equations, the s-plane
SC> graphs, and so on. Fortunately, I've found a few good sources for
SC> learning mathematics for digital signal processing, which I will list at
SC> the end of the email.
Well, I had to learn myself complex math in order to understand both
s-plane and z-plane behaviours. This was years before school tried to
teach me it... I forced myself. I haven't read any EN, but I do have
read a few good books (not to mention all the stuff that our local TRW
representative throwed at me).
SC> I don't see myself learning how to program DSP's anytime soon (I'd
SC> certainly like to know how, but I don't think it is terribly likely). My
SC> goal is to learn enough about general programming (in C and C++), and
SC> the general principles of digital signal processing, to be able to
SC> create my own unit generators for Csound. Apparently it is fairly easy
SC> to incorporate your own C code into Csound - assuming, of course, that
SC> you know how to program in the first place. :)
Well, programing C isn't the hardest thing in the world, doing it well
is another. I think that the 2nd K&R book is a good startingpoint for
a C novice. I learned basically all my C from it and I never got
around getting another book for the language itself (well, except for
the recent 1st version of the K&R book :).
SC> One of my first goals is to create a frequency shifter unit generator
SC> for Csound. You probably could do frequency shifting in Csound with a
SC> phase vocoder, but this seems like far too much computation for this
SC> process. My idea is to simply recreate the Bode/Electronotes frequency
SC> shifter in digital form. Instead of using FFT or convolution techniques
SC> of implementing a Hilbert transformer, I would like to try creating a
SC> direct digital replication of the "dome filter" used in the Electronotes
SC> frequency shifter (i.e. two six-stage allpass filter networks, with the
SC> 90 degree phase shift frequencies of each corresponding to the
SC> frequencies of the allpass stages in the Electronotes circuit). This
SC> may not be as accurate as other methods of implementing the Hilbert
SC> transformer, but it might work good enough for my purposes. Of course,
SC> I really have no idea how to design a digital allpass filter as
SC> described above, but I'm working on it. Any ideas, anyone? Any books
SC> that would cover this topic?
Allpass filters in the digital domain is really just as trivial as in
the analog domain, except for the pole/zero distorsion that you get
from moving from s-plane to z-plane.
There are several good books on general digital filter design and they
cover algorithms to optimize the responce properties.
A book that might be particularly into your field would be the oldtimer
"Digital Signal Processing" by Alan V. Oppenheim and Ronald W. Schafer
It contains a chapter on discrete Hilbert transforms and how to design
a Hilbert approximation such as the one in EN. It is also an excelent
book for many of the DSP issues.
Another book that have been with me for long and has proven itself to
be a great source of information is the companion book (they are
independent books that refer to each other, by diffrent authors) of
the above book. This is:
"Theory and Application of Digital Signal Processing" by Lawrence
R. Rabiner and Bernard Gold.
This book still solves problems for me by being well written and very
clear.
Both these are fitting into the reference literature department, you
see them referenced virtually everywhere.
Yeat another book to get (and this really counts for Analog and
Digital filters) is
"Filtering in the Time and Frequency Domains" by Blinchikoff and Zverev
It is a great book that better than any describes how many of the
s-plane filterapproximations really came about and is derived into
that and that size. It goes into stuff like Gauss-filters in more than
words. It makes throrough comparisions of the various approximations
and has a lot of graphs with impulse-responces, step responces,
frequency responces, overshoot dampings etc. It also covers digital
filter later in the back, but it is well written and stand well in
comparision on the topics it covers. For the analog stuff it is great.
These three books should keep you occupied for some time :)
For your frequency shifter project, I would suspect that you are
looking at an IIR implmentation. These are trivial on any language
(including C). There are however several issues to attend to which has
nothing to do with the filter dimensioning itself, but rather things
like roundoff-noise, headroom dimensioning, computation efficientcy etc.
If you would like to get high numbercrunching numbers (and you would
like that) then you need to look into some of the computer
architectual aspects, such as how the code aligns with your CPU, cache
and memory efficiencies etc. None of these are undoable.
If you would like to go with the FIR implementation of an approximate
Hiltbert transfrom, then you could use the program in the Rabiner-Gold
book which has all the tools in it. The program performs the Remez
exchange algorithm and output filterconstants.
SC> BTW, Magnus, thanks for the Octave tip. I'm going to search for it as
SC> soon as this is sent out.
It's a GNU software and you can download the source from them. There
is a webpage at http://bevo.che.wisc.edu/octave where you also can
find binaries for many popular OSes.
Octave is a very nice vehicle for dimensioning filters, make some
initial testing and analysis. It also has some support for accessing
sound and images. There is even play and record primitives to use!
I have been using Octave for dimensioning and simulation of digital
PLLs recently. This is quite close in the ballpark. The PLL will later
be implemented onto an ASIC using VHDL descriptions as part of a much
larger design (but with the possibility to break it all ;).
SC> Sean Costello
Cheers,
Magnus
More information about the Synth-diy
mailing list