Home > voicebox > lpcar2ff.m

lpcar2ff

PURPOSE ^

LPCAR2FF LPC: Convert AR coefs to complex spectrum FF=(AR,NP)

SYNOPSIS ^

function [ff,f]=lpcar2ff(ar,np)

DESCRIPTION ^

LPCAR2FF LPC: Convert AR coefs to complex spectrum FF=(AR,NP)

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

 Outputs: ff(nf,np+1)  Complex 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 [ff,f]=lpcar2ff(ar,np)
0002 %LPCAR2FF LPC: Convert AR coefs to complex spectrum FF=(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: ff(nf,np+1)  Complex 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: lpcar2ff.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 [nf,p1]=size(ar);
0034 if nargin<2
0035     if nargout
0036         np=p1-1;
0037     else
0038         np=128;
0039     end
0040 end
0041 ff=(rfft(ar.',2*np).').^(-1);
0042 f=(0:np)/(2*np);
0043 if ~nargout
0044     subplot(2,1,2);
0045     plot(f,unwrap(angle(ff)));
0046     xlabel('Normalized frequency f/f_s');
0047     ylabel('Phase (rad)');
0048     subplot(2,1,1);
0049     plot(f,db(abs(ff)));
0050     xlabel('Normalized frequency f/f_s');
0051     ylabel('Gain (dB)');
0052     title('LPC Spectrum');
0053 end
0054

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