Atmel Software Framework

simulator_examples/dsp32_iir/iir_example.c File Reference

32-bit IIR filtering

Copyright (c) 2011-2012 Atmel Corporation. All rights reserved.

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

Macros

#define DEN_PREDIV   3
 
#define DEN_SIZE   5
 
#define NUM_PREDIV   3
 
#define NUM_SIZE   6
 
#define SIZE   48
 

Functions

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

Variables

A_ALIGNED dsp32_t den [DEN_SIZE]
 
A_ALIGNED dsp32_t num [NUM_SIZE]
 
A_ALIGNED dsp32_t x [SIZE+NUM_SIZE-1]
 The input signal (sampling rate: 48KHz) A mix between a 4000 Hz and a 1000 Hz signal (mixed by addition) More...
 
A_ALIGNED dsp32_t y [SIZE+DEN_SIZE]
 The output buffer. More...
 

#define DEN_PREDIV   3

Referenced by main().

#define DEN_SIZE   5

Referenced by main().

#define NUM_PREDIV   3

Referenced by main().

#define NUM_SIZE   6

Referenced by main().

#define SIZE   48

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 den, DEN_PREDIV, DEN_SIZE, dsp32_debug_sprintf(), dsp32_filt_iir(), dsp_debug_initialization, FOSC0, i, num, NUM_PREDIV, NUM_SIZE, SIZE, sysclk_init(), x, and y.

Initial value:
= {
DSP32_Q(-4.1534907 / (1 << DEN_PREDIV)),
DSP32_Q(6.9612765 / (1 << DEN_PREDIV)),
DSP32_Q(-5.877997 / (1 << DEN_PREDIV)),
DSP32_Q(2.498365 / (1 << DEN_PREDIV)),
}
#define DSP32_Q(fnum)
Convert a float into a 32-bit signed fixed-point type.
Definition: dsp_types.h:301
#define DEN_PREDIV
Definition: simulator_examples/dsp32_iir/iir_example.c:92
Initial value:
= {
DSP32_Q(0.6537018 / (1 << NUM_PREDIV)),
DSP32_Q(-3.2685088 / (1 << NUM_PREDIV)),
DSP32_Q(6.5370176 / (1 << NUM_PREDIV)),
DSP32_Q(-6.5370176 / (1 << NUM_PREDIV)),
DSP32_Q(3.2685088 / (1 << NUM_PREDIV)),
}
#define DSP32_Q(fnum)
Convert a float into a 32-bit signed fixed-point type.
Definition: dsp_types.h:301
#define NUM_PREDIV
Definition: simulator_examples/dsp32_iir/iir_example.c:90

The input signal (sampling rate: 48KHz) A mix between a 4000 Hz and a 1000 Hz signal (mixed by addition)

Initial value:
= {
}

The output buffer.