dspic Filter / dspic30F4013

Gast #836984
Lesenswert?

Ich habe ein Problem mit einem digitalen Filter, implementiert mit 
dspic30F4013 unter MPLAB C30 dsp Library:


Ein FIR n-ter Ordnung macht doch folgendes:

y(n) = summe(j=0;n) x(n-j) * h(j)

***** Ist das noch richtig ??? ******

wenn ich nun die Ordnung auf Null (TAPS=1) setze ist das:

y(n) = x(n) * h(0)

mit einem Koeffizienten h(0)

Das folgende Programm liefert zwar
Werte für y, jedoch verstehe ich nicht wie sie zustandekommen:

bei mir ist   (umgerechnete fractional werte sind nach dem =:)

x = 1  =: 2^(-15)
coeffs[0] = h[0] = 8 =: 2^(-12)

das Resultat nach dem ersten Filterdurchgang ist

y = 4 =: 2^(-13)

wie kann das sein ?

2^(-15) * 2^(-12) müsste doch verschwinden - oder ?

Wieso wird es grösser?


--
Vielen Dank für eventuelle Antworten
Michael


1
#include <p30f4013.h>
2
#include <stdio.h>
3
#include <stdlib.h>
4

5
#include "fir.h"
6

7
#define TAPS 1
8

9
/* local function prototypes */
10

11

12

13
/* static variables */
14

15
fractional coeffs[TAPS] __attribute__ ((space(xmemory)));
16
fractional delay[TAPS]  __attribute__ ((space(ymemory)));
17
FIRStruct filter ;
18
fractional x[2], y[2];
19

20

21

22
/* extern variables */
23

24

25
/* function declarations */
26

27
void FIR_Init(void)
28
{
29
coeffs[0] = 8;
30

31
fractional x[10] = 
32
    {  
33
            1,0,0,0,0,0,0,0,0,0
34
            };
35

36
FIRStructInit(&filter, TAPS, coeffs, COEFFS_IN_DATA, delay);
37
FIRDelayInit(&filter);
38

39
FIR (1, y, x, &filter);
40

41

42
}

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren