Removing noise from Hysteresis loops

6 次查看(过去 30 天)
Hi, I need a help in removing noise from Hysteresis loops, I have generated code which loads multiple files(containing Force and Displacement data) one by one and plots their Hysteresis loops but i need to remove noise and the smoothening curve should fit the orginal shape, I have used a filter in following code but it distorts the orginal shape of loops which effects the area under the curve for calculation of damping.This filter works well for one data file but disfigures the other file, so I want a solution that would work for my all files. Any help would be highly appreciated.
Following is my code:
clc
clear all
projectdir = 'F:\NUST\SAMPLE 9\Measured'
dinfo = dir(fullfile(projectdir))
dinfo([dinfo.isdir]) = [] %get rid of all directories including . and ..
%nfiles = length(dinfo)
folder = 'F:\NUST\IMAGE\hysteresis';
for j = 5 :6
filename = fullfile(projectdir, dinfo(j).name)
delimiter = ';';
startRow = 1000;
endRow = 2000;
formatSpec = '%*s%*s%f%f%f%f%f%f%f%f%f%[^\n\r]';
f1 = fopen(filename, 'r')
dataArray = textscan(f1, formatSpec, endRow-startRow+1, 'Delimiter', delimiter, 'EmptyValue' ,NaN,'HeaderLines', startRow-1, 'ReturnOnError', false);
fclose(f1)
%% Allocate imported array to column variable names
Displacement = dataArray{:, 1}
Force = (dataArray{:, 2})*1000
%%%%%%%%%%%%%Plots%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
figure (j)
%plot(Testtime,Force)
%b=fir1(20,0.1,'low');
%[b,a]=butter(10,0.2,'low');
[b,a]=butter(10,0.2,'low');
%y1=filter(b,1,Force);%Fir
y2=filter(b,a,Force);%butter
plot(Displacement,y2)
%plot(Displacement,Force)
title(dinfo(j).name)
%title(['S1 R',sprintf('%d',j)])
xlabel('Displacement(mm)')
ylabel('Force(N)')
%saveas(h,sprintf('FIG%d.png',j));
hold on
%saveas(plot, fullfile(folder, sprintf('fig%02d.jpg', j)));
pngFileName = sprintf('Fig_%d.jpg', j);
fullFileName = fullfile(folder, pngFileName);
% Then save it
%saveas(gcf, fullFileName)
end

采纳的回答

Star Strider
Star Strider 2019-7-6
The easiest way to remove the noise is likely to fit your data to a function that describes the hysteresis.
See: Interpolation when y data is not strictly a function of x for an illustration of how to do that.
  25 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Visual Exploration 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by