Skip to content

Instantly share code, notes, and snippets.

View tuxzz's full-sized avatar
:shipit:

tux tuxzz

:shipit:
View GitHub Profile
# PMX 2.0 file format #
This is a description of the PMX file format. This is used for 3D models in Miku Miku Dance (MMD).
Since I couldn't find any English descriptions of the PMX file format, I've made this, which is translated from http://gulshan-i-raz.geo.jp/labs/2012/10/17/pmx-format1/. I haven't used this file format yet, so please don't ask me what everything means.
An English guide to the PMD file format, which preceeded PMX, can be found here: http://mikumikudance.wikia.com/wiki/MMD:Polygon_Model_Data.
If you want to learn more, there are some open source projects on GitHub which can read this format, so go take a look at them.
Note: fields with type text begins with an int (32 bit) with how many bytes of text the section is.
@tuxzz
tuxzz / levinson.jl
Created January 18, 2016 08:39 — forked from jameslyons/levinson.jl
Levinson durbin recursion for LPC calculation
function levinson(R,L)
a = zeros(L,L)
P = zeros(1,L)
# for m = 1
a[1,1] = -R[2]/R[1]
P[1] = R[1]*(1-a[1,1]^2)
# for m = 2,3,4,..L
for m = 2:L
@tuxzz
tuxzz / arcov.jl
Created January 18, 2016 08:39 — forked from jameslyons/arcov.jl
covariance method of LPC calculation
function arcov(x,L)
N = length(x)
phi = zeros(L+1,L+1)
for k = 0:L, i=0:L, n=L:N-1
phi[k+1,i+1] += x[n+1-k]*x[n+1-i]
end
phi = phi./(N-L)
a = phi[2:end,2:end]\-phi[2:end,1]
P = phi[1,1] + phi[1,2:end]*a
@tuxzz
tuxzz / armcov.jl
Created January 18, 2016 08:39 — forked from jameslyons/armcov.jl
Modified covariance method (a.k.a forward-backward method) of LPC calculation
function armcov(x,L)
N = length(x)
phi = zeros(L+1,L+1)
for k = 0:L, i=0:L, n=0:N-L-1
phi[k+1,i+1] += x[n+1+k]*x[n+1+i] + x[n+1+L-k]*x[n+1+L-i]
end
phi = phi./(2*(N-L))
a = phi[2:end,2:end]\-phi[2:end,1]
P = phi[1,1] + phi[1,2:end]*a
@tuxzz
tuxzz / arburg.jl
Created January 18, 2016 08:09 — forked from jameslyons/arburg.jl
burg method of LPC computation
function arburg(x,p)
N = length(x)
P = zeros(1,p+1)
f = zeros(p+1,N)
b = zeros(p+1,N)
a = zeros(p,p)
# Initialisation
f[1,:] = x