LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Determine the Cut-off frequency of Low Pass Filter

Hi,

 

Have a class assignment where we are given a subVI "dlsimfilter2" with a Voltage and Amplitude Input and a Voltage ouput, which is a low pass filter.

 

The object of the assignment is to determine the cut-off frequency of the filter itself using whatever method deemed appropriate. My solution uses the cut off as .707 of the output voltage to determine the cut off frequency.I use a boolean led to activate once this value is reached and then that triggers the casee loop to determine and display the maximum value that the frequency was at.

 

Just looking for thoughts on how I could tidy up the solution so that i could replace the dlsimfilter easily with another low pass filter quickly without too much re-wiring as that is the next step. There are other filters that need to be tested sequentially.

 

G2S

Download All
0 Kudos
Message 1 of 11
(6,891 Views)

Several comments:

1. The loop should have some kind of wait or delay. There is no need for it to spin milions of times per second with the same data. Better would be to use an event structure so that it only iterates when an input changes.

2. I would automate the change of frequency. Use Ramp.vi,  a Chirp pattern VI, increment the frequency with a shift register, or exicte the filter with random noise.

3. I would look at the spectrum of the the output using one of the FFT or spectrum VIs. It becomes very easy to see the filter behavior. You can also identify the order of the filter from the slope.

4. No need to have an indicator for the value of the Amplitude slider. Just select Visible Items >> Digital Display.

 

Were you given any limits on the range of input voltages and frequencies?

 

Do all of the filters to be tested have the same conpane pattern? If so, use VI server methods to call the filter VI you want to test.

 

Lynn

0 Kudos
Message 2 of 11
(6,852 Views)

That is a strange filter. The output values are not deterministic. it seems to have a random component of about +/- 0.25% of the amplitude.

 

Lynn

0 Kudos
Message 3 of 11
(6,840 Views)

Lynn,

that a simulation for a lausy noisy filter 😄

But the autor just used even distribution ..... not so often seen in real circuits 😉   and there is a Gaussian White Noise.vi!

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 11
(6,826 Views)

Henrik,

 

That is what I suspect also. Since this is an academic exercise this may be an attempt to make finding the filter parameters slightly more difficult.

 

If I built a real filter that noisy, I would throw it away and start over.

 

Lynn

0 Kudos
Message 5 of 11
(6,799 Views)
Thanks for the replies. I will work on the suggestions you gave me and post back in a few days.

Frequency parameters were 0-10kHz and Amplitude was 0-10Vpp, don't have the details to hand now but I think they are correct.

What is a conpane pattern btw?
0 Kudos
Message 6 of 11
(6,771 Views)

The conpane is the connector pane - the place where you can assign input/output connections to controls and indicators.  The arrow in the image below points to the conpane on the front panel of a VI in edit mode. The Context Help window is also shown so you can see what is connected in this subVI.

 

Lynn

 

Conpane.png

0 Kudos
Message 7 of 11
(6,763 Views)
Hi Lynn, I should have added the 50ms delay in the loop so I should be able to fix that easily. I tried using ramp.vi but could not get it to connect to the filter so I have attached a shift register i built similar to your filter tester but again my waveform graph does not display anything and not sure why. The same issue occurs with FFT analysis on the vi's I build, my filter output cannot be wired directly to them. I corrected the digital display for the amplitude. Regarding the conpane pattern is hard to tell as it only has an icon up in the corner as per the image but when opened they all have 2 inputs and 1 output. Can i ask if the max and min values you had from the array in the filter tester vi gave you the +/-.25% ? The help is ver much appreciated G2S
Download All
0 Kudos
Message 8 of 11
(6,710 Views)

I have no trouble getting either Ramp.vi or FFT.vi to work.

 

Shift register.png

 

The conpane on a VI is determined by the programmer. The dlsimfilter.vi has a conpane with two inputs and one output. Since that VI is password protected, you cannot change the conpane.  I prefer the 4-2-2-4 pattern for new VIs but it really does not make any difference if there are enough terminals for all the inputs and outputs.

 

Yes. I estimated the +/-0.25% from running the filter VI thousands of times with constant input values and plotting the output. Most software filters are deterministic. If you give them the same inputs repeatedly, they return the same output. That is not true of the filter you are testing. Of course I have never seen a filter where you feed it one amplitude and one frequency value and get one output.

 

Lynn

0 Kudos
Message 9 of 11
(6,699 Views)

Hi Lynn,

 

I see now where i was going wrong, i had everything inside the FOR loop so the wiring kept throwing up errors. The vi now works a little better but my issue is getting the vi to stop/reset and store the max freq value once the .707 calculation is complete.

 

The only way I can get it to stay active on the front panel is to ramp in reverse from 10,000 down to 1.

 

G2S

 

 

0 Kudos
Message 10 of 11
(6,676 Views)