Home > voicebox > lpcar2pf.m

lpcar2pf

PURPOSE ^

LPCAR2PF Convert AR coefs to power spectrum PF=(AR,NP)

SYNOPSIS ^

function [pf,f]=lpcar2pf(ar,np)

DESCRIPTION ^

LPCAR2PF Convert AR coefs to power spectrum PF=(AR,NP)

  Inputs: ar(nf,n)     AR coefficients, one frame per row
          np           Size of output spectrum is np+1 [n]

 Outputs: pf(nf,np+1)  Power spectrum from DC to Nyquist
          f(1,np+1)    Normalized frequencies (0 to 0.5)

 For high speed make np equal to a power of 2

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [pf,f]=lpcar2pf(ar,np)
0002 %LPCAR2PF Convert AR coefs to power spectrum PF=(AR,NP)
0003 %
0004 %  Inputs: ar(nf,n)     AR coefficients, one frame per row
0005 %          np           Size of output spectrum is np+1 [n]
0006 %
0007 % Outputs: pf(nf,np+1)  Power spectrum from DC to Nyquist
0008 %          f(1,np+1)    Normalized frequencies (0 to 0.5)
0009 %
0010 % For high speed make np equal to a power of 2
0011 
0012 %      Copyright (C) Mike Brookes 1998-2014
0013 %      Version: $Id: lpcar2pf.m 5026 2014-08-22 17:47:43Z dmb $
0014 %
0015 %   VOICEBOX is a MATLAB toolbox for speech processing.
0016 %   Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html
0017 %
0018 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0019 %   This program is free software; you can redistribute it and/or modify
0020 %   it under the terms of the GNU General Public License as published by
0021 %   the Free Software Foundation; either version 2 of the License, or
0022 %   (at your option) any later version.
0023 %
0024 %   This program is distributed in the hope that it will be useful,
0025 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0026 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0027 %   GNU General Public License for more details.
0028 %
0029 %   You can obtain a copy of the GNU General Public License from
0030 %   http://www.gnu.org/copyleft/gpl.html or by writing to
0031 %   Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA.
0032 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0033 
0034 [nf,p1]=size(ar);
0035 if nargin<2
0036     if nargout
0037         np=p1-1;
0038     else
0039         np=128;
0040     end
0041 end
0042 pf=abs(rfft(ar.',2*np).').^(-2);
0043 f=(0:np)/(2*np);
0044 if ~nargout
0045         plot(f,pf.');
0046         xlabel('Normalized frequency f/f_s');
0047         ylabel('LPC Power Spectrum');
0048 end
0049

Generated on Tue 10-Oct-2017 08:30:10 by m2html © 2003