IIR Filters in FPGA

I am trying to modify IIR filters and use them in FPGA vi. Originally, the signal was filtered using the IIR filter vi (see below).
The coefficients were calculated using matlab, so this vi (and different combinations of it) was configured to do different signal processing. I would like to use the sample IIR filter in a FPGA vi and I have been trying to achieve this by using the Digital Filter Design Toolkit. However, the IIR filter design vi (and the classical filter design express vi) ask for different inputs than matlab. Is there any way to do this?
Thanks!

Hi rhong,
There is a couple of Express VIs for Butterworth and Notch filters in FPGA. I don’t believe we have a specific function that uses those same coefficients as inputs. However, we do have some guidelines on IIR filter design in FPGA. Otherwise, you could also consider opening the subVI and keep working based on it.

Similar Messages

  • IIR Filtering and response .vi: Butterwort​h filter magnitude response depends on sampling rate -why?

    Hi folks,
    I am not expert in filter design, only someone applying them, so please can someone help me with an explanation?
    I need to filter very low-frequent signals using a buttherwoth filter 2. or 3. order as bandpass 0.1 to 10 Hz .
    Very relevant amplitudes are BELOW 1 Hz, often below 0.5 Hz but there will be as well relevant amplitudes above 5 Hz to be observed.
    This is fixed and prescribed for the application.
    However, the sampling rate of the measurement system is not prescribed. It may be between say between 30 and 2000 Hz. This will depend on whether the same data set is used for analysing higher frequencies up to 1000 Hz of the same measurement or this is not done by the user and he chooses a lower sampling rate to reduce the file sizes, especially when measuring for longer periods of several weeks.
    To compare the 2nd and 3rd order's magnitude response of the filter I used the example IIR Filtering and response .vi:
    I was very astonished when I the found that the magnitude response is significantly influenced by the SAMPLING RATE I tell the signal generator in this example vi.
    Can you please tell me why - and especially why the 3rd order filter will be worse for the low frequency parts below 1 Hz of the signal. I was told by people experienced with filters that the 3rd oder will distort less the amplitudes which is not at all true for my relevant frequencies below 1 Hz.  
    In the attached png you see 4 screenshots for 2 or 3 order and sampling rate 300 or 1000 Hz to show you the varying magnitude responses without opening labview.
    THANK YOU for your ANSWERS!!!
    chris
    Solved!
    Go to Solution.
    Attachments:
    butterworth-filter-differences.png ‏285 KB

    Hello Lynn,
    thanks for the answer. You are right that there are few points "behind" the curve in the graph, see png.
    However, this is the filter response which Labview (2009) provides to me directly out of the "IIR Filter for 1 Channel. vi" in the "filter information" output cluster. Where up to now I do not know how to influence it - apart from adjusting the input parameters "IIR filter specifications". OK, I assume I have to gain more knowledge of this. The curve of the magnitude resonse dies not change when I change the number of samples of the input signal of the signal generator, only wehn I change the sampling rate.
    I used directly the example vi from Labview with the name indicated in my first post "IIR Filtering and Response.vi".
    So I assumed that everybody has it in his/her examples shipped with LV and it is not necessary to post it.
    I just adjusted the size of the diagram of magnitude response to see the curves better as you see in the attached vi.
    So I did no changes to the vital parts of signal generation and filter of the example. The screenshots are like they come from the example when using the option "one waveform" where I as user assume that this which is behind is quality-controlled by NI.
    I was also astonished that the filter magnitude response is different to the one I copied out of graphs 1 year ago - but I unfortunately cannot reconstruct which example I used there...
    Thanks for any further comments
    chris
    Attachments:
    IIR Filtering and Response_CH.vi ‏55 KB
    butterworth2nd_order_bandpass_0p1to10Hz_mag_response.PNG ‏18 KB

  • 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

    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
    Christian Loew, CLA
    Principal Systems Engineer, National Instruments
    Please tip your answer providers with kudos.
    Any attached Code is provided As Is. It has not been tested or validated as a product, for use in a deployed application or system,
    or for use in hazardous environments. You assume all risks for use of the Code and use of the Code is subject
    to the Sample Code License Terms which can be found at: http://ni.com/samplecodelicense
    Attachments:
    filterdialog.JPG ‏44 KB

  • Iir butterworth bandpass filter

    Hello everyone,
    I am trying to generate bandpass butterworth filter coefficients for one of my class projects.
    I am using "Butterworth CoefficientsVI" to generate the filter coefficients and using these coefficents I filter my input signal using "IIR filter VI".
    I can also do this filtering using "Butterworth Filter VI". But I get different results. "Butterworth CoefficientsVI" generates IIR 4th order filter structure even when i specify order lesser than 4.
    In my example attached, if i specify order above 3, the filter using "Butterworth CoefficientsVI" becomes unstable, whereas "Butterworth Filter VI" is still stable.
    In my application I need to get the filter coefficients, and I cant use the "Butterworth Filter VI". So can someone tell me how to get a stable filter coefficients?
    Message Edited by vani on 07-24-2008 01:37 PM
    Attachments:
    filt_question2.vi ‏35 KB

    Hi Vani,
    With the Butterworth Coefficients VI you will only get only 4th order cascaded sections for the bandpass filters. The Digital Filter Design Toolkit offers more flexibility in the fact that you can design your own Butterworth Filter there and it will also let you do 2nd order cascaded sections which you can use to get to higher orders. For more information on the Digital Design toolkit and cascade form IIR filtering:
    Cascade Form IIR Filtering
    Digital Filter Design Toolkit
    Hope this helps!
    Ipshita C.
    National Instruments
    Applications Engineer

  • IIR filter, not contiguous, signal processing

    Hello!
    I am acquiring data countinuously from several voltage output sensors. I am sending the waveforms through an express vi filter (bandpass) and I am using the default setting for IIR filtering. The program is setup such that data acquisition is done with a while loop. The DAQ wile loop is inside of a bigger while loop which is related to program start and stop.
    Every time I am doing data acqusition through the filter I get a warning that tell me the waveforms are not contiguous. Again, this is not flagged as an error but rather as a warning. The attached example might clarification.
    The question is: is the IIR filter uses previous waveform information to judge the current waveform? If this is true, then I do not like the solution; if this is not true, the I should probably just ignore the warning...
    Does the express vi has some type of reset that would activate when the whole program stops because I do not see the warning message first time I start the vi?
    Thanks
    Attachments:
    FIlterCase.zip ‏58 KB

    Thank you for your answer.
    From your answer I deducted that whenever I restart the data acquisition while the main program is still running I'd better make sure I reset the filter such that it will now "know" that it is new data coming in. I did not have a chance to check inside the express vi yet but from what you are saying it must be some sort of reset button in there that I could 'pull out' in the connector block of the subvi..
    The band widths I am using are anywhere between 100 Hz to 40000 Hz so the transient duration will be short to very short and the system, the way it is setup now, will allow enough time to the IIR filter to handle correctly new data.
    Finally there is always the option to acquire just the raw data. later I could read it back and filter it if necessary. However, there are situations when I want to filter out noise and possible alising frequencies; moreover, I acquire vibrations and forces in the same time on the same board - if I need the 40kHz sampling rate for vibrations, automatically I will have it too for the "low end" signals as well (0 to 10V from power and force sensors). I believe doing some filtering and maybe some decimation after filtering will help me keep the amount of data low on the 'low end' signals side. Am I correct in my assumptions?
    Thanks again.

  • Design of direct form IIR Filter

    while designing IIR filters(dirtect form coeff) using advanced IIR filtering VIs, i hv found that for a given filter spec,the coeff generated by LV and matlab are different in some cases specially higher order filters. The direct coeff. of a 6th order butterworth bandstop filter, fL=65 Hz and fH= 222Hz, when used in matlab showed a considerably different respose than LV, and the step response when evaluated in matlab turned out to be unstable. can someone explain the discrepancy. Thanks.

    It sounds like they are just using different algorithms. I would suggest e-mailing into the NI support, with the Matlab script and the LabVIEW VI you are using. They may be able to find out where or how the two algorithms differ.

  • Filtering sweep response

    Hi all!
    I wonder if there's any better solution to my problem:
    I have several sweep signals that excite a structure so I can identify its natural frequency. As the environment where the signal have been acquired its quite noisy I decided to filter both signals (excitation and response) with a dynamic filter which is moving with the sweep. The crosspectrum gave me better results but it still must be improved. Any idea? Maybe it would be better to use wavelets or any joint time frequency vi?
    Thanks in advance mates

    Hello Lynn,
    thanks for the answer. You are right that there are few points "behind" the curve in the graph, see png.
    However, this is the filter response which Labview (2009) provides to me directly out of the "IIR Filter for 1 Channel. vi" in the "filter information" output cluster. Where up to now I do not know how to influence it - apart from adjusting the input parameters "IIR filter specifications". OK, I assume I have to gain more knowledge of this. The curve of the magnitude resonse dies not change when I change the number of samples of the input signal of the signal generator, only wehn I change the sampling rate.
    I used directly the example vi from Labview with the name indicated in my first post "IIR Filtering and Response.vi".
    So I assumed that everybody has it in his/her examples shipped with LV and it is not necessary to post it.
    I just adjusted the size of the diagram of magnitude response to see the curves better as you see in the attached vi.
    So I did no changes to the vital parts of signal generation and filter of the example. The screenshots are like they come from the example when using the option "one waveform" where I as user assume that this which is behind is quality-controlled by NI.
    I was also astonished that the filter magnitude response is different to the one I copied out of graphs 1 year ago - but I unfortunately cannot reconstruct which example I used there...
    Thanks for any further comments
    chris
    Attachments:
    IIR Filtering and Response_CH.vi ‏55 KB
    butterworth2nd_order_bandpass_0p1to10Hz_mag_response.PNG ‏18 KB

  • Is there a complex coefficient IIR filter VI?

    IIR filter VI will take a complex signal in, but it doesn't look (or act) like it takes complex coefficients.
    Is there an IIR filter VI that does use complex coefficients?
    --Mark

    The FIR and IIR filter VIs only accept real-valued inputs. When you wire an array of complex numbers into either of these VIs, or any other VI that accepts only double-precision numeric inputs for that matter, the complex values are simply coerced to doubles by taking the real component.
    LabVIEW doesn't have any FIR or IIR filters capable of handling complex values directly.
    Jarrod S.
    National Instruments

  • How to build a filter with particular frequncy respond?

    Hi,
    Are there any methods to create a filter with particular frequncy respond? It's better if I can simply input the filter's xy data according to my filter sharp. Thanks.
    Bill

    Look in the examples for FILTER
    select FIR Filter example
    For IIR filters
    slect the IIR filter example.
    The main problem that I see with inputting xy's data is that it's tricky for a program to decide which trade-off to make for passband ripple or cut off for example.

  • Suggestions to improve the filter output of the acquired pulse signal

    Hello,
    I am working with acquiring the pulse signals form DAQ using a sample rate of 1k and number of samples as 1k for every 1sec signal using the DAQ.
    I am using the smoothing type filter with Moving average->Rectangular->Halfwidth=3 and passing the smoothed signal to the butterworth filter with my requirements of 2.3hz and 0.7 with sample rate of 1000.
    Problem:The filtered signal is always starting form 0 instead to start with the first value in the acquired pulse signal.For example, starting from 0 instead to start from around 0.057 as shown in the images. 
    How to make the filtered signal to start from the original pulse signal value.
    Thanks in Advance.
    Attachments:
    improvementinfilter.jpg ‏164 KB

    All filters have a transient response. A bandpass filter with a DC component at the input will have that transient strongly excited.
    Some of the filter VIs have an Init? input. If the signal is continuous but is being filtered in segments, that input can help by retaining the previous state of the filter. The first transient will still be there, but later ones should be erduced or eliminated.
    In the example VI attached you will find that there is a transient at the beginning of each segment. This is due to the sine signal not having an integer number of cycles.
    The IIR Cascade Filter with I.C.vi and IIR Filter with I.C.vi in the Signal Processing >> Filters >> Advanced IIR Filtering palette have an initial state input.That might be helpful but calculating an appropriate set of initial conditions from the signal data may not be straightforward.
    What do you want the output to look like? What are you doing with the filtered data? Perhaps there is a better approach than a filter.
    Lynn
    Attachments:
    Filter transient.vi ‏19 KB

  • Design a Filter using the Digital FIR Filter.vi

    Hello,
    I was working with Digital FIR Filter.vi to create a bandstand filter.
    The problem I faced is regarding the FIR Filter Specification, the Frequencies given for the Upper and Lower Pass and Stop band.
    For a low pass Filter, the upper Stop Band frequency is set at 0. While the Lower Stop band frequency is set at 200.
    And the Lower pass band is set at 100 while the upper pass band is set at 0.
    What the lower and upper frequencies actually means? As for a low pass filter, the upper cutoff frequency must be greater than lower. 
    So plus tell me how does it works and what frequencies should I specify for a Bandstand Filter.
    Thanks v.much

    Hi,
    Have a look at the following example: [LabVIEW Folder]\examples\Digital Filter Design\Floating-Point Filters\Conventional\Classical Filter Design.vi .This example demonstrates how to use the DFD Classical Design VI to design a lowpass, highpass, bandpass, or bandstop filter with classical design methods.
    Complete the following steps to use this VI.
    1) Run the VI.
    2) Change the specifications.
    3) Observe the magnitude response and phase response. Notice that the magnitude response approximates the frequency specification and the phase response is nonlinear for IIR filters (Butterworth, Chebyshev, Inverse Chebyshev, and Elliptic).
    4) Change the Design Method to view the ripples in the passband and stopband.
    5) Observe the filter order that the VI returns automatically.
    6) Click the STOP button to stop this VI.
    Sev K.
    Applications Engineering Specialist | CLA
    National Instruments

  • Is there an integratio​n block in Labview like Simulink?

    I am interested in modeling differential equations for a mechanical system in Labview. I have used Simulink in the past and there are blocks available for integration and differentiation. How can this be implemented using Labview? Thanks. Frank

    I guess that there is integration x(t) that can do the job.
    However it is not causal since the integrated signal is obtained as y n =
    f (x n-1, x n, x n+1 ) where x n is the singal to integrate.
    Therefore, it is not reentrant like all IIR filters in Labview. I got a
    Labview example making it practically reentrant for my app from
    Jean-Claude Drolet last year. Thanks again Jean-Claude. It cam handy in my
    vibration app.
    Differentiation is a trickier business in practice since this increases HF
    noise tremendously. I would suggest you make your own IIR filters to
    introduce a time constant to get around this classical data processing
    hurdle. Labview provides all tools to do that.
    Gerard
    "Frank P." wrote:
    > I am interested in modeling differential equations for a
    mechanical
    > system in Labview. I have used Simulink in the past and there are
    > blocks available for integration and differentiation. How can this be
    > implemented using Labview? Thanks. Frank
    Regards
    Gerard D'Ans ([email protected])
    Laborelec Rodestraat,125 B-1630 Linkebeek
    tel 32 2 382 0568
    fax 32 2 282 0241
    ULB SMA ([email protected])
    Blvd F D Roosevelt CP165 B-1050 Brussels
    Tel 32 2 650 2515
    http://www.ulb.ac.be/polytech/laborulb/index.htm

  • Forward and reverse coefficients

    Hi all, I am a newbie here.
    I am currently working on a filter project. I am required to design a filter in LabView based on the filter circuit and a list of coefficients given. (i have 512 coefficients here, so i dun think it is the 1 that i need)
    I was thinking of using IIR filter to achieve this. The problem that i am facing now is i do not know how to determine the reverse coefficients and the forward coefficients input to IIR filter.
    I would like to know if there is any formula or way to find these two coefficients? Is there any better way to create this filter in Labview?
    I would really appreciate if anyone can help me in this. thanks thanks =)
    Regads,
    Hauo Wah

    Hai,
    FIR or IIR filters are generic models that can be used to create other filters.
    Dive into dspguru.com website to get detailed info on digital filters.  I am attaching the smothing filter co-efficients vi along with this mail.  This vi ships along with the professional development system of LabVIEW not sure about 6.1 having this VI.
    The VI i have attached is converted to 8.0 version (i was able to convert up to that only!!) try converting to the version required.
    Feel free to post for any queries. 
    With regards,
    JK
    (Certified LabVIEW Developer)
    Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
    Attachments:
    Smoothing Filter Coefficients.vi ‏21 KB

  • Filter slope of multipass moving average

    Hey guys,
    here is a picture of the frequency response of a multipass moving average filter. The number of stages tells you how often the data is passed through the filter.
    As I am interested in the different slope behaviours of the different stages I wanted to ask you how to determine the slope.
    Do I take the envelope to calculate the roll off (=slope) of the filter?
    Actually it should be 1 pass (= 1 stage) is 20dB/Dekade, 2 passes = 40dB/dekade and so on...
    I hope you can help me.
    Kind regards
    Slev1n
     

    The equation for the envelope of the frequency response can be obtained by noting that the absolute value of the numerator sin(wM/2) varies between 0 and 1.  So its upper edge is 1, and you can replace sin(wM/2) with unity, to find the upper envelope of H(w). (This envelope only applies for wM/2>Pi, which is the first zero of the numerator.)  Thus you get
    envelope of H(w)= 1/[M*sin(w/2)]^Mp. 
    Note also that when w/2<<1, you can use the approximation sinx ~= x:
    envelope of H(w) ~= 1/[M*w/2]^Mp
    Therefore the envelope of H(w) is proportional to 1/w, 1/w^2, 1/w^3 when Mp=1,2,3.  Now you see why the envelope's slope is 20, 40, 60 dB/decade when Mp=1,2,3.  (Apply the equation for gain in dB, when w changes by 10X.)  The approximation above is decent only when 2Pi/M < w << 1.  If the number of moving average points, M, is small, for example a 5 point moving average, then there will be no frequencies which satisfy the preceding inequality for w.  But you chose M=500, so there is a range of frequencies where the 20 dB/decade rolloff is apparent.  If you look carefully at your plot, you will see that the frequency response starts to deviate from 20 dB/decade as frequency f (=w/2Pi) approaches 0.5 (the Nyquist frequency).  This is because you are getting into the range where sin(x)~=x is not accurate.
    Final comment: Since you apparently care about the frequency response properties of your lowpass filter, you might want to use a different filter.  Other FIR and IIR filters have flatter passbands, sharper rolloff around the cutoff frequency, and lower sidebands.

  • IPnet and DFD toolkit

    I am interested in a Chebyshev filter in FPGA, it is listed in IPnet here and DFD toolkit is reported as source. But i have installed DFD toolkit and no new filters became available in any FPGA palette. Clicking on filter name in IPnet page just brings to standard Labview help for a design block (not for FPGA). How do i get those filters in FPGA?
    Solved!
    Go to Solution.

    Hi Snamprogetti,
    The filter VIs will not be added to palettes under the FPGA target.  Instead, you design the filter using the VIs under your PC target.  Then, once you have a fixed-point filter, you can generate FPGA code from that filter by using the DFD FXP Code Generator VI.  You can also generate code from a filter you have saved on disk by right-clicking your FPGA target in a project and selecting Start IP Generator.  Select the type of filter you have saved from the resulting dialog and follow the steps to use your filter on your FPGA.
    For an example of how to design and generate a filter for FPGA, see the NI Example Finder by going to Help»Find Examples.  Then, look under Toolkits and Modules»Digital Filter Design»Getting Started»Tutorials»Generating Code from a Fixed-Point Filter.lvproj.  There is a VI that shows how to generate FPGA code using the Code Generator VI.
    For more information on the process of designing the filter see the example Designing a Fixed-Point Filter.lvproj.
    Donovan

Maybe you are looking for

  • How To Read RTF file in JAVA?  Using  iText?

    How To Read RTF file in JAVA?  Using  iText?..... import java.io.*; import com.lowagie.text.*; import com.lowagie.text.rtf.*; public class RTF3 { public static void main(String[] args) { // System.out.println("This example generate a RTF file name Sa

  • Pie Chart in Management Cockpit

    Hi everybody, this time a question concerning pie charts in Mgt Cockpit. Does anyone how to show the percentage values of each part of the pie within the chart? Is this possible? I only see the absolute values concatenated with the "%"-sign, which ma

  • Ipod touch will not charge or turn on.

    My daughter's ipod touch got wet. Now it will not charge. I have set it in rice. And now it has set for a least 2 months. Help????

  • Error while determ. loc. crcy: exchange rate type M

    Hi ALL,        after posting goods issue using VL02N i am getting popop with 'update termination' In log it is showing error as 'M2 815: Error while determ. loc. crcy: exchange rate type M' can any one solve my problem thanks vinod

  • Error when  starting CMS

    We receive the error CMS is unstable and will shut down immediately. Reason: Database access error. Reason ORA-00904: "CMS_INCREMENTWITHROLLOVER5": invalid identifier. when we try and start our CMS. We are running the CMS on Oracle as you can tell fr