How to filter a signal?
Show older comments
Hello everyone,
I've this data (3 forces, a power and a current), that I've imported from a .tdms file.
I need to detect the peaks on the lower peaks which represent the contact between a cutting tool and a workpiece. After escluding the initial and the final zone where the engagement it's not constant, using "getcursormode", I've used this part of code:
avg = mean(-Matrix_Data(trim(1,2)+pre_engag:trim(1,3)-post_engag,2)); % -Matrix_Data for detecting only negative peaks
[pks,locs] = findpeaks(-Matrix_Data(trim(1,2)+pre_engag:trim(1,3)-post_engag,2),'MinPeakHeight',avg,'MinPeakProminence',avg/2.5,'MinPeakDistance',19);
Basically my problem is that the detected peaks are not as perfect as I'd like.
I need to pre-filter the signals for having a better waveform to anlyse later. Any suggestions? I haven't the particular need of cutting any frequence but I'd have a filter that would allow me to follow existing data very precisely by eliminating any very close peaks. It's also possible to change the findpeaks parameter but I've already tried all the possible combinations.
Thank you some much for anyone will help me.
4 Comments
Yazan
on 9 Aug 2021
The peaks of which column of your data do you need to detect?
riccardo favaro
on 9 Aug 2021
Yazan
on 9 Aug 2021
Can you indicate which peaks we're talking about here?

Star Strider
on 9 Aug 2021
The peaks are more apparent in the filtered signnal in Column #3, as I filtered them.
Accepted Answer
More Answers (0)
Categories
Find more on Multirate Signal Processing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!