I have 1440 data of tidal elevation (24 hours recording every 1 minute), I attached my data (Book1.xlsx). My question is how can I do High Pass Filter with those data? My experience in this case is zero.

 채택된 답변

Mathieu NOE
Mathieu NOE 2021년 7월 8일

1 개 추천

hello Nabil
the code below implements low and high pass filtering
hope it helps
T = readtable('Book1.xlsx');
time = T.Var1;
y = T.Var2;
dt = 60; % seconds (data sampled every min)
Fs = 1/dt;
samples = length(y);
t = (0:samples - 1)*dt/3600; % now in hours
%%% filter data %%%
N = 20;
y_LP = smoothdata(y, 'gaussian' , N); % low pass filtered data
y_HP = y - y_LP; % high pass filtered data
%%% plot data %%%
figure(1)
subplot(211),plot(t,y,t,y_LP);legend('Raw','low pass filtered');
title(['Data samples at Fs = ' num2str(Fs) ' Hz / filtered with smoothdata' ]);
xlabel('Time (hours) ')
ylabel('Tidal depth () ')
subplot(212),plot(t,y_HP);legend('high pass filtered');
title(['Data samples at Fs = ' num2str(Fs) ' Hz / filtered with smoothdata' ]);
xlabel('Time (hours) ')
ylabel('Tidal depth () ')

댓글 수: 2

Nabil Amirul
Nabil Amirul 2021년 7월 9일
Thank you very much sir, I am very appreciate it
Mathieu NOE
Mathieu NOE 2021년 7월 12일
My pleasure

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with Signal Processing Toolbox에 대해 자세히 알아보기

태그

질문:

2021년 7월 8일

댓글:

2021년 7월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by