Anonymous
Not applicable
Jan 07, 2015
03:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 07, 2015
03:00 PM
Hi
I use application AN2284 to create notch filter 50Hz. In this app is C code
IIR second-order notch filter:
diff1 = (x + xn_2) <<16;
y = ((diff1>>1)+(diff1>>2)+87301*(xn_1 - yn_1) -((yn_2<<16)>>1));
xn_2 = xn_1;
xn_1 = x;
yn_2 = yn_1;
yn_1 = y;
I know IIR filters but I don't understand where it came from value 87301 ?
I thought that the filter is formed from the coefficients. for example. b=-2*cos(2*PI*f)
I would be grateful someone explain how it works.
Labels
- Labels:
-
PSoC 1
1 Reply
Jan 07, 2015
04:00 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 07, 2015
04:00 PM
I think what you are seeing is scaling so the filter is done with
integers vs floating point which would eat up a lot of MIPS and
code space. Note the M8C core has a fast MAC in it.
Regards, Dana.