# psd_burg (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info Download Help (Windows Only)

Owning Class: spectral analysis

Requires: MathScript RT Module

## Syntax

psd_burg(x, order)

psd_burg(x, order, fftsize)

psd_burg(x, order, fftsize, fs)

psd_burg(x, order, fftsize, range)

psd_burg(x, order, fftsize, fs, range)

Pxx = psd_burg(x, order)

Pxx = psd_burg(x, order, fftsize)

Pxx = psd_burg(x, order, fftsize, fs)

Pxx = psd_burg(x, order, fftsize, range)

Pxx = psd_burg(x, order, fftsize, fs, range)

[Pxx, w] = psd_burg(x, order)

[Pxx, w] = psd_burg(x, order, fftsize)

[Pxx, w] = psd_burg(x, order, fftsize, range)

[Pxx, f] = psd_burg(x, order, fftsize, fs)

[Pxx, f] = psd_burg(x, order, fftsize, fs, range)

Legacy Name: `pburg`

## Description

Uses the Burg algorithm to calculate the power spectral density of an input signal. If you do not request an output, this function plots the power spectral density in the current plot window.

Examples

## Inputs

Name Description
x Specifies the input signal sequence. x is a real or complex vector.
order Specifies the order of the AR model. order is a positive integer.
fftsize Specifies the length of the FFT to perform on the estimated AR coefficient sequence. The default is 256.
fs Specifies the sampling frequency of the input sequence in Hz. If you specify fs, LabVIEW returns the output frequencies in Hz. If you do not specify fs, LabVIEW returns the output frequencies in radians per sample.
range Specifies the range of the estimated power spectral density. range is a string that accepts the following values.

 'onesided' (default) LabVIEW returns the single-sided power spectral density. 'twosided' LabVIEW returns the double-sided power spectral density.

## Outputs

Name Description
Pxx Returns the power spectral density of the input signal x. If x is real and range is 'onesided', the length of Pxx is fftsize / 2 + 1 for an even fftsize and (fftsize + 1) / 2 for an odd fftsize. Otherwise, the length of Pxx is fftsize.
w Returns the frequencies in radians per sample at the points where LabVIEW evaluates Pxx.
f Returns the frequencies in Hz at the points where LabVIEW evaluates Pxx.

## Details

The following table lists the support characteristics of this function.

 Supported in the LabVIEW Run-Time Engine Yes (if you request output) Supported on RT targets Yes (if you request output) Suitable for bounded execution times on RT Not characterized

## Examples

fs = 1000;
t = 0:1/fs:0.2;
fftsize = 1024;
noise = randnormal(size(t));
x = sin(2*pi*100*t) + cos(2*pi*250*t) + noise;

Pxx = psd_burg(x, 10, fftsize, fs);