对于模拟通信系统设计在MATLAB首先我需要做这两种设计:低通/带通滤波器的设计中MATLAB
设计的低通滤波器
[slow]=lowpassfilter(s,fcut,fs)
其过滤输入信号s
与截止频率fcut
和采样频率fs
赫兹。设计的带通滤波器
[sband]=bandpassfilter(s,fcutlow,fcuthigh,fs)
其过滤输入信号s
的截止频率fcutlow
和fcuthigh
和在赫兹采样频率fs
。
你能帮我吗?
对于模拟通信系统设计在MATLAB首先我需要做这两种设计:低通/带通滤波器的设计中MATLAB
设计的低通滤波器[slow]=lowpassfilter(s,fcut,fs)
其过滤输入信号s
与截止频率fcut
和采样频率fs
赫兹。
设计的带通滤波器[sband]=bandpassfilter(s,fcutlow,fcuthigh,fs)
其过滤输入信号s
的截止频率fcutlow
和fcuthigh
和在赫兹采样频率fs
。
你能帮我吗?
对于滤波器设计目的,Matlab有fdatool
。 Here是文档。您可以使用fdatool
和信号处理工具箱完成所有这些任务。
我发现这个问题有这么多的意见,仍然没有很好的答案。
以下代码将执行您所需的操作。由于没有指定过滤器类型,我使用butterworth过滤器来演示它。 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);
是的,我知道,但问题是我需要从其他功能的输出采用输入,所以我有FCUT或FS没有具体的数值。所以当我写入fs时,它会给出错误:S –
我想你应该改变你的问题的措辞。如果你知道fs(apriori),你可以检查信号的fft以确定你想要过滤的频段。 – YBE