Filtering high frequencies from response signal
Show older comments
I have a data set comprising a number of strain measurements obtained from a strain gauge and would like to filter out the ultra high frequncy noise present inbetween the seperate measurements. See code attached below :)clc, clear, close all;
load('7004x4.mat')
t= g{:,1};
sm= g{:,3};
sm= rmmissing(sm);
t=rmmissing(t);
n=10;
t = arrayfun(@(i) mean(t(i:i+n-1)),1:n:length(t)-n+1)';
sm= arrayfun(@(i) mean(sm(i:i+n-1)),1:n:length(sm)-n+1)';
plot(t,sm)
xlabel('Time Elapsed (s)')
ylabel('Strain')
title('Strain Signal')
fs= 6.2e-4;
Accepted Answer
More Answers (1)
Mathieu NOE
on 20 Jan 2021
hello
try also sgolayfilt
function y=sgolayfilt(x,order,framelen,weights,dim)
%SGOLAYFILT Savitzky-Golay Filtering.
% SGOLAYFILT(X,ORDER,FRAMELEN) smooths the signal X using a
% Savitzky-Golay (polynomial) smoothing filter. The polynomial order,
% ORDER, must be less than the frame length, FRAMELEN, and FRAMELEN must
% be odd. The length of the input X must be >= FRAMELEN. If X is a
% matrix, the filtering is done on the columns of X.
Categories
Find more on Digital Filter Analysis in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!