#ifndef SIGNAL_PROCESSING_H
#define SIGNAL_PROCESSING_H

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "config.h"
#include "matrix.h"
#include "fft.h"

// Funkce
matrix * sp_dct_II(matrix * s);
matrix * sp_signal_log_energy(matrix * s);
#define SP_ADD_NULL 1
#define SP_DONT_ADD_NULL 0
matrix * sp_enframe(matrix * vec, unsigned int win, unsigned int inc, unsigned int add_null);
matrix * sp_filter(matrix * x, matrix * A, matrix * B);
int sp_signum(double x);
matrix * sp_zero_crossing(matrix * vec);
matrix *sp_diff(matrix *s, double dt);
matrix *sp_deltas(matrix *x, unsigned int M);
unsigned int sp_frame_first_index (unsigned int si, unsigned int win, unsigned int inc);
unsigned int sp_frame_last_index (unsigned int si, unsigned int win, unsigned int inc);
unsigned int sp_frame_middle_index (double si, unsigned int win, unsigned int inc);
void sp_frame_location(unsigned int sa, unsigned int sb, unsigned int *beg, unsigned int *end, unsigned int win, unsigned int inc);
double sp_freq2mel (double f_hz);
double sp_mel2freq(double f_mel);
matrix * sp_mfcc(matrix * s, unsigned int nb, double mel_min, double mel_max, double F);
void sp_stat_norm_aply(matrix *mat, matrix *avarge, matrix *stdev);

matrix *sp_lpc_autocor(matrix *S, unsigned int P);
matrix **sp_lpc_linsys(matrix *autocor);
matrix *sp_lpc(matrix *s, unsigned int P);
matrix *sp_lpc_cepstrum(matrix *s, unsigned int P, unsigned int N);


#endif