Suggestions for filtering a signal

Hello, I have a signal as shown here signal and I need to filter it so that the resultant will only have the noiseless pulse signal.I have used the SG filter as sgolayfilt(b,3,31); adn the response is shown in the link image. The smoothed from SGfilter still needs to be filtered as the required is only the pure pulse signal.So tried using the LP filter as
d = fdesign.lowpass('Fp,Fst,Ap,Ast',3,5,0.5,40,100);
Hd = design(d,'equiripple');
output = filter(Hd,SGfiltereoutput);
But the resultant shown in the 3rd plot of the link image is very different to the one expected. Can anyone suggest how to get a pure pulse signal from the signal shown in the 1 part of link image. thanks.

2 Commenti

Please attach the data
Gova ReDDy
Gova ReDDy il 27 Nov 2013
Modificato: Gova ReDDy il 27 Nov 2013
Yes,there are two attchments with one having a single pulse and other having set of pulses in it.

Accedi per commentare.

Risposte (1)

Image Analyst
Image Analyst il 27 Nov 2013

0 voti

Well you obviously filtered it too much. I think the Savitzky-Golay filter is still the way to go. Why don't you just increase the window width to get more smoothing? But if you're looking to recover a pure delta function or step function, you're not going to do it by smoothing the signal - that's the exact opposite of what you want to do. I'm not sure how you define pulse. Can you give an example of the pure pulse or signal that you're trying to get?

20 Commenti

Gova ReDDy
Gova ReDDy il 27 Nov 2013
Modificato: Image Analyst il 27 Nov 2013
I'am wondering whether is it possible to filter the signal as shown here Pure_signal but I am not sure if this is possible. Can I know to what extent the signal can be filtered from noise or from high freq components and which method should be used.
Link doesn't work. You can filter something to the max extent possible. You can even get a perfectly flat, constant value if you want to take it that far. There are tons of denoising methods. Are you not able to do what you need to do if you just use something simple like median filter or a box averaging filter? What IS it that you want to do if you had a perfectly noise-free signal?
Gova ReDDy
Gova ReDDy il 27 Nov 2013
Modificato: Gova ReDDy il 27 Nov 2013
Here is my expected noise free pusles signal Is it possible to can achieve something similar to this
Or if other kind of methods should be applied.Can you suggest a method that will work for this.I just want to get the pulse signal as better as possible from the noise free signal.
Looks like you pretty much already got something very close to that. What's wrong with it? Can you not determine what you need to determine? Can you answer my question from above: What IS it that you want to do if you had a perfectly noise-free signal?
The plot in blue is the one which got after using SG filter for smoothing and red one is the one I drew in paint this what my expected result should looke like.
What IS it that you want to do if you had a perfectly noise-free signal? My final job is to find the number of pulse signals encountered in a particular time interval and this is the reason I want to make it better one so that the final resultant looks better.
If you have the Signal Processing Toolbox, you can use findpeaks() without even doing any smoothing. Just give it a threshold of 0.1 or something. Otherwise you can increase the window size of the Savitzky-Golay filter to get the red line if you want, though it's not necessary if you just want to count peaks. Do you have a longer signal that has 3 or 4 or more peaks in it?
Yes,I attached a copy of it with name "Bunch_Pulses.txt" in post2.
Which one suits or can be used for this particular requirement from SG filter,median filter or a box averaging filter.
Probably the SG or median filter. Try them and see if they let you measure what you need to measure.
Can I know how to implement the SGfilter manullay for example implementing this sgolayfilt(b,3,31) because I want to implement this with the microcontroller. S0, need a manual implementation so that will change this into C. Thanks,
See my demo, attached below in blue.
Hello imageAnalyst,
The result of SGfilter (using different window size) still needs to be filtered has the orginal signal on the CRO looks like the 2nd signal in the link image. I really want to get rid of the signal shown in the red portion of the 1st signal of the %3Chttp://img543.imageshack.us/img543/1149/05io.jpg%20filtered%3E.The green signal in the 1st protion of image shows original and the red,blue with SGfilter windows. How this can be done. Thanks.
Your link is broken.
Gova ReDDy
Gova ReDDy il 2 Dic 2013
Modificato: Gova ReDDy il 2 Dic 2013
Image Analyst here it is.. http://imageshack.us/f/543/05io.jpg/
That zooms in on some very specialized areas. I suggest you first find the tall peaks, and the second tallest peaks, then filter only the part in between.
Gova ReDDy
Gova ReDDy il 3 Dic 2013
Modificato: Gova ReDDy il 3 Dic 2013
Yes I found the first highest peak using this in the signal but confused with finding the second highest.Also how to implement this filter only the part in between .
I used both the SG filter for smoothing and LPfilter with a cutoff freq=3Hz with this b = fdesign.lowpass('Fp,Fst,Ap,Ast',3,4,0.5,80,50);.I got the results as shown here
I compared the results of both SG and LP filters and their response look the same look the similar but only thing is that the LP filer output starts from 0 instead the input and LP filter signal starts from 0.61. Can I know how to make the LPfilter output start from the original signal value.
Once you have the highest peaks, you just have to fall down the right side and then go back up until you hit another peak. Then you create a binary vector with the location of the "in between" parts. Then filter the whole signal but assign the smoothed elements only in the location of the binary vector.
filteredSignal(binaryVector) = smoothedSignal(binaryVector);
Gova ReDDy
Gova ReDDy il 3 Dic 2013
Modificato: Gova ReDDy il 3 Dic 2013
ImageAnalyst The method you mentioned above will be hard to implement on microcontroller so need things like smoothing or the other digital filters for my purpose.
Thanks.
It's just MATLAB code. And not even as hard as what's inside sgolay(). Can't you use the Coder to create C code to put onto your microcontroller?
Gova ReDDy
Gova ReDDy il 3 Dic 2013
Modificato: Gova ReDDy il 4 Dic 2013
I need to your comments on the on the output of SG and LP filters as they have the same output response except the LPfilter starts from zero insetad of original value.Need your suggestion to make the LPfilter output to start from original instead of zero and is my LPfilter needs any chnages for this particular implementation.
Also can you suggest an efficient method to find(count) the number of pulses occured in a particular time like now I am checking the peaks above a threshold and counting. Thanks.

Accedi per commentare.

Categorie

Richiesto:

il 27 Nov 2013

Modificato:

il 4 Dic 2013

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by