フィルターのクリア

Removing noise from Hysteresis loops

6 ビュー (過去 30 日間)
Sadia
Sadia 2019 年 7 月 5 日
編集済み: Sadia 2019 年 9 月 24 日
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 件のコメント
Star Strider
Star Strider 2019 年 9 月 23 日
Thank you.
Sadia
Sadia 2019 年 9 月 24 日
編集済み: Sadia 2019 年 9 月 24 日
My pleasure.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeVisual Exploration についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by