LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IIR Direct Form II Structure Implementation

Hello all, I am trying to implement the IIR Direct Form II filter structure in Labview. I am doing this the "hard way" and I am not using the Labview built-in filter blocks.  I have coded this in Matlab and have attached a zip file that contains: 1) the Labview VI. 2) the input waveform file for testing the Labview VI. 3) a document showing the Matlab graphs. The Matlab graphs are correct. The problem is that the first 3 graphs from the Labview VI match the Matlab graphs but the last one (Block 3 6th Order LPF output voltage) does not. The 6th Order Cascade LPF should be filtering out any frequency above 42Hz. As you can see from the other 3 graphs, the dominant frequency is 120Hz. But this is not being filtered out in the LPF. I should note that I am a new Labview user and have very limited knowledge on how to use this program. So, I will need detailed instructions, or even better, I would like for someone to modify the attached VI so I can see exactly how this should be done. Thanks! By the way the sample freq is 10kHz. But this is defaulted in the front panel. And all the coefficients that appear in the front panel are for the 6th order LPF and they agree (within round off error) with Matlab and with my hand calculations. I think my problem has something to do with how I am presenting the data to the filters. I am feeding the filter train directly with the waveform file. Maybe this is not correct?

0 Kudos
Message 1 of 2
(1,368 Views)

I'm not very familiar with filter logic, but it appears there must just be an issue with the actual code. With all the data wires crossing each other, two of them may be connecting when you intended on to go over the other or vice versa.

 

Is there a reason you do not want to use the built-in LabVIEW VIs? Furthermore, the LabVIEW Adaptive Filter Toolkit has several tools that make filtering much easier (sorry, I don't mean to sound like a salesman..). If you're concerned with performance, these functions are typically as efficient - and sometimes more efficient - than hard coding everything.

 

Sorry I know this isn't terribly helpful, but I would recommend confirming that the logic is correct and/or trying to utilize some of LabVIEW's functions to make this a bit easier.

 

-Chris G

Applications Engineer
National Instruments
0 Kudos
Message 2 of 2
(1,346 Views)