PandA-2024.02
examples
MachSuite
MachSuite
viterbi
viterbi
viterbi.h
Go to the documentation of this file.
1
/*
2
Based on:
3
Lawrence Rabiner. "A Tutorial on Hidden Markov Models and Selected Applications in Speech Recognition." Proc. IEEE, v77, #2. 1989.
4
*/
5
6
#include <stdlib.h>
7
#include <stdio.h>
8
#include <stdint.h>
9
#include <fcntl.h>
10
#include "support.h"
11
12
#define TYPE double
13
typedef
uint8_t
tok_t
;
14
typedef
TYPE
prob_t
;
15
typedef
uint8_t
state_t
;
16
typedef
int32_t
step_t
;
17
18
//#define N_STATES 5
19
//#define N_OBS 32
20
//#define N_TOKENS 9
21
#define N_STATES 64
22
#define N_OBS 140
23
#define N_TOKENS 64
24
25
int
viterbi
(
tok_t
obs[
N_OBS
],
prob_t
init
[
N_STATES
],
prob_t
transition[N_STATES*N_STATES],
prob_t
emission[N_STATES*
N_TOKENS
],
state_t
path[N_OBS] );
26
28
// Test harness interface code.
29
30
struct
bench_args_t
{
31
tok_t
obs
[
N_OBS
];
32
prob_t
init
[
N_STATES
];
33
prob_t
transition
[
N_STATES
*
N_STATES
];
34
prob_t
emission
[
N_STATES
*
N_TOKENS
];
35
state_t
path
[
N_OBS
];
36
};
tok_t
uint8_t tok_t
Definition:
viterbi.h:13
prob_t
TYPE prob_t
Definition:
viterbi.h:14
step_t
int32_t step_t
Definition:
viterbi.h:16
viterbi
int viterbi(tok_t obs[N_OBS], prob_t init[N_STATES], prob_t transition[N_STATES *N_STATES], prob_t emission[N_STATES *N_TOKENS], state_t path[N_OBS])
Definition:
viterbi.c:3
bench_args_t::transition
prob_t transition[N_STATES *N_STATES]
Definition:
viterbi.h:33
bench_args_t::emission
prob_t emission[N_STATES *N_TOKENS]
Definition:
viterbi.h:34
bench_args_t::path
state_t path[N_OBS]
Definition:
viterbi.h:35
init
void init(int bucket[BUCKETSIZE])
Definition:
sort.c:42
bench_args_t::init
prob_t init[N_STATES]
Definition:
viterbi.h:32
N_OBS
#define N_OBS
Definition:
viterbi.h:22
state_t
uint8_t state_t
Definition:
viterbi.h:15
TYPE
#define TYPE
Definition:
viterbi.h:12
bench_args_t::obs
tok_t obs[N_OBS]
Definition:
viterbi.h:31
bench_args_t
Definition:
aes.h:18
N_STATES
#define N_STATES
Definition:
viterbi.h:21
N_TOKENS
#define N_TOKENS
Definition:
viterbi.h:23
Generated on Mon Feb 12 2024 13:02:50 for PandA-2024.02 by
1.8.13