www.gusucode.com > signal 案例源码程序 matlab代码 > signal/SpecifyTimeHalfbandwidthProductExample.m

    %% Specify Time-Halfbandwidth Product
% Obtain the multitaper PSD estimate with a specified time-halfbandwidth
% product.

% Copyright 2015 The MathWorks, Inc.


%%
% Create a sine wave with an angular frequency of $\pi/4$ rad/sample with
% additive _N_(0,1) white noise. The signal is 320 samples in length.
% Obtain the multitaper PSD estimate with a time-halfbandwidth product of
% 2.5. The resolution bandwidth is $[-2.5\pi/320,2.5\pi/320]$ rad/sample.
% The default number of DFT points is 512. Because the signal is
% real-valued, the PSD estimate is one-sided and there are 512/2+1 points
% in the PSD estimate.

n = 0:319;
x = cos(pi/4*n)+randn(size(n));
pmtm(x,2.5)