Documentation Center

  • Trial Software
  • Product Updates

Periodogram PSD Object to Function Replacement Syntax

The following table gives the deprecated spectrum.periodogram object syntax and the equivalent recommended function syntax for periodogram. In the modified periodogram, you use a window other than the default rectangular window. To illustrate modified periodogram syntaxes, the table uses a specific window. In each example, x is the input time series.

Deprecated Syntax

Replacement Syntax

h = spectrum.periodogram;
psd(h,x);
periodogram(x,[]);
% Modified periodogram with window function
h = spectrum.periodogram('hamming');
psd(h,x);
win = hamming(length(x));
periodogram(x,win);
% Modified periodogram with window function and 
% optional input arguments to window function
h = spectrum.periodogram({'Hamming','periodic'});
psd(h, x);
win = hamming(length(x),'periodic');
periodogram(x,win);
% Modified periodogram with Taylor window 
% multiple optional input arguments
nbar = 4;
sll = 30;
h = spectrum.welch({'Taylor', nbar, sll});
psd(h,x,'Fs',fs,'centerdc', true);
% Modified periodogram with Taylor window 
% multiple optional input arguments
nbar = 4;
sll = -30;
win = taylorwin(length(x),nbar,sll);
periodogram(x,win);
h = spectrum.periodogram(...);
psd(h,x,'NFFT',nfft);
win = ...
periodogram(x,window,nfft);
h = spectrum.periodogram(...);
psd(h,x,'Fs',fs);
win = ...
periodogram(x,win,[],fs);
h = spectrum.periodogram(...);
psd(h,x,'NFFT',nfft,'Fs',fs);
win = ...
periodogram(x,win,nfft,fs);
h = spectrum.periodogram(...);
psd(h,x,...,'FreqPoints','User Defined',...
'FrequencyVector',w);
win = ...
periodogram(x,win,w);
h = spectrum.periodogram(...);
psd(h,x,'FreqPoints','User Defined',...
'FrequencyVector',f,'Fs',fs);
win = ...
periodogram(x,win,f,fs);
% when x is real and you want a two-sided
% spectrum
h = spectrum.periodogram(...);
psd(h,x,...,'SpectrumType','TwoSided');
% when x is real and you want a two-sided
% spectrum
win = ...
periodogram(x,win,...,'twosided');
% Two-sided spectrum with DC (0 frequency)in 
% the center
h = spectrum.periodogram(...);
psd(h,x,...,'CenterDC',true);
% Two-sided spectrum with DC (0 frequency)in 
% the center
win = …
periodogram(x,win,...,'centered'); 
h = spectrum.periodogram(...);
psd(h,x,...,'ConfLevel',p);
win = …
periodogram(x,win,...,'ConfidenceLevel',p); 
h = spectrum.periodogram(...);
hPSD = psd(h,x,...);
Pxx = hPSD.Data;
F = hPSD.Frequencies;
win = … 
[Pxx,F] = periodogram(x,win,...); 
h = spectrum.periodogram(...);
hPSD = psd(h,x,...,'ConfLevel',p);
Pxx = hPSD.Data;
F = hPSD.Frequencies;
Pxxc = hPSD.ConfInterval;
win = ... 
[Pxx,F,Pxxc] = periodogram(x,win,...); 

Was this topic helpful?