How to check the freqeuncy response of a boxcar filter?

35 ビュー (過去 30 日間)
Kalasagarreddi Kottakota
Kalasagarreddi Kottakota 2023 年 8 月 15 日
回答済み: Chunru 2023 年 8 月 15 日
Hi, I am performing a lowpass filtering with two different filters. a) window i.e. box car b) butter filter. For butter, I know how to see the frequency response, but how to see the freqeuncy response of boxcar filter?
clear all; clc;
fs =2000;
fc =20/(fs/2);
N = 1/fc;
h = boxcar(N); % 1/N = fc
h = h/sum(h);
%filtered_signal = filtfilt(h, 1, signal));
butter
clc; clear all;
fs = 2000;
filtorder = 6; bw_butter =20;
[bcoeff,acoeff] = butter(filtorder,bw_butter/fs*2);
figure()
freqz(bcoeff,acoeff,[],fs)
xlim([0 200])
%filtered_signal = filtfilt(bcoeff,acoeff, signal));

回答 (1 件)

Chunru
Chunru 2023 年 8 月 15 日
clear all; clc;
fs =2000;
fc =20/(fs/2);
N = 1/fc;
h = boxcar(N); % 1/N = fc
h = h/sum(h);
bcoeff = h;
acoeff = 1;
freqz(bcoeff,acoeff,[],fs)
%xlim([0 200])

カテゴリ

Help Center および File ExchangeAnalog Filters についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by