DEP function development on a low budget

B

Bruce Varley

Guest
Is it at all practical for home-builders on a very limited budget to develop
DSP type functions, such as filters and the like, on FPGAs? Reading around,
I get the impression that experimenters that do it have access to high
powered tools, through their work or some other way. Tools such as Matlab
allow you to enter filter parameters, and out comes the VHDL, but Matlab
with all the associated toolboxes is a tad pricey for the home brewer.

Handcoding a FIR filter looks like an impossibly hard task, or is that just
me?
 
Make that 'DSP'
"Bruce Varley" <bv@NoSpam.com> wrote in message news:...
Is it at all practical for home-builders on a very limited budget to
develop DSP type functions, such as filters and the like, on FPGAs?
Reading around, I get the impression that experimenters that do it have
access to high powered tools, through their work or some other way. Tools
such as Matlab allow you to enter filter parameters, and out comes the
VHDL, but Matlab with all the associated toolboxes is a tad pricey for the
home brewer.

Handcoding a FIR filter looks like an impossibly hard task, or is that
just me?
 
On Fri, 26 Apr 2013 17:35:33 +0800, Bruce Varley wrote:

Is it at all practical for home-builders on a very limited budget to
develop DSP type functions, such as filters and the like, on FPGAs?
Reading around, I get the impression that experimenters that do it have
access to high powered tools, through their work or some other way.
Tools such as Matlab allow you to enter filter parameters, and out comes
the VHDL, but Matlab with all the associated toolboxes is a tad pricey
for the home brewer.

Handcoding a FIR filter looks like an impossibly hard task, or is that
just me?
An FIR filter has a very simple and regular structure, and hand coding a
basic one is a very easy project. As a first step, create one with no
more taps than your target FPGA has multipliers. (Hint : use the
"Transpose Form")

Later you can learn tricks such as KCM (constant coefficient multipliers)
and other ways to economise on hardware (many taps will have very small
coefficients so their multiplications can reduce to a few additions).

Creating the filter coefficients is a bit more involved but you can use a
little mathematical knowledge instead of the expensive tools. For
example, the "window method" is as follows:

1) Decide the frequency response you want.

2) Convert that to an impulse response via Discrete Fourier Transform (DFT
or Fast FT:FFT) or from knowledge of common results (perfect LPF =
rectangle in frequency domain = sin(t)/t in time domain)

3) Shorten that impulse response to something finite, and with no. of
time steps <= no. of available filter taps.
This degrades the freq response in different ways according to the method
used; hence there are different methods.
Simplest is the Window Method with variants that shallow the filter slope
or degrade the stopband attenuation : Hamming window, Hanning, or
Blackman windows are common with about 40dB, 45 dB or 75dB stopband
attenuation respectively.

For a better but more compute intensive approach, the Remez Exchange
Algorithm is available. Thirty years ago you had to type ten pages of
Fortran from a listing in a book, and it took 5 hours on a Z80, but I bet
you can quickly find it in a more convenient form now.

4) Scale the coefficients into fixed point (ie scaled integer) form and
enter them in a VHDL constant array.

5) Plug said array of coefficients into the filter you coded earlier.

The above is not QUITE enough info to DIY but I think it gives you enough
outline and search terms to get you going. Step 2 or 3 are where Matlab
(or the open source Octave or your own Python or Ada* program) can help
most.

* Ada has fixed-point built in, as easy to use as floating point. Sweet...

Other DSP algorithms are also amenable to hand coding treatment so don't
be put off trying them. IMO you'll ultimately do a better job through
knowing the internals better than you could if you just "plug and play"
with Matlab.

- Brian
 
Bruce Varley wrote:
Is it at all practical for home-builders on a very limited budget to develop
DSP type functions, such as filters and the like, on FPGAs? Reading around,
I get the impression that experimenters that do it have access to high
powered tools, through their work or some other way. Tools such as Matlab
allow you to enter filter parameters, and out comes the VHDL, but Matlab
with all the associated toolboxes is a tad pricey for the home brewer.

Handcoding a FIR filter looks like an impossibly hard task, or is that just
me?
If your objective is to learn about DSP and FPGAs, then
it is *better* to hand-code everything. The alternative
is to merely fill in a few parameters and press a few
buttons - after which all you know is how to fill in
parameters and press a button.

Analogy: those people that have written a few assembler
programs and looked at the output of a compiler have a
much more useful understanding of what a computer is
doing.

Once you know the basics, you are in a much better
position to use the automated tools to best advantage.
 
Bruce Varley <bv@nospam.com> wrote:
Is it at all practical for home-builders on a very limited budget to develop
DSP type functions, such as filters and the like, on FPGAs? Reading around,
I get the impression that experimenters that do it have access to high
powered tools, through their work or some other way. Tools such as Matlab
allow you to enter filter parameters, and out comes the VHDL, but Matlab
with all the associated toolboxes is a tad pricey for the home brewer.

Handcoding a FIR filter looks like an impossibly hard task,
or is that just me?
In most cases, writing the VHDL to process the filter isn't the hard
part, but getting the data in and out of the FPGA appropriately is.

Usually it is done in an FPGA for speed reasons, and the interfacing
to get data in and out at high speed takes work.

Otherwise, for actual processing, look at the systolic array
architecture.

-- glen
 
On Fri, 26 Apr 2013 17:35:33 +0800
"Bruce Varley" <bv@NoSpam.com> wrote:

Is it at all practical for home-builders on a very limited budget to develop
DSP type functions, such as filters and the like, on FPGAs? Reading around,
I get the impression that experimenters that do it have access to high
powered tools, through their work or some other way. Tools such as Matlab
allow you to enter filter parameters, and out comes the VHDL, but Matlab
with all the associated toolboxes is a tad pricey for the home brewer.

Handcoding a FIR filter looks like an impossibly hard task, or is that just
me?
For actual filter design, the tools are a godsend. No one sits around
doing Remez exchanges and DFTs by hand. GNU Octave does most of what
Matlab (basic) does, and is free.

Now you've got your filter coefficients, expressed in pure
mathematical form. Start writing code; the machine generated stuff is
crap anyhow and I know practically no one who uses it.

--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.
 

Welcome to EDABoard.com

Sponsor

Back
Top