Sign in

username:

password:



Not a member?

Search c55x



Search tips

Subscribe to c55x



c55x by Keywords

AIC23 | C5509 | CCS | CSL | EMIF | EVM | GEL | GPIO | HPI | Interfacing | JTAG | McBSP | OMAP | Omap15 | OMAP59 | RTDX | SDRAM | TMS320VC5509 | USB | XDS5

Discussion Groups

Discussion Groups | TMS320C55x | question on converting matlab code into C code (DSK5510)

Technical discussions about the TI C55x DSPs (including the c5501, c5502, c5503, c5507, c5509, c5510 and OMAP5910).

  

Post a new Thread

question on converting matlab code into C code (DSK5510) - rais...@126.com - Apr 18 6:46:14 2008



Hi everyone,

I am doing a project recently, which involves converting a matlab code into the C code , and
doing implements on the TI 5510 DSK board. I don't have too much experience on c programming,
so I got some prblems on this. I have searched the previous posts, but I can't find similar
cases, so I have to ask here.
The matlab code I want to convert is:
for i=1:3
    b=[gain zeros(1,round(d/i)) 1];
    a=[1 zeros(1, round(d/i)) gain];
    output = filter (b, a, output);
end

(gain, d, output are variables defined before.)
This is the filtering process actually. I don't know the way to generate b and a arrays; there
is a function "round" in CCS which has the same meaning with it in matlab, but I want
to know how to put some 0s in the arrays in C.

And this is a IIR filter. The IIR function in CCS is:
ushort oflag = iir32 (DATA *x, LDATA *h, DATA *r, LDATA *dbuffer, ushort nbiq, ushort nr)

There is only one variable "h" stores the coefficients. I am wondering how to add
both b and a in that function at same time?
I am the newbie in c programming, so could you please explain a little bit more specific?
Many thanks for your patient and time in advance!
------------------------------------

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution
for Commercial & Consumer End Equipment: www.ti.com/dm6467



(You need to be a member of c55x -- send a blank email to c55x-subscribe@yahoogroups.com )