From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am using a simple low pass however the output from the filter comes out at a different frequency even though the input frequency falls within the passband

Solved!
Go to solution

I am simulating a sine wave at approximately 1000 Hz  (i am varying the frequency using a slider), i wish to pass this signal through a low pass filter (butterworth) with a high cuttoff frequency of 2200 Hz and a low cut of frequency of 2900 Hz. However the output frequency after the filter appears to be lower in the order of a thousand. the output frequency is approximately 0.1 Hz.

 low pass filter front panel.jpglow pass filter block diagram.jpg

 Is there any one that can please guide me to solving this problem, i have tried various filters and i am still having this problem, could it be incorrect sampling?

 

I have attached the block diagram as well as the front panel

0 Kudos
Message 1 of 7
(4,868 Views)
Solution
Accepted by topic author Pritz

Because you are using express vis and the dynamic data type...

 

You convert the DDT signal (which contains timing information) into a DBL array to perform the filtering. The take a  DBL array (which contains no timing data) and convert it into a DDT (which now contains no timing data). Hence when you try to display and analyse it you have lost all timing (frequency) data.

 

If you were to take the DBL array output of your filter and build a waveform and supply the dt for the waveform from the sampling frequency control then it will work.

 

Better still, ditch the DDT and use waveforms from the start 🙂

 

array-wav.png

Message 2 of 7
(4,850 Views)

Hi Stuart.Parkins

 

I have tried this and it seems to be working well, i realised my error now, thank you for assisting me with this (and educating me in the process), however i am not entirely sure what you mean by use waveforms from the start? are you suggesting I should not simulate a signal using that specific vi?

 

Thank you again much appreciated

0 Kudos
Message 3 of 7
(4,801 Views)

Hi Pritz,

 

Dynamic Data Type is used exclusively by the Express vis and was designed to 'make things easy' if all you are using is the Express vis. As soon as you want to use other vis (such as your filter) you need to convert the DDT to something else, and that can be slow and a nuisance.

 

You could have used the Filter express vi and fed your DDT straight into it and that would also have worked.

 

You can generate a sin Waveform type using the Waveform->Analog Wfm->Generation->Sine Waveform.vi (also on the Signal Processing pallette)

 

I would generally advise learning how to do things the 'long way round' without using the Express vis. They might be convenient for quick jobs but you get much more control over what is going on if you use the non-express vis.

Message 4 of 7
(4,775 Views)

yeah im still getting to know labview abit better and am still a novice so your advice has helped me tremendously, i have connected my labview vi to a signal generator using a usb 20-20 board however the response of the system to a change in frequency is rather 'slow' i see a change on my labview wavegraph approximately 10 seconds after i have turned te knob on the signal generator could this also be due to the changing of dynamic data?

0 Kudos
Message 5 of 7
(4,755 Views)

No, thats not your problem I'm sure.

 

I would guess it is more to do with the sampling rate / number of samples you have set up. Can you post your vi and tell me what you have set for sampling rate and number of samples?

Message 6 of 7
(4,733 Views)

I took your advice and it seems to be working, i initially had equal sampling rate and samples per channel once i changed it to a higher sampling rate and lower samples per channel the response is now quicker, i have attached my vi and pasted a front panel below.

 

low pass filter comparison for board front panel.jpg

0 Kudos
Message 7 of 7
(4,701 Views)