# quadcof

## PURPOSE

Helper function to calculate the nonstationary quadratic inverse matrix

## SYNOPSIS

function [A,sumV] = quadcof(N,NW,order)

## DESCRIPTION

     Helper function to calculate the nonstationary quadratic inverse matrix
     Usage: [A,sumV] = quadcof(N,NW,order)
     N             (number of samples)
     NW: Time bandwidth product
     order: order (number of coefficients, upto 4NW)

     Outputs:

     A: quadratic inverse coefficient matrix
     sumV: sum of the quadratic inverse eigenvectors

## CROSS-REFERENCE INFORMATION

This function calls:

- quadinv calculates the quadratic inverse eigenvectors

This function is called by:

## SOURCE CODE

    0001 function [A,sumV] = quadcof(N,NW,order)
    0002 % Helper function to calculate the nonstationary quadratic inverse matrix
    0003 % Usage: [A,sumV] = quadcof(N,NW,order)
    0004 % N             (number of samples)
    0005 % NW: Time bandwidth product
    0006 % order: order (number of coefficients, upto 4NW)
    0007 %
    0008 % Outputs:
    0009 %
    0010 % A: quadratic inverse coefficient matrix
    0011 % sumV: sum of the quadratic inverse eigenvectors
    0012
    0013 A = zeros(2*NW,2*NW,order);
    0014 V = quadinv(N,NW);
    0015 [P,alpha] = dpss(N,NW,'calc');
    0016
    0017 for ii = 1:order
    0018
    0019   for jj = 1:2*NW
    0020     for kk = 1:2*NW
    0021     A(jj,kk,ii) = sqrt(alpha(jj)*alpha(kk))*...
    0022                       sum(P(:,jj).*P(:,kk).*V(:,ii));
    0023     end;
    0024   end;
    0025 end;
    0026 sumV=sum(V)/N;
    0027
    0028