① 怎麼在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.