05-13-2014 04:38 PM
I am trying to filter the noise but when i use the butterworth filter i am not getting the same amplitude as that of the original signal(ampitude is set 1 and filtered signal amplitude is much less than0.1) it is very much reduced what should i do to get the same amplitude. Am i doing any mistake here? I have attached the VI.
05-13-2014 06:09 PM
I have not had time to analyze your VI in depth but two issues are likely part of what you are seeing. You did not set the frequency values to default so please post the values you are using - signla freuqncy and filter cutoff frequencies.
1. Very narrow bandwidth filters have long transients at the beginning. If you are using values close to the defaults, the transient has probably not decayed by the time the signal ends.
2. Very narrow bandwidth Butterworth filters may have significant passband attenuation.
Lynn
05-14-2014 06:11 AM
Hi lynn,
Thanks for the reply. I am sorry i have not set the default values. Basically, I am trying to filter a single frequency signal from many signals with noise . i am trying to filter the 300 hz signal back in the output. I should be able to filter a single frequncy sinusoidal signal from real world signals. that is why i tried the btterworth bandpass filter to avoid ripples. how to avoid close frequency components? lets say i need reject 301hz signal and get only 300 hz at the output. should i apply windows ? I am really coonfused how to filter a single frequency? plz help
05-14-2014 02:29 PM
Filters can be more complicated than they often appear.
Try these things to get an idea of the behavior of the filter:
1. Set the Noise amplitude to 0 and the signal amplitude to 1. Set signal frequency 1 to 2. Also set the init/cont inputs on the filters to False. Increase the number of samples (and the value of fs) to 65536.
The filtered signal looks like this:
Note that it takes more than 0.5 seconds for the value to stabiize.
Change the signal amplitude to 0 and the noise amplitude to 1. Because the noise is random, each time it runs the result will be different.
Now let's look at the spectrum.
Signal = 1, Noise = 0. Signal = 0, Noise = 1.
Note that the spectrum of the sine is not a single line at 300 Hz. This is due to the modulation of the waveform by the filter and due to spectral leakeage because the sampling frequency is not synchronized with the signal frequency. The spectral shape is approximately the frequency response of the filter. The peak amplitude of the sine spectrum is 0.7. This is due to the response of a narrow band filter (and other effects).
Increasing the filter order to 10 will make the filter resonse roll off more rapidly but also increases the length of the transient.
Transient Signal = 1, Noise = 0. Spectrum Signal - 0, Noise = 1.
Note that the transient is far from complete at the end of 1 second. The frequency response is similar at 0.001 but much narrower at 1E-6.
Now that I have overwhelmed you with stuff about filters that you probably did not even want to know, what can you do about it? The answer depends on what you are doing with the desired signal, how the amplitudes of the desired and undesired signals compare, how much nosie is present, whether other interferring signals are alos present, and other things, such as how steady the signals are, how fast you need results, and so on.
Windows are probably not going to help much although how useful they would be depends on the answers to many of the questions above.
Please tell us more about what you are trying to do. What are the sources of the desired and undesired signals? How much noise is present? What will you be doing with the signal after you separate it?
Lynn
05-15-2014 06:41 PM
hi lynn,
I need little explanation on this,
"Note that the spectrum of the sine is not a single line at 300 Hz. This is due to the modulation of the waveform by the filter and due to spectral leakeage because the sampling frequency is not synchronized with the signal frequency. The spectral shape is approximately the frequency response of the filter. The peak amplitude of the sine spectrum is 0.7. This is due to the response of a narrow band filter (and other effects)."
That is what I want to do I want to filter single frequency how can i do that? is it not at all possible? that is why i tried bandpass butterworth filter thought that i could do it. If i increase the order the i know why the transient period is long it is because IIR Filters depend on past output.But I dont know why the ampltitude decreases if order increases.
My aim is to filter a sinusoid of 10 hz or close to which it occurs it is the fundamental frequency component of our system. It is the measured wheel vibration of a vehicle. After filtering the signal i take the RMS value of the signal to compare with other faulty signals. The problem is I am not able to get perfect sinusoid once i use the filter. I need a pure sine wave of single frequency.(i.e the peak which is highest near 10hz).
As you can see from the above image marked with white arrows(amplitude decreases and increases because of sinusoids with low amplitude is added) it is not sinusoid with same amplitude it keeps changing. I need the frequency of the peak marked with blue Arrow but i am also getting the peaks of red arrows which i do not want and should be attenuated so that i can get continuous amplitude sinusoid. The noises can be by various facors because it's a signal from acclerometer mounted on a running vehicle wheel. Plz help ( I had set low cut off as 9.5 hz and high cut off as 10.5 because the running frequency of the vehicle occur in this range and the order as 5) Is there some other method i can use.
05-15-2014 08:52 PM
I do not have much time right now. I wil try to look at it in more detail tomorrow.
Try the Extract Single Tone Information.vi from the Signal Processing >> Waveform Measurements palette. It uses frequency domain techniques to get data about one component of a signal.
How fast does the amplitude of the 10 Hz signal vary? How much does the actual frequency vary?
Lynn
05-17-2014 02:15 AM
Hi Lynn,
I thank you for suggesting the Single tone vi. I was able to detect the peak value within the range and again filter for the peak value. Now I am able extract single peak. Can you tell me why the amplitude decreases when we pass through the filter. I did not get that part.
Regards,
Bharath Kumar
05-17-2014 12:34 PM
Bharath Kumar,
All real filters, whether implmented in hardware or software, have a gradual transition from the passband to the stopband. Typically the cutoff frequency is defined as the frequency where the attenuation is -3 dB. For simple filters the attenuation versus frequency has a logarithmic characteristic. The attenuation curve is a straight line when plotted as decibels per octave of frequency.
For a low pass filter you can always find a frequency which is several octaves lower than the cutoff frequency. For a bandpass filter, which is essentially a lowpass filter and a highpass filter cascaded, the transition regions may overlap, especially in narrow passband filters, so that the minimum attenuation in the passband is not near zero. A single pole Butterworth lowpass filter with a -3 dB point at 1 Hz has -1 dB attenuation at ~0.71 Hz. and about -2.2 dB at 0.9 Hz. So a bandpass filter consisting of a low pass filter at 1 Hz and a highpass filter at 0.81 Hz would have about -4.4 dB attenuation at the center frequency of 0.9 Hz.
Higher order filters have a steeper rolloff and thus less attenuation at the center of the passband. Types of filters other than Butterworth can also have much faster rolloff and are typically better choices for extremely narrowband filters.
Lynn