<< unwrap Signal Processing Supplementary toolbox

Signal Processing Supplementary toolbox >> Signal Processing Supplementary toolbox > welch

welch

Computes power spectral density using welch's method

Calling Sequence

[P,c] = welch(x,N,M,wintype,nplot)

Parameters

x

Input signal whose power spectral density (psd) is to be computed

N

Length of FFT

M

Length of the window

wintype

Type of the window

nplot

Option to display or suppress plotting psd

P

Computed power sepctrum density

c

correlation function of the power spectrum

Description

It computes the power spectral density using Welch's method with 50 percent overlap. It uses three different types of windows as option for wintype parameter, 're', 'hn','hm' corresponding to Rectangular, Hanning and Hamming windows. The fifth input parameter nplot is used as a control to display or supress the power spectrum density plot. If the fifth parameter is present, it displays the power spectral density plot.

Examples

// Sampling frequency
fs=1000;
// time instants
t=(0:0.3*fs)./fs;
// amplitude and frequecy 
A=[2 8]; f=[150 ;140];
// Discrete signal with random noise
xn=A*sin(2*%pi*f*t)+5*rand(1:length(t),'normal');
//Computing power spectral density and then displaying plot
[p,c]=welch(xn,512,64,'re','p');

See Also

Authors


Report an issue
<< unwrap Signal Processing Supplementary toolbox