Skip to content

File ns_mfcc.c

FileList > neuralSPOT > neuralspot > ns-audio > src > ns_mfcc.c

Go to the source code of this file

Based on original Arm version, see below. More...

  • #include "am_bsp.h"
  • #include "am_mcu_apollo.h"
  • #include "am_util.h"
  • #include "float.h"
  • #include "ns_audio_features_common.h"
  • #include "ns_audio_mfcc.h"
  • #include "ns_core.h"

Public Attributes

Type Name
arm_rfft_fast_instance_f32 g_mfccRfft
const ns_core_api_t ns_mfcc_V0_0_1
const ns_core_api_t ns_mfcc_V1_0_0
const ns_core_api_t ns_mfcc_current_version
const ns_core_api_t ns_mfcc_oldest_supported_version

Public Functions

Type Name
uint32_t ns_mfcc_compute (ns_mfcc_cfg_t * c, const int16_t * audio_data, float * mfcc_out)
Computes MFCC based on audio data.
uint32_t ns_mfcc_init (ns_mfcc_cfg_t * c)
Initializes the MFCC calculator based on desired configuration.

Public Static Functions

Type Name
void create_dct_matrix (ns_mfcc_cfg_t * cfg, int32_t input_length, int32_t coefficient_count)
void ns_mfcc_map_arena (ns_mfcc_cfg_t * cfg)

Detailed Description

Author:

Carlos Morales

Version:

0.1

Date:

2022-08-09

Copyright:

Copyright (c) 2022

Public Attributes Documentation

variable g_mfccRfft

arm_rfft_fast_instance_f32 g_mfccRfft;

variable ns_mfcc_V0_0_1

const ns_core_api_t ns_mfcc_V0_0_1;

variable ns_mfcc_V1_0_0

const ns_core_api_t ns_mfcc_V1_0_0;

variable ns_mfcc_current_version

const ns_core_api_t ns_mfcc_current_version;

variable ns_mfcc_oldest_supported_version

const ns_core_api_t ns_mfcc_oldest_supported_version;

Public Functions Documentation

function ns_mfcc_compute

Computes MFCC based on audio data.

uint32_t ns_mfcc_compute (
    ns_mfcc_cfg_t * c,
    const int16_t * audio_data,
    float * mfcc_out
) 

Parameters:

  • c - configuration struct (see ns_mfcc_cfg_t) from ns_mfcc_init
  • audio_data - pointer to audio data (int16_t)
  • mfcc_out - pointer to output buffer (float)

Returns:

uint32_t

function ns_mfcc_init

Initializes the MFCC calculator based on desired configuration.

uint32_t ns_mfcc_init (
    ns_mfcc_cfg_t * c
) 

Parameters:

Returns:

uint32_t status

Public Static Functions Documentation

function create_dct_matrix

static void create_dct_matrix (
    ns_mfcc_cfg_t * cfg,
    int32_t input_length,
    int32_t coefficient_count
) 

function ns_mfcc_map_arena

static void ns_mfcc_map_arena (
    ns_mfcc_cfg_t * cfg
) 

The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-audio/src/ns_mfcc.c