① 怎么在matlab里实现一组数据(ss)的低通滤波。数据如下图所示,我的目的是去除噪音。
wp=1800; %pass f max
ws=2000;%截止fs
Rp=.3; %pass <Rp dB;
Rs=50; %stop >Rs dB;
[N, Wn] = buttord(wp/(fs/2), ws/(fs/2), Rp, Rs);
[b,a]=butter(N,Wn); %[B,A] = BUTTER(N,Wn),Wn是归一化频率,具体计算方法是(2*截止频率)/采样频率。
[h,w]=freqz(b,a);
tt='lowpass'; %tt为标题字符串,表示是哪种滤波器
② MATLAB数值滤波处理方法有哪些
MATLAB数值滤波处理方法有:
首先关于fspecial函数的定义,fspecial函数用于建立预定义的滤波算子。
其语法格式为:
h = fspecial(type)
h = fspecial(type,para)
其中type指定算子的类型,para指定相应的参数;
函数type的类型有:
1、'average'averaging filter为均值滤波,参数为hsize代表模板尺寸,默认值为[3,3]。
函数格式:H = fspecial('average',hsize)
2、 'disk'circular averaging filter为圆形区域均值滤波,参数为radius代表区域半径,默认值为5。
函数格式:H = fspecial('disk',radius)
3、'gaussian'Gaussian lowpass filter为高斯低通滤波,有两个参数,hsize表示模板尺寸,默认值为[3 3],sigma为滤波器的标准值,单位为像素,默认值为0.5。
函数格式:H = fspecial('gaussian',hsize,sigma)
4、'laplacian' filter approximating the 2-D Laplacian operatorlaplacian filter为拉普拉斯算子,参数alpha用于控制算子形状,取值范围为[0,1],默认值为0.2.
函数格式:H = fspecial('laplacian',alpha)
5、'log'Laplacian of Gaussian filter为拉普拉斯高斯算子,有两个参数,hsize表示模板尺寸,默认值为[3 3],sigma为滤波器的标准差,单位为像素,默认值为0.5。
函数格式:H = fspecial('log',hsize,sigma)
6、'motion'motion filter运动模糊算子,有两个参数,表示摄像物体逆时针方向以theta角度运动了len个像素,len的默认值为9,theta的默认值为0。
函数格式:H = fspecial('motion',len,theta)
7、'prewitt'Prewitt horizontal edge-emphasizing filter用于边缘增强,大小为[3 3],无参数。
函数格式:H = fspecial('prewitt')
8、'sobel'Sobel horizontal edge-emphasizing filter用于边缘提取,无参数
函数格式:H = fspecial('sobel')the filter H: H'.9、'unsharp'unsharp contrast enhancement filter为对比度增强滤波器。参数alpha用于控制滤波器的形状,范围为[0,1],默认值为0.2.函数格式:H = fspecial('unsharp',alpha)
③ matlab ,已有数据,如何滤波
思路就是设计一个低通滤波器,分界点就是50Hz,以下是一个巴特沃斯低通滤波器的程序figure; %绘制巴特沃斯滤波器频响、相位曲线及信号滤后曲线%低通滤波器技术要求,假设采样频率为fs=500, 拟定%通带截止频率为40Hz,阻带下限截止频率为60Hz%通带衰减为0.25dB,阻带衰减为30dBT=A;data=B;fs=500;Wp=2*pi*40/fs;Ws=2*pi*60/fs;Rp=0.25;Rs=30;
Omip=Wp/pi;Omis=Ws/pi; %归一化技术要求
[N,Wn]=buttord(Omip,Omis,Rp,Rs); %确定滤波器的阶数
disp(['The order of Butterworth Filtering is ',num2str(N)]);
[b,a]=butter(N,Wn); %确定Butterworth滤波器转移函数系数向量
[H,w]=freqz(b,a,512); %512点复频响应
subplot(221); %绘制幅频响应曲线
plot(w/pi,abs(H));title('幅频响应');
xlabel('w(/pi)');ylabel('|H(jw)|');axis([0,1,0,1.1]);
%set(gca,'XTickMode','manual','XTick',[0,Omip,Omis,1]);
%set(gca,'YTickMode','manual','YTick',[0,10^(-Rs/20),10^(-Rp/20),1]);
%grid;
subplot(222); %绘制相频响应曲线
plot(w/pi,angle(H)/pi);title('相频响应');
xlabel('w(/pi)');ylabel('pha(/pi)');axis([0,1,-1,1]);
%set(gca,'XTickMode','manual','XTick',[0,Omip,Omis,1]);
%grid;
subplot(223);
plot(T,data);title('原信号波形图');axis([0,2.2,-1.1,1.1]);
subplot(224);
data1=filter(b,a,data);
plot(T,data1);title('滤波后波形图');
④ 怎样用matlab进行图像滤波处理
1、打开软件,读入图片。
⑤ 使用Matlab对MODIS数据进行SG滤波
Savitzky-Golay滤波器(简称为S-G滤波器),是一种在时域内基于局域多项式最小二乘法拟合的滤波方法。
因为云覆盖、气溶胶等大气因素会对MODIS数据等造成噪声影响,有必要用滤波等方法来减小或消除这种影响。
⑥ 如何使用MATLAB将实验得到的数据进行滤波得到正弦基波
先过一个比较器(大于某一阈值为A,小于某一阈值为B),然后再中值滤波试试。 感觉频域方法比较难做,要去毛刺一般都会削弱高频。
⑦ matlab中怎么让信号通过滤波器
1、首先打开Matlab,鼠标点击图上的图标。
⑧ Matlab滤波
导入数据,用load函数,具体怎么用,看mathworks.com帮助,或者 在命令窗口输入 help load.
滤波用filter 函数,具体怎么用,看mathworks.com帮助。
filter -
Linear filtering
Syntax
newfts = filter(B, A, oldfts)
Description
filter filters an entire financial time series object with certain filter specifications. The filter is specified in a transfer function expression.
newfts = filter(B, A, oldfts) filters the data in the financial time series object oldfts with the filter described by vectors A and B to create the new financial time series object newfts. The filter is a "Direct Form II Transposed" implementation of the standard difference equation. newfts is a financial time series object containing the same data series (names) as the input oldfts.