对于 MATLAB 中的模拟通信系统设计,我首先需要进行以下两项设计:
设计一个低通滤波器
[slow]=lowpassfilter(s,fcut,fs)
,以截止频率fcut过滤输入信号
和采样频率s
fs
(以赫兹为单位)。设计一个带通滤波器
[sband]=bandpassfilter(s,fcutlow,fcuthigh,fs)
,用截止频率过滤输入信号
和s
>fcutlowfcuthigh
以及采样频率fs
(以赫兹为单位)。
你能帮我一下吗?
最佳答案
我发现这个问题有很多观点,但仍然没有好的答案。
以下代码将满足您的需要。由于没有指定过滤器类型,我使用巴特沃斯过滤器来演示它。 s
是输入信号,x
是滤波后的信号。 fs
是以 Hz 为单位的采样率。
% Design and apply the lowpass filter
order = 4;
fcut = 8000;
[b,a] = butter(order,fcut/(fs/2),'low');
x = filter(b,a,s);
% Design and apply the bandpass filter
order = 10;
fcutlow = 1000;
fcuthigh = 2000;
[b,a] = butter(order,[fcutlow,fcuthigh]/(fs/2), 'bandpass');
x = filter(b,a,s);
关于matlab - MATLAB 中的低通/带通滤波器设计,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10642224/