⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gibbs.m

📁 stft(含:短时傅立叶变换 Gabor变换等)
💻 M
字号:
% Chapter 7: Rectangular Window Gibbs Phenomenon
%
subplot(1,1,1); N = 1000;
% M = 7
M = 7; alpha = (M-1)/2;
n = -alpha:alpha;
w = ones(1,M);
omega = (2*pi/N)*[-N/2:N/2];
Wr = real(w*(exp(-j*n'*omega)));
db = 20*log10(abs(Wr)/max(Wr));
IntWr = cumsum(Wr)/N;
%
% plots
subplot(2,2,1); plot(omega/pi,IntWr);
axis([-1,1,-0.15,1.15]);
title('M = 7')
xlabel('frequency in pi units'); ylabel('Integrated Amplitude Response')
set(gca,'YTickMode','manual','YTick',[0,1])
set(gca,'XTickMode','manual','XTick',[-1,0,1]); grid
%
% M = 21
M = 21; alpha = (M-1)/2;
n = -alpha:alpha;
w = ones(1,M);
omega = (2*pi/N)*[-N/2:N/2];
Wr = real(w*(exp(-j*n'*omega)));
db = 20*log10(abs(Wr)/max(Wr));
IntWr = cumsum(Wr)/N;
%
% plots
subplot(2,2,2); plot(omega/pi,IntWr);
axis([-1,1,-0.15,1.15]);
title('M = 21')
xlabel('frequency in pi units'); ylabel('Integrated Amplitude Response')
set(gca,'YTickMode','manual','YTick',[0,1])
set(gca,'XTickMode','manual','XTick',[-1,0,1]); grid
%
% M = 51
M = 51; alpha = (M-1)/2;
n = -alpha:alpha;
w = ones(1,M);
omega = (2*pi/N)*[-N/2:N/2];
Wr = real(w*(exp(-j*n'*omega)));
db = 20*log10(abs(Wr)/max(Wr));
IntWr = cumsum(Wr)/N;
%
% plots
subplot(2,2,3); plot(omega/pi,IntWr);
axis([-1,1,-0.15,1.15]);
title('M = 51')
xlabel('frequency in pi units'); ylabel('Integrated Amplitude Response')
set(gca,'YTickMode','manual','YTick',[0,1])
set(gca,'XTickMode','manual','XTick',[-1,0,1]); grid
%
% M = 101
M = 101; alpha = (M-1)/2;
n = -alpha:alpha;
w = ones(1,M);
omega = (2*pi/N)*[-N/2:N/2];
Wr = real(w*(exp(-j*n'*omega)));
db = 20*log10(abs(Wr)/max(Wr));
IntWr = cumsum(Wr)/N;
%
% plots
subplot(2,2,4); plot(omega/pi,IntWr);
axis([-1,1,-0.15,1.15]);
title('M = 101')
xlabel('frequency in pi units'); ylabel('Integrated Amplitude Response')
set(gca,'YTickMode','manual','YTick',[0,1])
set(gca,'XTickMode','manual','XTick',[-1,0,1]); grid

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -