Filter Selection for Noisy Signal

2 ビュー (過去 30 日間)
C. Robinson
C. Robinson 2018 年 3 月 26 日
コメント済み: Star Strider 2018 年 3 月 27 日
Hello,
I am filtering a noisy signal that has a carrier frequency of 800 Hz, but was sampled at a very high frequency, ~250 kHz. I generated the following code, and it filters the signal, but produces a start-up transient (which doesn't filter the beginning of the data). It may just be a feature of the first order filter that I am using (which has a tau). Are there any other filters available that could accomplish my goal (filtering all of the data w/o a transient)? I attached 3 pictures: the first is the entire signal (zoomed out); the second is of the start up transient, and the third is of a portion of the signal that shows I am filtering it (at least in the time domain).
Fc = 800; % filter corner (Hz)
Wc = 2*pi*Fc; % filter corner (rad/sec)
tau = 1/Wc; % filter time constant (sec)
% First order lag
% 1
% G(s) = _____________
% tau*s + 1
num = [1];
den = [tau 1];
printsys(num,den); % analog filter
% Data sampled at 249,600 Hz
Ts = 4.0064e-06
% Convert analog filter to digital
[b,a] = c2dm(num,den,Ts);
printsys(b,a,'z');
den = [a(1) a(2)];
num = [b(1) b(2)];
test = filter(num,den,data);
figure; plot(data); hold on; plot(test, 'r')

採用された回答

Star Strider
Star Strider 2018 年 3 月 26 日
If you have the Signal Processing Toolbox, use the filtfilt (link) function instead of filter.
  4 件のコメント
C. Robinson
C. Robinson 2018 年 3 月 27 日
編集済み: C. Robinson 2018 年 3 月 27 日
When I tried filtfilt before, my input wasn't of type double, and that was the reason for me not getting a desirable response. I attached two plots; the one entitled Filtered Signal 3 displays filter vs. filtfilt, and the one entitled Filtered Signal 4 displays the filtfilt response on top of the noisy signal (no unwanted transient). I was able to do it with a first order filter. Thanks for your help! I really appreciate it.
Star Strider
Star Strider 2018 年 3 月 27 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDigital Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by