This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Welch spectrum


Hs = spectrum.welch
Hs = spectrum.welch(WindowName)
Hs = spectrum.welch(WindowName,SegmentLength)
Hs = spectrum.welch(WindowName,SegmentLength,OverlapPercent)



The use of spectrum.welch is not recommended. Use pwelch instead.

Hs = spectrum.welch returns a default Welch spectrum object, Hs, that defines the parameters for Welch's averaged, modified periodogram spectral estimation method. The object uses these default values.

Property NameDefault ValueDescription


Cell array containing WindowName and optional window parameter


SamplingFlag: symmetric

Cell array containing the window name or 'User Defined' and, if used for the particular window, an optional parameter value. (See window for valid window names and for more information on each window, refer to its reference page.)

You can use set to change the value of the additional parameter or to define the MATLAB® expression and parameters for a user-defined window. (See spectrum for information on using set.)



SamplingFlag: symmetric

Valid windowname options are:

'Flat Top'
'User Defined'

Window names must be enclosed in single quotes, such as spectrum.welch('tukey') or spectrum.welch({'tukey',0.7}).

See window and the corresponding window function page for window parameter information. You can use set to change the value of the additional window parameter or to define the MATLAB expression and parameters for a user-defined window (see spectrum for information on using set).



Length of each of the time-based segments into which the input signal is divided. A modified periodogram is computed on each segment and the average of the periodograms forms the spectral estimate. Choosing the segment length is a compromise between estimate reliability (shorter segments) and frequency resolution (longer segments). A long segment length produces better resolution while a short segment length produces more averages, and therefore a decrease in the variance.



Percent overlap between segments

Hs = spectrum.welch(WindowName) returns a spectrum object, Hs, using Welch's method with the specified window and the default values for all other parameters. To specify parameters for a window, use a cell array formatted as spectrum.welch({WindowName,winparam}).

Hs = spectrum.welch(WindowName,SegmentLength) returns a spectrum object, Hs with the specified segment length.

Hs = spectrum.welch(WindowName,SegmentLength,OverlapPercent) returns a spectrum object, Hs with the specified percentage overlap between segments.


See pwelch for more information on the Welch algorithm.


collapse all

Define a cosine of 200 Hz embedded in white noise.

Fs = 1000;
t = 0:1/Fs:.3;
x = cos(2*pi*t*200)+randn(size(t));

View the spectral content of the signal using the Welch algorithm.

Hs = spectrum.welch;

Define a cosine of 200 Hz embedded in white noise.

Fs = 1000;
t = 0:1/Fs:0.3;
x = cos(2*pi*t*200)+randn(size(t));

Compute Welch's power spectral density estimate of the signal using a Hann window.

window = 33;
noverlap = 32;
nfft = 4097;

h = spectrum.welch('Hann',window,100*noverlap/window);
hpsd = psd(h,x,'NFFT',nfft,'Fs',Fs);

Visualize the power spectral density expressed in decibels.

Pw = hpsd.Data; 
Fw = hpsd.Frequencies;


[1] harris, fredric. j. “On the Use of Windows for Harmonic Analysis with the Discrete Fourier Transform.” Proceedings of the IEEE®. Vol. 66 (January 1978).

See Also

| |

Introduced before R2006a

Was this topic helpful?