LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My filter always alarms

I tried to use DAQmx to acquire a signal(with some noise) whose frequency could be above 500KHz. I used filter to get the real signal but when the sampling freq is about 200KHz, the filter turns wrong. The wrong code is -20020 and the analysis is Cut-off freq fc must be met: 0<=fc<=fs/2.

Could anyone please help me? Thanks in advance.

0 Kudos
Message 1 of 20
(2,747 Views)

The filter requirement simply states that your cutoff frequency be below Nyquist (Sampling Frequency / 2). If your sampling frequency is 200kHz then you cannot have a filter above 100kHz. You need to increase your sample rate or decrease your filter. If your frequency of interest goes up to 500kHz, then you need to always sample with a MINIMUM of 1MHz sample clock.

 

Charles Chickering

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 2 of 20
(2,744 Views)

Sure,the sampling freq is below Nyquist. For example,the signal freq changes,sampling freq also changes and at any time sampling freq which i set is always at least four times than the signal freq.

0 Kudos
Message 3 of 20
(2,740 Views)

Ok, your frequency is below Nyquist but what about your cutoff filter frequency?

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 4 of 20
(2,714 Views)

My lowpass and highpass filter cutoff freq are both 2Hz...Is this the key to the problem?

0 Kudos
Message 5 of 20
(2,708 Views)

The low pass must be higher than the high pass otherwise you filter out everything...

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
Message 6 of 20
(2,701 Views)

Thanks,but i am sorry i don't understand your reply. Is it ture that the high pass must be beyond the low pass?

0 Kudos
Message 7 of 20
(2,685 Views)

Sure,I tried it again and i found when lowpass cutoff freq is higher than highpass,the warning which number is -20023 and analysis is 0 < f_low <= f_high <= fs/2 turned out again

0 Kudos
Message 8 of 20
(2,680 Views)
Hmm maybe I forgot to ask the obvious question how are you getting the data? The filter needs waveform data type with the delta time set properly. Otherwise the filter VI has no idea what to do. I should have thought of this before...
Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 9 of 20
(2,678 Views)

@J Zx wrote:

Sure,I tried it again and i found when lowpass cutoff freq is higher than highpass,the warning which number is -20023 and analysis is 0 < f_low <= f_high <= fs/2 turned out again


Notice this new warning is 0  < f_low not 0 <= f_low. I got bit by this the other day. Make sure you are choosing a number for f_low that is greater than 0, and not 0.

0 Kudos
Message 10 of 20
(2,674 Views)