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 signal.

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);
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);
Taylor window and multiple optional input arguments:
nbar = 4;
sll = 30;
h = spectrum.periodogram({'Taylor',nbar,sll});
psd(h,x,'Fs',fs,'centerdc',true);
nbar = 4;
sll = -30;
win = taylorwin(length(x),nbar,sll);
periodogram(x,win,[],fs,'centered');
h = spectrum.periodogram(...);
psd(h,x,'NFFT',nfft);
win = ...
periodogram(x,win,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);
Two-sided spectrum of a real signal:
h = spectrum.periodogram(...);
psd(h,x,...,'SpectrumType','TwoSided');
win = ...
periodogram(x,win,...,'twosided');
Two-sided spectrum with DC (0 frequency) in the center:
h = spectrum.periodogram(...);
psd(h,x,...,'CenterDC',true);
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?