Skip to content

Add ac2rc: autocorrelation to reflection coeffs#39

Merged
lostbard merged 1 commit into
gnu-octave:mainfrom
phychi:main
Jun 17, 2026
Merged

Add ac2rc: autocorrelation to reflection coeffs#39
lostbard merged 1 commit into
gnu-octave:mainfrom
phychi:main

Conversation

@phychi

@phychi phychi commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

The results I achieved are the same as those from MATLAB. Unfortunately, ac2rc and ac2poly handle row and column vectors differently, which is reflected in their respective documentation for the same input r. It’s not a bug, but a feature, though it is indeed somewhat counterintuitive. Both functions are implemented by directly calling levinson.

ac2rc: Autocorrelation sequence, specified as a vector or as a matrix. The ac2rc function treats each column of r as a separate channel.
ac2poly: Autocorrelation sequence, specified as a vector or as a matrix. If you specify r as a matrix, ac2poly treats each column of r as a separate channel.
Therefore, the following results are obtained:

>> r = [3, -1, -4, 3, 1, -2];
>> [k, r0] = ac2rc(r)

k =

    0.3333
    1.6250
   -0.4857
   -0.9145
    3.6719


r0 =

     3
    -1
    -4
     3
     1
    -2

>> [k, r0] = ac2rc(r')

k =

    0.3333
    1.6250
   -0.4857
   -0.9145
    3.6719


r0 =

     3

@lostbard lostbard merged commit 6f3596a into gnu-octave:main Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants