-
Notifications
You must be signed in to change notification settings - Fork 9
/
b2a.m
32 lines (28 loc) · 773 Bytes
/
b2a.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
% function [aca] = b2a(bc);
%
% This function takes a b polynomial, and returns the minimum phase,
% minimum power a polynomial
%
% Inputs:
% bc - beta polynomial coefficients
%
% Outputs:
% aca - minimum phase alpha polynomial
%
% written by John Pauly, 1992
% (c) Board of Trustees, Leland Stanford Junior University
function [aca] = b2a(bc)
n = length(bc);
% calculate minimum phase alpha
bcp = bc;
bl = length(bc);
blp = bl*8;
bcp(blp) = 0;
bf = fft(bcp);
bfmax = max(abs(bf));
if bfmax>=1.0, % PM can result in abs(beta)>1, not physical
bf = bf/(1e-8 + bfmax); % we scale it so that abs(beta)<1 so that
end; % alpha will be analytic
afa = mag2mp(sqrt(1-bf.*conj(bf)));
aca = fft(afa)/blp;
aca = aca(n:-1:1);