<< arParEst | FOSSEE_Signal_Processing_Toolbox | arburg >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > ar_psd

# ar_psd

Calculate the power spectrum of the autoregressive model.

### Syntax

    [psd, f_out] = ar_psd(a, v)
    [psd, f_out] = ar_psd(a, v, freq)
    [psd, f_out] = ar_psd(a, v, freq, fs)
    [psd, f_out] = ar_psd(..., range)
    [psd, f_out] = ar_psd(..., method)
    [psd, f_out] = ar_psd(..., plottype)

### Parameters

a:

  List of m=(order + 1) autoregressive model coefficients. The first element is the zero-lag coefficient, which always has a value of 1.

v:

  Square of the moving-average coefficient of the AR model.

freq:

  Frequencies at which power spectral density is calculated, or a scalar indicating the number of uniformly distributed frequency values at which spectral density is calculated. (default = 256)

fs:

  Sampling frequency (Hertz) (default = 1).

range:

  Specifies the frequency range of the spectrum. Options include 'half', 'onesided', 'whole', 'twosided', 'shift', or 'centerdc'.

method:

  Specifies the method to calculate the power spectrum. Options include 'fft' or 'poly'.

plottype:

  Specifies the type of plot. Options include 'plot', 'semilogx', 'semilogy', 'loglog', 'squared', or 'db'.

### Description

Function ar_psd() calculates the power spectrum of an autoregressive model using the provided coefficients `a` and variance `v`. It supports various methods for spectrum calculation and allows customization of frequency range and plot type.

### Examples

    // AR(2) model: a = [1, -1.5, 0.7], variance v = 2
    a = [1, -1.5, 0.7];
    v = 2;
    ar_psd(a, v, 512, 2.0, 'whole', 'fft', 'plot');

Report an issue
<< arParEst | FOSSEE_Signal_Processing_Toolbox | arburg >>