First version of pitch DNN C code

Totally untested -- most likely doesn't work
This commit is contained in:
Jean-Marc Valin 2023-10-01 03:59:17 -04:00
parent 966a2d22eb
commit 33adba02c7
No known key found for this signature in database
GPG key ID: 531A52533318F00A
5 changed files with 97 additions and 3 deletions

30
dnn/pitchdnn.h Normal file
View file

@ -0,0 +1,30 @@
#ifndef PITCHDNN_H
#define PITCHDNN_H
typedef struct PitchDNN PitchDNN;
#include "pitchdnn_data.h"
#include "lpcnet_private.h"
#define NB_XCORR_FEATURES (PITCH_MAX_PERIOD-PITCH_MIN_PERIOD)
typedef struct {
PitchDNN model;
float gru_state[GRU_1_STATE_SIZE];
float xcorr_mem1[(NB_XCORR_FEATURES + 2)*2];
float xcorr_mem2[(NB_XCORR_FEATURES + 2)*2*8];
float xcorr_mem3[(NB_XCORR_FEATURES + 2)*2*8];
} PitchDNNState;
void pitchdnn_init(PitchDNNState *st);
int compute_pitchdnn(
PitchDNNState *st,
const float *if_features,
const float *xcorr_features
);
#endif