Module dyn_prog_pitch
[frames] | no frames]

Module dyn_prog_pitch

source code

Viterbi search.

Functions
 
path(nodecost, linkcost, extra_info, N, T)
This function returns a tuple of the cost of the best path and the best path, shown as an array: (cost, [j])
source code
Variables
  HUGE = 1e+30
  __package__ = None

Imports: Num


Function Details

path(nodecost, linkcost, extra_info, N, T)

source code 

This function returns a tuple of the cost of the best path and the best path, shown as an array: (cost, [j])

nodecost(t, extra_info) -> ([j-j0], j0, jn) at time t, pitch=j All nodes with j<j0 or j>=jn have infinite cost. linkcost(t, extra_info) -> ([j1, j2-j0], j0, jn) this is the cost to go from (t,j1) to (t+1,j2), where j=pitch. Note the first index spans from 0 to N. All links that have either j1 or j1 outside of [j0,jn) have infinite cost. The extra_info argument isn't used by this function; it is simply passed down to the nodecost() and linkcost functions. T=number of time steps N = Largest possible pitch