?? c5_firfilterexample.asv
字號:
%File: c5_FIRFilterExample.m
facale=1;fshift=0.0;dscale=1000; %scaling parametersc5_Filter_Data; %local data
Freq_Resp=data;fs=900;filtsize=512;ts=1/fs;
[himp time]=FIR_Filter_AMP_Delay(Freq_Resp,fs,filtsize,fscale,...
fshift,dscale);
%
%Apply a window
%
nw=256;window1=hamming(nw);window=zeros(filtsize,1);
%
%Make sure the window is centerd properly
%
wstart=(filtsize/2)-(nw/2);
wend=(filtsize/2)+(nw/2)-1;
window(wstart:wend)=window1;
impw=himp.*window;
%
figure;
subplot(1,2,1);
plot(abs(himp));
grid;
xlabel('Time Sample Index');
ylabel('Filter Impulse Response')
subplot(1,2,2);
plot(abs(impw));
grid;
xlabel('Time Sample Index');
ylabel('Windowed Filter Impulse Response')
[logpsd,freq,ptotal,pmax]=log_psd(himp,filtsize,ts);
[logpsdw,freq,ptotal,pmax]=log_psd(impw,filtsize,ts);
figure;
subplot(1,2,1)
plot(freq(128:384),logpsd(128:384))
grid;
xlabel('Frequency Sample Index');
ylabel('Frequency Response')
subplot(1,2,2)
plot(freq(128:384),logpsdw(128:384));
grid;
xlabel('Frequency Sample Index');
ylabel('Window Frequency Response')
%End of script file.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -