필터 지우기
필터 지우기

How to filter? (Kalman, Narrow Bandpass , Low Pass)

조회 수: 6 (최근 30일)
Bob
Bob 2016년 1월 24일
편집: Bob 2016년 3월 30일
Hello,
I have a signal which I need to filter them with three filters.
  댓글 수: 2
Star Strider
Star Strider 2016년 1월 24일
I’m not certain what you’re doing or what your objective is. I would instead use two serial cascaded digital filters, the first a bandpass filter with a low-frequency cutoff of 0.5-1.5 Hz and a high-frequency cutoff of 30 Hz, then the notch (narrow bandstop) filter with a normalised frequency of 1. A Chebyshev Type II design would likely be best.
Give that a go and see if it does what you want.
Bob
Bob 2016년 1월 25일
Thanks for your answer,
Could you provide me a code or an example since I don't know many things about filters?

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

채택된 답변

Star Strider
Star Strider 2016년 1월 25일
Filter design, implementation, and plots:
D = load('Xaris load.mat');
t = D.t;
Xs_ddot = D.Xs_ddot;
Xu_ddot = D.Xu_ddot;
Ts = mean(diff(t)); % Sampling Interval
Fs = 1/Ts; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Wp = [3 25]/Fn; % Normalised Paassband
Ws = Wp .* [0.2 1.1]; % Normalised Stopband
Rp = 1; % Passband Ripple
Rs = 30; % Stopband Ripple
[n, Wn] = buttord(Wp,Ws,Rp,Rs); % Bandpass Filter Design
[b,a] = butter(n,Wn,'bandpass'); % Choose Butterworth
[bp_sos,bp_g] = tf2sos(b,a); % Use SOS For Stability
Rs = 10;
Rp = 20;
Ws = [9.95 10.05]/Fn;
n = 2;
[b,a] = cheby2(n,Rs,Ws,'stop'); % Bandstop (Notch) Filter Design
[bs_sos,bs_g] = tf2sos(b,a);
figure(1)
freqz(bp_sos,1024,Fs) % Bandpass Filter Bode Plot
figure(2)
freqz(bs_sos,1024,Fs) % Bandstop Filter Bode Plot
Xs_bp = filtfilt(bp_sos, bp_g, Xs_ddot); % Filter Signals
Xs_out = filtfilt(bs_sos, bs_g, Xs_bp);
Xu_bp = filtfilt(bp_sos, bp_g, Xu_ddot);
Xu_out = filtfilt(bs_sos, bs_g, Xu_bp);
figure(3)
subplot(2,1,1)
plot(t, Xs_ddot)
title('Unfiltered ‘Xs\_ddot’')
grid
subplot(2,1,2)
plot(t, Xs_out)
title('Filtered ‘Xs\_ddot’')
grid
figure(4)
subplot(2,1,1)
plot(t, Xu_ddot)
title('Unfiltered ‘Xu\_ddot’')
grid
subplot(2,1,2)
plot(t, Xu_out)
title('Filtered ‘Xu\_ddot’')
grid

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Digital Filter Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by