フィルターのクリア

How to use bandpass filter.

2 ビュー (過去 30 日間)
Dung Nguyen
Dung Nguyen 2019 年 6 月 24 日
コメント済み: Dung Nguyen 2021 年 7 月 13 日
I have a data set which includes 2 columns: one is time (in month) and one is values that need analysics. I need to used bandpass filer to filter signal and obtain quasi-beninial oscillation (QBO) as figure 6(in attach). The period of this QBO is from 22 to 34 months, centered at 28 months. I try wirte a code but I don't belive on it. I would like everyone to check help me. My data, code, figure in attach. I hope everyone can help me.

採用された回答

Mathieu NOE
Mathieu NOE 2021 年 7 月 8 日
Hello
no bugs or special issues , but minor improvements
I prefer to use the IIR filters (like butter) used with filtfilt
clc;clear all;close all
load RTEC_N1.txt
time=RTEC_N1(:,1);
RTEC=RTEC_N1(:,2);
%% dt
dt = mean(diff(time));
% fnorm_12=[1./28 1./24];
Fs=1/dt;
fc1 = 1./30;
fc2=1./22;
Wn = (2/Fs)*[fc1 fc2];
% Wn = [(2/Fs)*fc1 (2/Fs)*fc2];
% b = fir1(10,Wn,'low',kaiser(11,3));
% wn=[1./30 1./22];
% [b,a] = fir1(75,Wn);
% [b,a] = fir1(80,Wn,'bandpass');
% wn=1./(fs/2)/26
[b,a]=butter(2,Wn);
yy = filtfilt(b,a,RTEC);
% yy = filter(b,a,RTEC);
% figure(1);
% plot(time,RTEC,time,y,time,yy)
% legend('Original','filtfilt','filter');grid on;
plot(time,RTEC,'b',time,yy,'r');grid on;hold on;
fid1=fopen('RTIME_Sfiltertry1.txt','w');
for i=1:length(time)
fprintf(fid1,'%10.3f\t%10.4f\r\n',time(i),yy(i));
end
fclose(fid1);
  8 件のコメント
Mathieu NOE
Mathieu NOE 2021 年 7 月 13 日
hello
well, your eyes are more powerful than any spectral analysis tool !! some tools are more appropriate than others for non stationnary signals (like wavelet vs fft) , but as already said above, there is some trace of the 26-28 month period signal but it's weak; does it means there is a problem with the data ? honestly , i cannot say because my field of expertise is more industrial vibration analysis and control , rather than weather or oceanographic data .
I may come to the point where my help is coming to and end - sorry for that
Dung Nguyen
Dung Nguyen 2021 年 7 月 13 日
Hello
Thanks for your help.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with Signal Processing Toolbox についてさらに検索

タグ

製品


リリース

R14SP1

Community Treasure Hunt

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

Start Hunting!

Translated by