Electronics > Projects, Designs, and Technical Stuff

Calculating filter coefficient from a transfer function - literature not clear

<< < (3/4) > >>

RoGeorge:
Thanks for the book!
Just read a little the IIR/FIR chapter and loved it.  I like the stile it is written.   :-+

Yansi:
So, after playing a bit and learning to script in Octave, I have finally managed to make the attack/release aware envelope detection algorithm to work.

It is not that difficult, after all. Bud mind you, I am just a DSP (and Octave) beginner, so I am pretty satisfied with the result  ;D


--- Code: ---function pk = peakAtRt(in, AT, RT)
  persistent lastpk = 0;
  a = abs(in) - lastpk;
  if (a < 0) a = 0; endif;
  pk = AT*a + lastpk*(1-RT);
  lastpk = pk;
endfunction;

--- End code ---



Yansi:
...and do even some rudimentary compression  ;D

rhb:
For an appropriate range of values, calculate the filter element transfer functions organized such that the columns in the A matrix are the candidate source population transfer functions.  Choose the exact points in your parameter space of interest randomly. It is extremely important that the points in the parameter space of A show no correlations.

If you then solve Ax=y where y is the desired transfer function,  A is a basis pursuit dictionary  and x is a sparse  L1 solution using linear programming  you'll have the provably optimum terms. 

If you have parts with measured values such that you can select which parts are used together in assembly you can substantially improve system performance for the price of a few compute cycles.  With a 100% incoming test on reel packed parts the data are available and the only constraint is needing random pickup from the tape.

You seek the optimal combination and you are overwhelmingly likely to get an answer which is provably optimal.  But sometimes you don't get an answer.  Not often, but sometimes.

But if you can cast your problem as the product of a bunch of unknown transfer functions.  So you make up a large enough random sample of the transfer functions, poles and zeros.  Linear programming doesn't solve problems like that unless you take the logarithm in which case the transfer function is the sum of terms and a linear problem.

The arbitrary precision simplex solver in GLPK is spectacularly good at doing these.  And glpsol and GMPL are a very convenient interface.

The classical way of doing this is the Wiener filter which solves Ax=y using an L2 norm.   That actually works very well.  It has the disadvantage that L2 smears the answer and produce unstable filters. L1 won't do that if you restrict membership in the dictionary to stable poles and zeros.  But L2 requires much less compute effort.   So it's by no means obsolete.  Just not the only game in town as when L2 ruled because of CPU and memory cost.

Have Fun!
Reg

Yansi:
Eehhh.... you sure the reply wasn't meant to a different thread?  :-//

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod