•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 425,779 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,325 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser: Programming Forums
Views: 616 | Replies: 1
![]() |
•
•
Join Date: May 2008
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hi Guys i want to implement iir filter in assembly in c64x processor. preferably fixed point algorithm. Here is the c code of iir filter which i have written.
c Syntax (Toggle Plain Text)
#include<stdio.h> void main() { float ip1_seq[10]={1,1,1,1}; float b[10]={0.049,0.074,0.105,0.074,0.049},a[10]={-1.715,1.726,-0.85,0.195}; int len_ip=4,al=5,bl=5; int n,k,i,len_seq=0; float op_seq[10]={0},op1_seq[10]={0},op2_seq[10]={0}; len_seq=al; if(al!=bl) len_seq=(al<bl)?bl:al; if(len_seq!=len_ip) len_seq=(len_seq<len_ip)?len_ip:len_seq; for(i=len_ip;i<len_seq;i++)//padding zeros ip1_seq[i]=0; for(i=al;i<len_seq;i++)//padding zeros a[i]=0; for(i=bl;i<len_seq;i++)//padding zeros b[i]=0; //CIRCULAR CONVOLUTION EQUA IMPLEMENTATION for(n=0;n<len_seq;n++) { for(k=0;k<=n;k++) { op1_seq[n]+=b[k]*ip1_seq[n-k]; } for(k=0;k<=n;k++) { op2_seq[n]+=(-a[k])*op_seq[n-k]; } op_seq[n+1]=op1_seq[n]+op2_seq[n]; } //END OF CIRCULAR CONVOLUTION EQUATION //DISPLAY OUTPUT for(k=1;k<len_ip+1;k++) printf("%f\n",op_seq[k]); //END OF DISPLAY OUTPUT }
Last edited by Ancient Dragon : May 17th, 2008 at 1:46 am. Reason: add code tags
So what do you want us to do about it?
Do you have a C compiler which targets your processor?
The GCC compiler does - http://gcc.gnu.org/onlinedocs/gcc-4....bmodel-Options
Having found that, does your existing algorithm have adequate performance without resorting to hand-crafting fixed point for everything?
As a first step, I would consider wrapping each of the floating point operations as function calls, to make for easier substitution later on. Of course, if you did this in C++, it would be a breeze as you could just write a fixed point class with a few inline functions and let it do all th e work for you.
Do you have a C compiler which targets your processor?
The GCC compiler does - http://gcc.gnu.org/onlinedocs/gcc-4....bmodel-Options
Having found that, does your existing algorithm have adequate performance without resorting to hand-crafting fixed point for everything?
As a first step, I would consider wrapping each of the floating point operations as function calls, to make for easier substitution later on. Of course, if you did this in C++, it would be a breeze as you could just write a fixed point class with a few inline functions and let it do all th e work for you.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Assembly Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Other Threads in the Assembly Forum
- Previous Thread: Macros anyone?
- Next Thread: How to convert assembly code to any use language ..



Linear Mode