?? exa031101_fftfilt.m
字號:
%----------------------------------------------------------------------------
% exa031001_fftfilt.m, for example 3.11.1
% to test fftfilt.m,and to finish the convolution of a long sequence with
% a short sequence by DFT.
%----------------------------------------------------------------------------
clear;
% 用疊接相加法,計算濾波器系數(shù)h和輸入信號x的卷積
% 其中h為10階hanning窗,x是帶有高斯白噪的正弦信號
h=fir1(10,0.3,hanning(11));% h: a short sequence ; h is the impulse response
N=500;p=0.05;f=1/16; % of a low-pass filter.
u=randn(1,N)*sqrt(p); % u:white noise
s=sin(2*pi*f*[0:N-1]); % s:sine signal
x=u(1:N)+s; % x: a long sequence;
y=fftfilt(h,x); % y=x*h
subplot(211)
plot(x);
subplot(212)
plot(y);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -