Re: Question about re-designing an algorithm when hardware architecture is fixed



Jerry Avins wrote:

Robert, This is a rare occasion for me; I think you're confused.

i'm always confused. like Rick says, we live in an upside-down world.
not quite sure we would agree on what makes a rightside-up world.

You've pointed out that different algorithms can be used to calculate the
same result, and that the most appropriate one depends on the circumstances
of its use. That's all correct, but it doesn't address John's question.

John supposed a *particular* algorithm (developed in Matlab, but that
doesn't matter), custom hardware specially optimized to execute *that*
algorithm (not another that might compute the same result), and some
process of translating the algorithm from Matlab to the language of that
hardware. He asked about the translation process. I can only answer him
by observing that the translation process is essentially done as part of
the hardware design. Because that seems so trivial, I hope that there's
more to his question than I can read into it.

it's just that the answer to John's question would not mean a
straight-forward (i wouldn't call it "simple") translation of each line
of MATLAB to the corresponding code that does the same thing,
essentially the same way. sometimes the internal working of a signal
processing block needs to be rewritten (optimized) to a different
method that would be appropriate for the target device.

If I were in charge of the project, I would have the hardware designed
to best compute a particular result, letting the choice of algorithm be
part of the design process. (Unless a stupid boss has a pet algorithm.)

sometimes, due to other constraints (product cost or just other stuff)
you need to work with the hardware you're given. probably the very
first digital signal processing device i ever created was in 1979 and
it used this old Motorola MC6800 "D2" kit. it was supposed to predict
the equilibrium pressure in a biomedical osmosis system (modeled as a
simple first-order system). the formula was (if i recall):

2*SUM{ P[n]^2 } - SUM{ P[n] }*(P[n]-P[0])
Peq = ------------------------------------------
2*SUM{ P[n] } - (P[n]-P[0])

now the 6800 was an 8-bit uP that couldn't even natively *multiply*,
let alone divide. but this kit had a nice 7-segment display (which i
could use), a hex keyboard (which we could use), and some other nice
(for the era) user interfaces. so that's what we implemented this on.
now evaluating such a complicated formula on such a neanderthal
processor *did* require me to chain bytes together for longer words,
write my own signed multiplication, and a 40-bit/24-bit division
routine. lot's of "add-with-carry" instructions. i even had to use
the expensive 12-bit D/A as a successive approximation A/D (with a S/H
to hold the output while seaching for the input). all of this was a
bitch and, if MATLAB had existed (it didn't but i *did* test the
formula with a Fortran program), would hardly be a straight forward
translation of the MATLAB (or Fortran). i had to do it *much*
differently.

the only reason that this was even possible was that the time-constant
of the first order osmosis system was about 1 minute so waiting to read
Peq took about 5 minutes. it was a very slow signal (accuracy at DC
was important) and the sampling rate was about 10 Hz. even a 1 MHz
MC6800 can do a lot of computation in 1/10 second. at least programmed
in assembly. i think the OP might be looking at something like this
where they will have to implement some big algorithm that has many
little blocks (which are algorithms) inside. translating the MATLAB
code for those little blocks might not be the way to do this. the
overall algorithm get translated macroscopically, but the blocks get
completely redone, microscopically.

r b-j

.



Relevant Pages

  • Re: exactly what I was talking about...
    ... you need to work with the hardware you're given. ... A function in MATLAB that uses an array of say 4 or 5 mbit ... only *you* know what your MATLAB algorithm is about. ... write code for these blocks explicitly in the DSP. ...
    (comp.dsp)
  • Re: Question about re-designing an algorithm when hardware architecture is fixed
    ... A company has designed an algorithm in MATLAB. ... hardware architecture on which the algorithm is going to be implemented. ...
    (comp.dsp)
  • Re: Question about re-designing an algorithm when hardware architecture is fixed
    ... hardware architecture on which the algorithm is going to be implemented. ... Now...the guy who programmed the algorithm in MATLAB didn't know anything ...
    (comp.dsp)
  • Re: whats a STUPIDENT?
    ... I have seen only MATLAB and MathCad, ... I'd like to receice some advice about implementing an FM demodulator in a DSP proccessor. ... I'm a student of eletronics and I woul like implement a voice scrambler using the algorithm RSA on plataform DSP tms320c6711, I have watched that you done some algorithms to work in a DSP plataform, maybe you can help me with this,If dou you have any RSA algorithms for DSP, I'll be very gratefully. ... Do we have to start with a FD (frequency domain) weight vector that is all zeros. ...
    (comp.dsp)
  • Re: whats a STUPIDENT?
    ... I have seen only MATLAB and MathCad, ... mathematics forum discussing DSP on sine waves. ... using the algorithm RSA on plataform DSP tms320c6711, ... I am trying to implement the frequency domain LMS algo. ...
    (comp.dsp)

Loading