Smoothing a bouncing signal

2 views (last 30 days)
Kevin Frei
Kevin Frei on 18 Jun 2015
I have a signal that rustles a lot. I want to smooth the signal so that I can compare it better to other signals. I tried it allready with different funtions as filter and smooth, but it didnt work. Here is my actual code:
Trq_Starter = csvread('Starter.csv'); Data = load('02_Schnellstart_GI.mat');
time = Data.t(525:1:1850)-Data.t(525); N1P = Data.N1P(525:1:1850)
N1P_Trq = Trq_Starter(:,2); Trq_Trq = Trq_Starter(:,1);
x_RefTrq = CheckVectorMonotony(Trq_Trq); y_ref = smooth(N1P_Trq, 15, 'sgolay');
y_ref_Trq_S = interp1(x_RefTrq,y_ref,N1P, 'linear', 'extrap')';
y_ref_Trq_S(y_ref_Trq_S<0) = 0;
And this one from CheckVectorMonotony:
function [ output_vector ] = CheckVectorMonotony( input_vector )
[tmpVectorLength, ~] = size(input_vector);
output_vector = input_vector;
for j = 1:tmpVectorLength-1
if output_vector(j+1,1) <= output_vector(j,1)
output_vector(j+1,1) = output_vector(j,1) + 0.00001;
else
end % end if
end % end for
end % end function
Can anybody help me with this problem. I got parts from this code from my precursor, so maybe its also more simple than this one.
Thanks and regards, Kevin.
  2 Comments
Image Analyst
Image Analyst on 18 Jun 2015
You forgot to attach your csv file, so we can't run your code (yet). Why didn't smooth(), filter(), sgolayfilt(), etc. work? Can you upload some screenshots?
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh on 18 Jun 2015
Hi,
If would be great if you put an image of your signal, and also make it clear what do you want to get.

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!