06-24-2014 09:55 PM
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
06-25-2014 09:11 AM
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
06-25-2014 02:46 PM
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
06-26-2014 01:45 AM
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!
06-26-2014 01:17 PM
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
06-27-2014 08:55 AM
06-27-2014 10:22 AM
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
07-01-2014 12:20 PM
07-01-2014 03:15 PM
I have no trouble getting either Ramp.vi or FFT.vi to work.
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
07-02-2014 07:56 AM
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