Suggestions for filtering a signal
Mostra commenti meno recenti
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
Wayne King
il 27 Nov 2013
Please attach the data
Gova ReDDy
il 27 Nov 2013
Modificato: Gova ReDDy
il 27 Nov 2013
Risposte (1)
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
il 27 Nov 2013
Modificato: Image Analyst
il 27 Nov 2013
Image Analyst
il 27 Nov 2013
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
il 27 Nov 2013
Modificato: Gova ReDDy
il 27 Nov 2013
Image Analyst
il 27 Nov 2013
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?
Gova ReDDy
il 27 Nov 2013
Image Analyst
il 27 Nov 2013
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?
Gova ReDDy
il 28 Nov 2013
Gova ReDDy
il 28 Nov 2013
Image Analyst
il 28 Nov 2013
Probably the SG or median filter. Try them and see if they let you measure what you need to measure.
Gova ReDDy
il 29 Nov 2013
Image Analyst
il 29 Nov 2013
See my demo, attached below in blue.
Gova ReDDy
il 2 Dic 2013
Image Analyst
il 2 Dic 2013
Your link is broken.
Gova ReDDy
il 2 Dic 2013
Modificato: Gova ReDDy
il 2 Dic 2013
Image Analyst
il 3 Dic 2013
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
il 3 Dic 2013
Modificato: Gova ReDDy
il 3 Dic 2013
Image Analyst
il 3 Dic 2013
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
il 3 Dic 2013
Modificato: Gova ReDDy
il 3 Dic 2013
Image Analyst
il 3 Dic 2013
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
il 3 Dic 2013
Modificato: Gova ReDDy
il 4 Dic 2013
Categorie
Scopri di più su Signal Generation, Analysis, and Preprocessing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
