Skip to content

File ns_audio_melspec.h

FileList > includes-api > ns_audio_melspec.h

Go to the source code of this file

  • #include "arm_math.h"
  • #include "ns_audio_features_common.h"

Classes

Type Name
struct ns_melspec_cfg_t

Public Functions

Type Name
void ns_melspec_audio_to_stft (ns_melspec_cfg_t * c, const int16_t * audio_data, float32_t * stft_out)
convert the audio samples into a short-time fourier transform
void ns_melspec_init (ns_melspec_cfg_t * c)
initialize data structures used for mel spectrogram related functions
void ns_melspec_melspec_to_stft (ns_melspec_cfg_t * c, const float32_t * melspec_in, float32_t * stft_out)
Inverts a mel spectrogram back into linear short-time fourier transform.
void ns_melspec_stft_to_audio (ns_melspec_cfg_t * c, float32_t * stft_in, int16_t * audio_out)
Inverts short-time fourier transform into a reconstructed audio sample.
void ns_melspec_stft_to_compressed_melspec (ns_melspec_cfg_t * c, const float32_t * stft_in, float32_t * melspec_out)
Converts complex valued short-time fourier transform into real-valued, power compressed mel scaled space.

Public Functions Documentation

function ns_melspec_audio_to_stft

convert the audio samples into a short-time fourier transform

void ns_melspec_audio_to_stft (
    ns_melspec_cfg_t * c,
    const int16_t * audio_data,
    float32_t * stft_out
) 

Result is complex valued (containing magnitude and phase info in alternating 32-bit values, so stft_out should be 2*MELSPEC_FRAME_LEN

function ns_melspec_init

void ns_melspec_init (
    ns_melspec_cfg_t * c
) 

function ns_melspec_melspec_to_stft

void ns_melspec_melspec_to_stft (
    ns_melspec_cfg_t * c,
    const float32_t * melspec_in,
    float32_t * stft_out
) 

function ns_melspec_stft_to_audio

Inverts short-time fourier transform into a reconstructed audio sample.

void ns_melspec_stft_to_audio (
    ns_melspec_cfg_t * c,
    float32_t * stft_in,
    int16_t * audio_out
) 

We assume the stft input is complex valued (containing magnitude and phase info in alternating 32-bit values).

Note that this operation currently modifies the input buffer!

function ns_melspec_stft_to_compressed_melspec

void ns_melspec_stft_to_compressed_melspec (
    ns_melspec_cfg_t * c,
    const float32_t * stft_in,
    float32_t * melspec_out
) 

The documentation for this class was generated from the following file neuralSPOT/neuralspot/ns-audio/includes-api/ns_audio_melspec.h