LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Filtering Problem

Hi,
I'm facing problem in filtering.I am using Butterworth lowpass filter &
I'm unable to understand the function of the VI attached i.e why 2500000
is used as sampling rate & why 10Hz is used as low cutoff freq.
since my Input to the filter is a 60HZ sine wave.If I reduce the CUt off
freq from 10hz to 5hz the amplitude of sine reduced considerably & increased
low cutoff freq from 10hz to 60hz the sine wave got distorted.what might
be the problem I'm unable to understand.
Plz help me out
Thanks.
sayaf
0 Kudos
Message 1 of 5
(2,366 Views)
The sampling rate should be about 10 times the highest frequency component in the measured signal to avvoid aliasing.
If the only noise available in the signal is the 60Hz noise, then the sample rate should be at least 600 samples per second (at least 120 to meet Nyquist criterion).

<<" i.e why 2500000
is used as sampling rate ">>
Are you sampling the signal at 2 500 000 Hz ?, if so then this this the value to use. If you sample at 1000 Hz, then the value should be 1000. etc....

<<"If I reduce the CUt off
freq from 10hz to 5hz the amplitude of sine reduced considerably & increased
low cutoff freq from 10hz to 60hz the sine wave got distorted">>
The low cutoff Frequency should be way higher than the frequency of interest in the neasurement.
An IDEAL filter has a flat (constant) response from 0 to Fcutoff, and then goes to zero above Fcutoff. However, all filters are not ideal and their response droops dpending on the kinfd of filter and its parameters. so you should have the cutoff frequency an order highercthan the highest freqiuency of interest.
Also, you may want to increase the order of the filter (2 to 4). It can improve the response. If you are using LabVIEW 7.X, try using the filter Xpress vi's.
0 Kudos
Message 2 of 5
(2,356 Views)
sayaf,

I cannot answer the "why" questions, but I may be able to help explain part of what is going on. The Sampling frequency should be set to be equal to the rate used in acquiring your data. It seems unlikely that a 2.5 MHz sampling frequency would be used for 60 Hz data. The low cutoff frequency should be set to a value higher than the desired frequency (60 Hz in your case) and lower than the frequency of any interfering signals your are trying to filter out. It must also be lower than the Nyquist frequency which is half of the sampling frequency.

For example if your sampling frequency is 1 kHz and an interfering signal is at 200 Hz, then the Nyquist frequency is 500 Hz and the fl cutoff frequency should be about 100-120 Hz.

If this does not answer your questions, please provide more information about your system, in particular the sampling rate and characteristics of the desired and interfering signals. There are a number of participants on these forums with filtering experience who may be able to help.

Lynn
0 Kudos
Message 3 of 5
(2,355 Views)
Thanks,
The input to the filter is a sine modulated PWM signal,but the sine wave freq is 60hz & I'm acquiring this PWM signal at a recorrd lenght of 2000000 samples & filtering the PWM pulses to get pure sine wave.Also I wanted to know why the amplitude of the filtered signal getting reduced. These were the details that i forgot to mention.
Thanks once again
sayaf
0 Kudos
Message 4 of 5
(2,336 Views)
What is the frequency of the pulse train? You must sample fast enough to accurately time the pulse widths to accurately reproduce the modulation.

For example if the pulse frequency is 10 kHz and the timing resolution of the PWM modulator is 1 microsecond (1% of the period), you would need a sampling frequency in excess of 2 MHz to recover all the data encoded in the PWM signal. This would explain the 2.5 MHz sampling frequency mentioned in your original posting. To get 1 period of the 60 Hz signal (16.7 ms) requires 41666 samples. All filters have a transient response when signal is first applied, so several periods of the desired signal may be required to get to a steady state condition. Your 2E6 samples should be sufficient.

As a manual check of the sampling and PWM detection try looking at one PWM pulse at sample zero and another at sample 10417 (before the filter). These should be about 90 degrees out of phase at the 60 Hz signal. The difference of the pulse widths will be proportional to the sine amplitude. (Do not use 180 degree phase difference unless you can be certain that the samples were taken near the peaks of the sine wave.)

Lynn
0 Kudos
Message 5 of 5
(2,318 Views)