How to Smooth signal data to find clean peaks
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Julio
am 26 Feb. 2023
Kommentiert: Star Strider
am 28 Feb. 2023
Hello, I wanted to know how to make the signal that I get (image 1) smooth as in image 2. There are 20 peaks I need to find but want to do it clean as image 2.
I have implemented the code (Fatiga.m) but I don't know what is wrong.
I attach the data file (Zip file) in case they can help me
Thank you so much
2 Kommentare
John D'Errico
am 26 Feb. 2023
If you are seriously hoping to smooth curves as noisy as that, into nice smooth virtual sine waves with well defined peaks, good luck. Your data is very sparsely sampled compared to the noise in it, so what your eye sees as a nice periodic behavior is less obvious to a computer.
Akzeptierte Antwort
Star Strider
am 26 Feb. 2023
I am not certain what you want.
One option is simply to use a lowpass filter, then adjust the ‘CutoffFreq’ variable until you are happy with the result. (I arbitrarily cose a 1 Hz sampling frequency, since neither that nor a time vector was provided.) The essence of that is that the ‘CutoffFreq’ value must be greater than 0 and less than 0.5.
Experiment with it to get the result you want —
% file = websave('Fatiga','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1307815/Fatiga.m')
% type(file)
Uz = unzip('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1307820/S17_6.ASC.zip');
% Te = readcell(Uz{1}, 'FileType','text')
% Te(20:30,:)
M1 = readmatrix(Uz{1}, 'FileType','text', 'HeaderLines',38);
M1 = M1(:,2:end)
x = (1:size(M1,1)).';
CutoffFreq = 0.0175;
M1_Filt = lowpass(M1, CutoffFreq, 1, 'ImpulseResponse','iir');
figure
plot(x,M1_Filt)
grid
xlim([0 1E+3])
.
2 Kommentare
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!