Microchip® Advanced Software Framework

nlms_example.c File Reference

32-bit NLMS filtering

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include <avr32/io.h>
#include "compiler.h"
#include "board.h"
#include "dsp.h"
#include "dsp_debug.h"
#include "sysclk.h"
#include "cycle_counter.h"

Macros

#define FIR_COEF_SIZE   12
 
#define SIZE   64
 The size of the input signal. More...
 

Functions

int main (int argc, char *argv[])
 The main function. More...
 

Variables

A_ALIGNED dsp32_t input_d [SIZE]
 Buffer containing filtered input data. More...
 
A_ALIGNED dsp32_t input_x [SIZE]
 Buffer containing input data. More...
 
A_ALIGNED dsp32_t unknown_coef_filter [FIR_COEF_SIZE]
 
A_ALIGNED dsp32_t w [FIR_COEF_SIZE]
 Coefficients of the filter. More...
 
A_ALIGNED dsp32_t x [FIR_COEF_SIZE]
 

#define FIR_COEF_SIZE   12

Referenced by main().

#define SIZE   64

The size of the input signal.

Referenced by main().

int main ( int  argc,
char *  argv[] 
)

The main function.

Note
the call to sysclk_init() will disable all non-vital peripheral clocks, except for the peripheral clocks explicitly enabled in conf_clock.h.

References dsp32_debug_sprintf(), dsp32_filt_nlms(), dsp_debug_initialization, FIR_COEF_SIZE, input_d, input_x, SIZE, sysclk_init(), w, and x.

Buffer containing filtered input data.

Referenced by main().

Buffer containing input data.

Referenced by main().

A_ALIGNED dsp32_t unknown_coef_filter[FIR_COEF_SIZE]
Initial value:
= {
DSP32_Q(0.0132),
DSP32_Q(0.0254),
DSP32_Q(0.0579),
DSP32_Q(0.1006),
DSP32_Q(0.1398),
DSP32_Q(0.1632),
DSP32_Q(0.1632),
DSP32_Q(0.1398),
DSP32_Q(0.1006),
DSP32_Q(0.0579),
DSP32_Q(0.0254),
}
#define DSP32_Q(fnum)
Convert a float into a 32-bit signed fixed-point type.
Definition: dsp_types.h:294

Coefficients of the filter.

Referenced by main().