LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to design a stable IIR-Filter for FPGA?

Hi, I´m new to Labview for FPGA and currently trying to design a lowpass-filter (for a digital mixer, more or less). It should work with a sample-frequency of 200kHz, a passband edge frequency of 3Hz and a stopband edge frequency of 8Hz. An FIR-filter would have a too large order to be implemented, an IIR one seems more practicable. For the design of the filter I'm using the digital filter design toolkit, refering to its manual and the casestudy with analyzing, modeling, simulating and generating a fixed-point filter. Now, I have problems to get a stable filter. While the manual states to adjust the coefficents by trial and error, the designed filter never matches the floating-point reference. Does anyone have experience in creating such filters? Or a hint, how to optimize the coefficient finding process?
 
Thanks in advance!
thilo
0 Kudos
Message 1 of 8
(6,026 Views)

Hello,

Can you define a mathematical expression for what you wish to achieve (objective function)?

How many parameters can you move around? As long as you have less than 20-30 of them you should be able to prove a global optimum with glcDirect in the TOMVIEW Base Module ( http://tomopt.com/tomview/products/base/ ).

Best wishes, Marcus

http://tomopt.com

Marcus M. Edvall
Tomlab Optimization Inc.
855 Beech St #121
San Diego, CA 92101-2886
USA

web: http://tomopt.com
e-mail: medREMvall@tomREMopt.coREMm
Office1: (619) 203-2037
Office2: (619) 595-0472
Fax: (619) 245-2476
0 Kudos
Message 2 of 8
(6,021 Views)

the objective function might be the difference between fixpoint filter and the floating-point reference filter which should be minimized. The number of parameters is about 8.

 

But I would guess / hope that there is an approach for designing the filter without an external optimization program... Also, we don't have tomview Smiley Sad

Any idea?      thilo

0 Kudos
Message 3 of 8
(6,017 Views)
Hello,
 
You can use it for free for 21 days or so. http://tomopt.com/tomview/register_tomview.php
 
The best might be to minimize a logarithmically adjusted set of points that you select. You can add weights as needed for areas that are more important to you to promote a better solution.
 
You need to supply either an objective or a set of residuals (y-meas) - then the system will take care of the rest. You also need firm bounds (x_L and x_U) for your decision variables. Should you run glcDirect first it might be worth connecting NLSSOL as well and fine-tune the solution locally.
 
Connect the system to clsAssign (constrained least squares assign) and sent it to the solver. nllsQG.vi shows how it's done.
 
You can also add custom parts to the overall objective function of course and force the decision variables (might be better to move specific ones) as needed.
 
Best wishes, Marcus
Marcus M. Edvall
Tomlab Optimization Inc.
855 Beech St #121
San Diego, CA 92101-2886
USA

web: http://tomopt.com
e-mail: medREMvall@tomREMopt.coREMm
Office1: (619) 203-2037
Office2: (619) 595-0472
Fax: (619) 245-2476
0 Kudos
Message 4 of 8
(6,011 Views)
thanks for your answer, Marcus. I will have a closer look at the program. Smiley Happy
 
Still, I think, there must be an easier way for the filter design. From the point of view of an optimization program, the problem is seems not to be really complicated. There are 7 integer parameters in the range -32 to +32 (? or so, I do not understand the physical meaning of the parameters) and 3 parameters with 2 possibilities. In the manual an approach to get a stable filter is given by observing the generated overflows. But this method - in my case - didn't work... And now I somehow fear, that there is no stable filter at all...
 
thilo
0 Kudos
Message 5 of 8
(6,009 Views)

LabVIEW FPGA 8.20 does include a Butterworth filter function (1st, 2nd and 4th order) in the FPGA palette. You can configure it directly using a dialog on your FPGA diagram. The cutoff may not be quite as sharp as you want but it could be an option for you to consider. Once you have configured the filter VI, you have the option of opening up the subVI with the code that is generated based on your filter parameters, which would allow you to further configure the code directly.

I have attached the configuration dialog with the settings you specified.

Message Edited by Christian L on 11-16-2006 09:27 AM

authored by
Christian L, CLA
Systems Engineering Manager - Automotive and Transportation
NI - Austin, TX


  
0 Kudos
Message 6 of 8
(6,004 Views)

Hello,

Integer nonlinear parameter estimation is one of the toughest problem types out there. The more general MINLP class is the hardest problems to solve. You cannot solve integer optimization problems with anything but TOMVIEW that I know of, unless you are happy with rounding the parameters from continuous values.

Best wishes, Marcus

http://tomopt.com

Marcus M. Edvall
Tomlab Optimization Inc.
855 Beech St #121
San Diego, CA 92101-2886
USA

web: http://tomopt.com
e-mail: medREMvall@tomREMopt.coREMm
Office1: (619) 203-2037
Office2: (619) 595-0472
Fax: (619) 245-2476
0 Kudos
Message 7 of 8
(5,999 Views)

Thank you, Christian!

That sounds really good. The problem is - of coarse - that I'm using Labview 8.0... But after a few telephone calls, I found the new version somewhere at our university Smiley Happy

I think, the Butterworth, 4th order should be good enough.

best wishes, thilo

 

0 Kudos
Message 8 of 8
(5,993 Views)