www.gusucode.com > signal 案例源码程序 matlab代码 > signal/ModifiedPeriodogramWithHammingWindowExample.m
%% Modified Periodogram with Hamming Window % Obtain the modified periodogram of an input signal consisting of a % discrete-time sinusoid with an angular frequency of $\pi/4$ % radians/sample with additive $N(0,1)$ white noise. % Copyright 2015 The MathWorks, Inc. %% % Create a sine wave with an angular frequency of $\pi/4$ radians/sample % with additive $N(0,1)$ white noise. The signal is 320 samples in length. % Obtain the modified periodogram using a Hamming window and default DFT % length. The DFT length is the next power of two greater than the signal % length, or 512 points. Because the signal is real-valued and has even % length, the periodogram is one-sided and there are 512/2+1 points. n = 0:319; x = cos(pi/4*n)+randn(size(n)); periodogram(x,hamming(length(x)))